pan_pp.pytorch
pan_pp.pytorch copied to clipboard
Too many bboxes detection during testing
Thanks for your work.
when I tried to test PAN++ with poly type network produce too many polygon points. which is not similar to total text ground truth file. could you please let me know how can I generate like total text ground truth polygon?

hey, can you help me with, how to do visualization using pan?
Thanks
@aswa123 you can visualize using opencv fillpoly function.
with torch.no_grad():
outputs = model(**data)
if cfg.report_speed:
report_speed(outputs, speed_meters)
bboxes = outputs['bboxes']
img_name=os.path.basename(image_path)
filename, file_extension = os.path.splitext(img_name)
with open(os.path.join(result_path,filename+'.txt'), 'w') as f:
for i, bbox in enumerate(bboxes):
poly = np.array(bbox).astype(np.int32).reshape((-1))
strResult = '\t'.join([str(p) for p in poly]) + '\r\n'
f.write(strResult)
poly = poly.reshape(-1, 2)
cv2.polylines(ori_img, [poly.reshape((-1, 1, 2))], True, color=(0, 0, 255), thickness=2)
result_name='res_%s.jpg' % filename
cv2.imwrite(os.path.join(result_path,result_name), ori_img)
Thank you so much @bharatsubedi
may I know where should I add this code? OR can you send me your .py file for visualization?
because I am new in this field.
Thank you in advance.
Thank you so much @bharatsubedi
may I know where should I add this code? OR can you send me your .py file for visualization?
because I am new in this field.
Thank you in advance.
Did you receive the .py file? I also need it now. Thank you !
use this block of code in test.py file
image_path
ok! thank you!