Skip to content

Commit

Permalink
Update get_dr_txt.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bubbliiiing authored Sep 9, 2020
1 parent 7a73cb0 commit da6d24d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions get_dr_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
from PIL import Image,ImageFont, ImageDraw
from utils.config import Config
from utils.utils import non_max_suppression, bbox_iou, DecodeBox,letterbox_image,yolo_correct_boxes
from tqdm import tqdm

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

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


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


print("Conversion completed!")

0 comments on commit da6d24d

Please sign in to comment.