eg4000 / SKU110K_CVPR19

767 stars 181 forks source link

cv2.error: in function cv::pointPolygonTest #12

Closed livecle closed 5 years ago

livecle commented 5 years ago

when I run predict.py, I met this error in EmMerger.py.Could you give me some help? Thanks.

cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\geometry.cpp:103: error: (-215:Assertion failed) total >= 0 && (depth == CV_32S || depth == CV_32F) in function 'cv::pointPolygonTest'

Traceback (most recent call last): File "predict.py", line 155, in main() File "predict.py", line 150, in main hard_score_rate=hard_score_rate File "D:\chenle\SKU110K_CVPR19.git\trunk\object_detector_retinanet\keras_retinanet\utils\predict_iou.py", line 81, in predict filtered_data = EmMerger.merge_detections(image_name, results) File "D:\chenle\SKU110K_CVPR19.git\trunk\object_detector_retinanet\keras_retinanet\utils\EmMerger.py", line 387, in merge_detections filtered_data = duplicate_merger.filter_duplicate_candidates(result_df, pixel_data) File "D:\chenle\SKU110K_CVPR19.git\trunk\object_detector_retinanet\keras_retinanet\utils\EmMerger.py", line 69, in filter_duplicate_candidates candidates = self.find_new_candidates(contours, heat_map, data, original_detection_centers, image) File "D:\chenle\SKU110K_CVPR19.git\trunk\object_detector_retinanet\keras_retinanet\utils\EmMerger.py", line 149, in find_new_candidates cov, mu, num, roi = self.remove_redundant(contour_bbox, cov, k, mu, image, sub_heat_map) File "D:\chenle\SKU110K_CVPR19.git\trunk\object_detector_retinanet\keras_retinanet\utils\EmMerger.py", line 214, in remove_redundant ct_i_to_pt_j = -cv2.pointPolygonTest(cnt_i, (mu[j][0], mu[j][1]), measureDist=True) cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\geometry.cpp:103: error: (-215:Assertion failed) total >= 0 && (depth == CV_32S || depth == CV_32F) in function 'cv::pointPolygonTest'

eg4000 commented 5 years ago

Duplicate of #10

livecle commented 5 years ago

Hi @eg4000, Thanks for your reply to help me solve this problem. But there is no output in the result folder. I also trained the IOU layer, the loss stabilized at around 0.4 after 30 epochs.

eg4000 commented 5 years ago

Unless there are other problems with OpenCV backward compatibility, there might be a problem with the OS or directory permissions. Can you debug the "save_path" parameter? Regarding loss value. please see here.

cvsourcerdo commented 5 years ago

Hi @eg4000, Thanks for your reply to help me solve this problem. But there is no output in the result folder. I also trained the IOU layer, the loss stabilized at around 0.4 after 30 epochs.

Hi @livecle, were you able to get an output in the results folder?

livecle commented 5 years ago

Hi @eg4000, Thanks for your reply to help me solve this problem. But there is no output in the result folder. I also trained the IOU layer, the loss stabilized at around 0.4 after 30 epochs.

Hi @livecle, were you able to get an output in the results folder?

No, this CSV file generated in the result folder is empty.

eg4000 commented 5 years ago

Hi,

I suggest you try to debug predict.py with 1 image to find the source of the problem, and I might be able to advise.

Thanks, Eran.