STVIR / PMTD

Pyramid Mask Text Detector designed by SenseTime Video Intelligence Research team.
215 stars 220 forks source link

Train error #13

Closed donglin8506 closed 5 years ago

donglin8506 commented 5 years ago

@JingChaoLiu Hello, I have a error when run PMTD_demo.py (--method="PlaneClustering"), but I modify --method = “HardThreshold”, it ok. I dont kwon why. And I use the trained model by myself.

Traceback (most recent call last): File "/home/donglin/projects/PMTD-inference/demo/PMTD_demo.py", line 104, in main() File "/home/donglin/projects/PMTD-inference/demo/PMTD_demo.py", line 84, in main predictions = pmtd_demo.run_on_opencv_image(image) File "/home/donglin/projects/PMTD-inference/demo/predictor.py", line 175, in run_on_opencv_image predictions = self.compute_prediction(image) File "/home/donglin/projects/PMTD-inference/demo/predictor.py", line 223, in compute_prediction masks = self.masker.forward_single_image(masks, prediction) File "/home/donglin/projects/PMTD-inference/demo/inference.py", line 27, in forward_single_image for mask, box in zip(masks, boxes.bbox) File "/home/donglin/projects/PMTD-inference/demo/inference.py", line 27, in for mask, box in zip(masks, boxes.bbox) File "/home/donglin/projects/PMTD-inference/demo/inference.py", line 44, in reg_pyramid_in_image planes = plane_clustering(pos_points, planes) File "/home/donglin/projects/PMTD-inference/demo/inference.py", line 87, in plane_clustering A = torch.gels(B, X)[0][:3] RuntimeError: Lapack Error in gels : The 1-th diagonal element of the triangular factor of A is zero at /opt/conda/conda-bld/pytorch_1556653114079/work/aten/src/TH/generic/THTensorLapack.cpp:165

kapness commented 5 years ago

@donglin8506 Hi, I reimplemented the baseline on maskrcnn.However,my result on ICDAR17 only reaches 73.5%, far away from 76% mentioned in paper. I'm confused about it. Could you please share the baseline source code with me?

JingChaoLiu commented 5 years ago

@donglin8506 A quick way for walking around is replacing except ValueError as e here with except (RuntimeError, ValueError) as e. This error may raise from an unexpected mask. See this mask by modifing the method reg_pyramid_in_image:

 def reg_pyramid_in_image(self, mask, box):
        ...
        except ValueError as e:
            # logger.info(f'catch Exception: {e}')
            points = boundary
        except RuntimeError as e:
            logger.info(f'catch Exception: {e}')
            import cv2
            mask_numpy = mask.numpy()
            cv2.imshow('image', mask_numpy)
            cv2.waitkey(0)
            exit(0)
        ...
donglin8506 commented 5 years ago

@JingChaoLiu I find that nearly all images occurs the situation in icdar2013. So this is because my trained model is bad? And then How I get correct result by PlaneClustering(method). Please, thank you !

donglin8506 commented 5 years ago

@kapness So sorry, I only train in icdar2013 and test in icdar2013 and icdar2015, but not in mlt2017.

JingChaoLiu commented 5 years ago

@donglin8506 Could you attach a mask image?

donglin8506 commented 5 years ago

This icdar13 img_9.jpg.

Under--method = HardThreshold, the test result is as follow: image

This is mask in PlaneClustering method as follow: image

JingChaoLiu commented 5 years ago

The ability of clustering the points into four planes comes from the gradient information between pixels. So the input of PlaneClustering has to be a soft mask as shown in the paper. Did you train this model by binary mask instead of pyramid mask?

donglin8506 commented 5 years ago

@JingChaoLiu Thanks very much. So I want to known where is the configuration of select binary mask or pyramid mask. Because I don't encounter this mask choice in my training process.

JingChaoLiu commented 5 years ago

Sorry, this work(PMTD) is performed on a company-private framework. Transfering all of the train code into maskrcnn-benchmark may need a long time. Recently, the train code may be inaccessible.

donglin8506 commented 5 years ago

@JingChaoLiu Still thank you very much, But I still want to know that only use tools/train_net.py and modified config and code, it's not enough to get good accuracy? Because I am training process in this way.

JingChaoLiu commented 5 years ago

The train scheduler in #2 and the relative improvement in #7 can be as a valid guideline. I'm afraid these details have covered all I have done for the baseline.

donglin8506 commented 5 years ago

Thank you Very much! Best regards!