Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image resize for training #18

Open
QuickLearner171998 opened this issue Apr 23, 2020 · 3 comments
Open

Image resize for training #18

QuickLearner171998 opened this issue Apr 23, 2020 · 3 comments

Comments

@QuickLearner171998
Copy link

Hi, I did not find an option to resize images for training.

Also while inferencing if I resize the images to 384 by changing these lines

scale_x = 2240 / image.shape[1] # 2240 # 1280

nothing is predicted using the pretrained model.

@Wovchena
Copy link
Owner

Training images are upscaled here:

upscaled = cv2.resize(im, None, fx=scale, fy=scale, interpolation=cv2.INTER_CUBIC)

I think the model doesn't work for size of 384 because it was trained for a larger scale. You may also try visualizing raw net outputs. May be it will give you some understanding why it happens.

@QuickLearner171998
Copy link
Author

QuickLearner171998 commented Apr 25, 2020

Hey I tried training on images with size 384x384 , train loss curve was also fine.
But if I resize test images(as mentioned above) the results are incorrect and when I keep the code scales as it is I get decent results. Any idea why is this happening?

I notice here:

IN_SIDE = 640 does that mean the input size in training is 640?

@QuickLearner171998
Copy link
Author

Training images are upscaled here:

upscaled = cv2.resize(im, None, fx=scale, fy=scale, interpolation=cv2.INTER_CUBIC)

I think the model doesn't work for size of 384 because it was trained for a larger scale. You may also try visualizing raw net outputs. May be it will give you some understanding why it happens.

Hi I am trying to visualize the gt masks...I changed this line:

to if 1
Only black images are shown and now there is div by zero error while calculating dist.
Also, can you explain how can I visualize the masks in between training?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants