run_coco_tools.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
  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 tempfile
  15. from testing_utils import run_script
  16. if __name__ == '__main__':
  17. run_script(
  18. f"python coco_tools/json_info_show.py --json_path ../tests/data/instances_val2017.json",
  19. wd="../tools")
  20. run_script(
  21. f"python coco_tools/json_image2json.py --image_dir ../tests/data/img_test --json_train_path ../tests/data/instances_train2017.json --result_path ../tests/data/test.json",
  22. wd="../tools")
  23. run_script(
  24. f"python coco_tools/json_merge.py --json1_path ../tests/data/instances_train2017.json --json2_path ../tests/data/instances_train2017.json --save_path ../tests/data/instances_trainval2017.json",
  25. wd="../tools")
  26. run_script(
  27. f"python coco_tools/json_split.py --json_all_path ../tests/data/instances_train2017.json --json_train_path ../tests/data/instances_train2017_1.json --json_val_path ../tests/data/instances_train2017_2.json",
  28. wd="../tools")
  29. run_script(
  30. f"python coco_tools/json_image_sta.py --json_path ../tests/data/instances_train2017.json --csv_path ../tests/data/instances_val2017_images.csv --pic_shape_path ../tests/data/images_shape.png --pic_shape_rate_path ../tests/data/shape_rate.png",
  31. wd="../tools")
  32. run_script(
  33. f"python coco_tools/json_anno_sta.py --json_path ../tests/data/instances_train2017.json --csv_path ../tests/data/instances_val2017_annos.csv --pic_shape_path ../tests/data/images_shape.png --pic_shape_rate_path ../tests/data/shape_rate.png --pic_pos_path ../tests/data/pos.png --pic_pos_end_path ../tests/data/pos_end.png --pic_cat_path ../tests/data/cat.png --pic_obj_num_path ../tests/data/obj_num.png",
  34. wd="../tools")