eg4000 / SKU110K_CVPR19

767 stars 181 forks source link

requirement of CV version needs to be clarified #10

Closed HoracceFeng closed 5 years ago

HoracceFeng commented 5 years ago

Hi @eg4000 ,

I think you may need to clarify your CV version since your pipenv doesn't have. I met a bug about this in EmMerge.py:114, claimed that "cv2.boundingRect has cv2.num_pts or (CV2.32F || CV2.32S)" issue. My CV version is 4.1, and then I do modification like this in line 64: ''' contours, _ = cv2.findContours(numpy.ndarray.copy(heat_map), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) '''

just change the output var from 'contours' to 'contours,_' . The code works then, but no result show up. I train the base model with 41 Epoch and the loss down to 0.78. Then I do train-iou and after 2 epoch, the loss down to 0.426 and will not go down anymore.

Hope to hear your suggestion, thank you.

eg4000 commented 5 years ago

Hi,

As stated in the readme file, the code was tested with OpenCV 3.1.

OpenCV 4 removed the first argument from the return value of findContours function. I assume our code should work with OpenCV 4 by changing the index of the contours array, as done here in line 113.

Regarding the the loss value, I will reply in the other thread.

Thanks, Eran.

cvsourcerdo commented 5 years ago

@Horr

Hi @eg4000 ,

I think you may need to clarify your CV version since your pipenv doesn't have. I met a bug about this in EmMerge.py:114, claimed that "cv2.boundingRect has cv2.num_pts or (CV2.32F || CV2.32S)" issue. My CV version is 4.1, and then I do modification like this in line 64: ''' contours, _ = cv2.findContours(numpy.ndarray.copy(heat_map), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) '''

just change the output var from 'contours' to 'contours,_' . The code works then, but no result show up. I train the base model with 41 Epoch and the loss down to 0.78. Then I do train-iou and after 2 epoch, the loss down to 0.426 and will not go down anymore.

Hope to hear your suggestion, thank you.

@HoracceFeng were you able to get results?

HoracceFeng commented 5 years ago

actually, no... I use two weeks to train the model but still got nothing. Better to Modify this code for multi-GPU before trying. Good luck.

Sent from my iPhone

On Jun 27, 2019, at 02:13, cvsourcerdo notifications@github.com<mailto:notifications@github.com> wrote:

@horrhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhorr&data=02%7C01%7C%7C4e037b73b32d43a0097308d6fa61f648%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636971695997924166&sdata=7ec9%2FvAix9ZKlik31awUiPqHwZs%2FZpLilI06BxfXNpk%3D&reserved=0

Hi @eg4000https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feg4000&data=02%7C01%7C%7C4e037b73b32d43a0097308d6fa61f648%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636971695997934165&sdata=MB6ACyngng3vkuw6cKnK2r6MwGvZw7Nhlr8p%2BkfNirY%3D&reserved=0 ,

I think you may need to clarify your CV version since your pipenv doesn't have. I met a bug about this in EmMerge.py:114, claimed that "cv2.boundingRect has cv2.numpts or (CV2.32F || CV2.32S)" issue. My CV version is 4.1, and then I do modification like this in line 64: ''' contours, = cv2.findContours(numpy.ndarray.copy(heat_map), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) '''

just change the output var from 'contours' to 'contours,_' . The code works then, but no result show up. I train the base model with 41 Epoch and the loss down to 0.78. Then I do train-iou and after 2 epoch, the loss down to 0.426 and will not go down anymore.

Hope to hear your suggestion, thank you.

@HoracceFenghttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FHoracceFeng&data=02%7C01%7C%7C4e037b73b32d43a0097308d6fa61f648%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636971695997954188&sdata=Izda51UtQ4qgS7sQ9QgHEFGEb6nOOUAjmSbW8RmfYI4%3D&reserved=0 were you able to get results?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feg4000%2FSKU110K_CVPR19%2Fissues%2F10%3Femail_source%3Dnotifications%26email_token%3DAE6372K6XYJ4SNKPK7JPXUTP4OWTZA5CNFSM4HXE76PKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYUL77Q%23issuecomment-505987070&data=02%7C01%7C%7C4e037b73b32d43a0097308d6fa61f648%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636971695997964205&sdata=f7mAfvpko1EfSCFgVbsw6MTPcSI3qF73gviz%2BvaRWEQ%3D&reserved=0, or mute the threadhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAE6372ISWAKIOLXGXCNQ64LP4OWTZANCNFSM4HXE76PA&data=02%7C01%7C%7C4e037b73b32d43a0097308d6fa61f648%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636971695997974204&sdata=NQVOyjdEzc2h2zGWZOAEIcB7zf%2F28TXTabczCqDQDbI%3D&reserved=0.

Pari-singh commented 5 years ago

Hi @eg4000 I made the changes required for CV version and made the inference work on the image in the SKU dataset. But the same exact code is failing when I merely replace the image to my custom image. I get the following error : error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/geometry.cpp:103: error: (-215:Assertion failed) total >= 0 && (depth == CV_32S || depth == CV_32F) in function 'pointPolygonTest'

Any idea why it is failing only on my custom image when there is pre-processing step and resizing step in the code. Inference code taken from https://github.com/yafeunteun/SKU110K_code/blob/master/examples/retinanet.ipynb.

My concern is that we have findContours in the line #200 https://github.com/eg4000/SKU110K_code/pull/1/commits/8ceefcf0e51ab981c6c06df780bae3cd5459384f which isnt modified for CV4. Could that be the issue?

Thanks