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.

test09.py 1.2 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637
  1. import sys
  2. import os
  3. import random
  4. import numpy as np
  5. import shutil
  6. sys.path.append("/home/shanwei-luo/userdata/mmdetection")
  7. from mmdet.apis import (async_inference_detector, inference_detector,
  8. init_detector, show_result_pyplot)
  9. config_file_1 = '/home/shanwei-luo/userdata/mmdetection/work_dirs/AD_dsxw_test70/AD_dsxw_test70.py'
  10. checkpoint_file_1 = '/home/shanwei-luo/userdata/mmdetection/work_dirs/AD_dsxw_test70/epoch_38.pth'
  11. img_path = '/home/shanwei-luo/userdata/datasets/PCBA_dataset_v15_MLOPS/ok/'
  12. dis_path = '/home/shanwei-luo/userdata/datasets/PCBA_dataset_v15_MLOPS/v3_finetune/dsxw_train/images/'
  13. imgs = os.listdir(img_path)
  14. imgs_name = []
  15. for img in imgs:
  16. imgs_name.append(img_path+img)
  17. np_result = np.load('/home/shanwei-luo/userdata/datasets/PCBA_dataset_v15_MLOPS/result.npy')
  18. result_score = np_result.tolist()
  19. for k_v in np.arange(0.05, 0.1, 0.005):
  20. count = 0
  21. index = 0
  22. k_v = 0.07
  23. for result in result_score:
  24. if result>=k_v:
  25. shutil.copy(img_path+imgs[index], dis_path+imgs[index])
  26. count +=1
  27. print(count)
  28. index += 1
  29. print(k_v, count)
  30. break
  31. imgs = os.listdir(dis_path)
  32. print(len(imgs))

No Description

Contributors (3)