jediofgever / ROS_Raw_Kitti_Player

Ros Package to access and manipulate raw KITTI data, with Camera-LIDAR sensor fusion and Perception Tasks
MIT License
71 stars 12 forks source link

TypeError: Expected Ptr<cv::UMat> for argument '%s' #6

Closed fdxqnw closed 4 years ago

fdxqnw commented 4 years ago

I have configured the environment as required, then downloaded the modified_predictor.py and modified_webcam.py files, put them in the maskrcnn-benchmark-master / demo directory, renamed predictor.py and webcam.py, run python webcam.py, and appeared the following error is reported.

Traceback (most recent call last): File "webcam.py", line 105, in main() File "webcam.py", line 83, in main composite, top_predictions = coco_demo.run_on_opencv_image(img) File "/home/awen/maskrcnn-benchmark-master/demo/predictor.py", line 191, in run_on_opencv_image result = self.overlay_mask(result, top_predictions) File "/home/awen/maskrcnn-benchmark-master/demo/predictor.py", line 303, in overlay_mask thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE File "/home/awen/maskrcnn-benchmark-master/maskrcnn_benchmark/utils/cv2_util.py", line 17, in findContours contours, hierarchy = cv2.findContours(*args, **kwargs) TypeError: Expected Ptr for argument '%s

How can i solve these problems.

My computer configuration is ubuntu16.04, python3.7.5, torch1.1.0.

jediofgever commented 4 years ago

Hi @fdxqnw, I suspect that the image is not being fed into network somehow. In modified_webcam.py , make sure you call the inference function from modified_predictor.py, otherwise it will call original predictor.py which doesn't have the correct paths for KITTI images.

fdxqnw commented 4 years ago

Thank you for your reply. I changed the file named modified_predictor.py in line 301 of the ''thresh = mask[0, :, :, None]'' to ''thresh = mask[0, :, :, None].astype(np.uint8)'', and successfully ran out of the result.

jediofgever commented 4 years ago

Were you able to run the code and get similar results as in screenshot ?

fdxqnw commented 4 years ago

Yes, I have run the code and get similar results as in screenshot.

jediofgever commented 4 years ago

Ok glad to hear that, hopefully it was useful for you , I am closing this issue, feel free to open another one in case you encounter