You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

eval.py 1.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright 2021 The KubeEdge Authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. import logging
  15. import sedna
  16. from validate_utils import validate
  17. LOG = logging.getLogger(__name__)
  18. max_epochs = 1
  19. def main():
  20. # load dataset.
  21. test_data = sedna.load_test_dataset(data_format='txt', with_image=False)
  22. # read parameters from deployment config.
  23. class_names = sedna.context.get_parameters("class_names")
  24. class_names = [label.strip() for label in class_names.split(',')]
  25. input_shape = sedna.context.get_parameters("input_shape")
  26. input_shape = tuple(int(shape) for shape in input_shape.split(','))
  27. model = validate
  28. sedna.incremental_learning.evaluate(model=model,
  29. test_data=test_data,
  30. class_names=class_names,
  31. input_shape=input_shape)
  32. if __name__ == '__main__':
  33. main()