CTPN icon indicating copy to clipboard operation
CTPN copied to clipboard

the results are different

Open xsd1221 opened this issue 8 years ago • 21 comments

Hello, I have built this demo on my computer. But I found that the result on demo and another on website are some different. Could you tell me whether the algorithms between them may be a little different? Thanks a lot!

xsd1221 avatar Dec 16 '16 01:12 xsd1221

@xsd1221 Thank you for your interest. The core methods are same. However, to handle the various images uploaded by users, we use a little different configurations in the online demo. The major difference is that the input images of the demo are zooming in by 1.2 instead of resizing to 600xN. Thank you:-).

tianzhi0549 avatar Dec 16 '16 09:12 tianzhi0549

Thanks for the reply !

xsd1221 avatar Dec 19 '16 01:12 xsd1221

Excuse me, would you plan to provide the train_val.prototxt ? I want to use my images to train a new model fot testing. Thanks a lot !

xsd1221 avatar Dec 22 '16 05:12 xsd1221

The maximum image size I can run with my GPU is 800xN, and I still don't have the same performances as your demo.

What GPU do you use?

riless avatar Dec 22 '16 15:12 riless

@riless We use K40 for the demo.

tianzhi0549 avatar Dec 22 '16 15:12 tianzhi0549

@tianzhi0549 with only 12GB of RAM ?

riless avatar Dec 22 '16 15:12 riless

@riless Yes.

tianzhi0549 avatar Dec 22 '16 15:12 tianzhi0549

@xsd1221 I am so sorry that I can't release the file since it heavily depends on the training code that cannot be released now. However, if you have any questions when implementing the training code, please feel free to ask me. Thank you:-).

tianzhi0549 avatar Dec 22 '16 15:12 tianzhi0549

@tianzhi0549 I've a TITAN X (Pascal) with 12GB of RAM too, but I have an error like this when I run the test on an 1000*N image

Check failed: error == cudaSuccess (2 vs. 0) out of memory

The same image works fine on your online demo.

riless avatar Dec 22 '16 15:12 riless

@riless You could set a maximum value for the longer side to avoid the issue. Thank you:-).

tianzhi0549 avatar Dec 22 '16 16:12 tianzhi0549

@tianzhi0549 , @bariskandemir Hi, I got the same problem. When I test the image on the attachment online and offline, I got the different result. See in the attachment. Thanks! (Offline and online respectively) Note: I made the box thickness five in the offline version. And changed the scale to zoom 1.2. I am running in no-gpu mode. offline online_demo

kzw5309 avatar Jan 09 '17 21:01 kzw5309

@kzw5309 Thank you for your interest. The different is because the parameters in tools/cfg.py are also a little different. You can show the text proposals. I think they have probably been detected. You can change these parameters yourself in your case.

tianzhi0549 avatar Jan 10 '17 01:01 tianzhi0549

@tianzhi0549 Thanks for your reply. I have tried a lot of different parameters, but none of the results are optimal. Could you share the parameters you set up for online demo with me?

kzw5309 avatar Jan 12 '17 16:01 kzw5309

@kzw5309 The parameters we're using in our online demo are:

MIN_RATIO=0.9
LINE_MIN_SCORE=0.6
TEXT_LINE_NMS_THRESH=0.3
MAX_HORIZONTAL_GAP=50
TEXT_PROPOSALS_MIN_SCORE=0.7
TEXT_PROPOSALS_NMS_THRESH=0.3
MIN_NUM_PROPOSALS=0
MIN_V_OVERLAPS=0.6
MIN_SIZE_SIM=0.6

Thank you:-).

tianzhi0549 avatar Jan 15 '17 15:01 tianzhi0549

@tianzhi0549 I tried the parameters you posted on my own data, but the result is still different from your online demo, which seems to be working better. Problem may be the scale used. You said something above about the scale of the picture. The following is configure file we used in offline demo: class Config: MEAN=np.float32([102.9801, 115.9465, 122.7717]) TEST_GPU_ID=0 SCALE=600 MAX_SCALE=1200

LINE_MIN_SCORE=0.6
TEXT_PROPOSALS_MIN_SCORE=0.7
TEXT_PROPOSALS_NMS_THRESH=0.3
MAX_HORIZONTAL_GAP=50
TEXT_LINE_NMS_THRESH=0.3
MIN_NUM_PROPOSALS=0
MIN_RATIO=0.9
MIN_V_OVERLAPS=0.6
MIN_SIZE_SIM=0.6
TEXT_PROPOSALS_WIDTH=0

I am trying to use your method as it is. If you can help me, I would appreciate. For example, the following picture: offline: 688 online: 688online

kzw5309 avatar Jan 19 '17 16:01 kzw5309

@kzw5309 Have you tried to set the scale in your demo according to what I mentioned before?

tianzhi0549 avatar Jan 20 '17 18:01 tianzhi0549

@tianzhi0549 I am new in this area and a little confused about "zoom in 1.2" you mentioned before? Do you mean resize the picture to 1.2 or Image Pyramids? Could you tell me what exactly should I do? Thanks a lot!

kzw5309 avatar Jan 21 '17 16:01 kzw5309

@kzw5309 For example, if your original image is 600x900, the image input to the network will be (600x1.2)x(900x1.2)=720x1080. You also need to set a maximum scale (eg. 1500) to avoid out of memory. Thank you:-).

tianzhi0549 avatar Jan 22 '17 16:01 tianzhi0549

@tianzhi0549 I did the 1.2x resize in the demo.py, the code is showing below:

im=cv2.resize(im, (0,0), fx=1.2, fy=1.2) im, f=resize_im(im, cfg.SCALE, cfg.MAX_SCALE)

The input image size now is the same with online demo image, but the result is still different. Does the no-gpu mode affect the result

kzw5309 avatar Jan 25 '17 21:01 kzw5309

@kzw5309 No, the CUP mode and GPU mode should give the same results. Can you post the images here? And why do you still use resize_im() after resizing the image with cv2.resize()?

tianzhi0549 avatar Jan 26 '17 03:01 tianzhi0549

@tianzhi0549 Hi! Tianzhi, I test your model on ICDAR2013 using the voc_val.py provided by py-faster-rcnn, why the result only 0.002? Is any thing that I missing for get the right result?

LearnerInGithub avatar Mar 30 '17 08:03 LearnerInGithub