Skip to content

Commit da6d24d

Browse files
authored
Update get_dr_txt.py
1 parent 7a73cb0 commit da6d24d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

get_dr_txt.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
from PIL import Image,ImageFont, ImageDraw
1717
from utils.config import Config
1818
from utils.utils import non_max_suppression, bbox_iou, DecodeBox,letterbox_image,yolo_correct_boxes
19+
from tqdm import tqdm
1920

2021
class mAP_Yolo(YOLO):
2122
#---------------------------------------------------#
2223
# 检测图片
2324
#---------------------------------------------------#
2425
def detect_image(self,image_id,image):
25-
self.confidence = 0.05
26+
self.confidence = 0.001
2627
f = open("./input/detection-results/"+image_id+".txt","w")
2728
image_shape = np.array(np.shape(image)[0:2])
2829

@@ -82,13 +83,11 @@ def detect_image(self,image_id,image):
8283
os.makedirs("./input/images-optional")
8384

8485

85-
for image_id in image_ids:
86+
for image_id in tqdm(image_ids):
8687
image_path = "./VOCdevkit/VOC2007/JPEGImages/"+image_id+".jpg"
8788
image = Image.open(image_path)
8889
# 开启后在之后计算mAP可以可视化
8990
# image.save("./input/images-optional/"+image_id+".jpg")
9091
yolo.detect_image(image_id,image)
91-
print(image_id," done!")
9292

93-
9493
print("Conversion completed!")

0 commit comments

Comments
 (0)