-
Notifications
You must be signed in to change notification settings - Fork 55
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
Converting stream.py code for single image #7
Comments
Kindly check my code for the single image it is working but the result is not good can you check. Am I missing something in the code or this code is okay? import tensorflow as tf from utils import VideoStream model = load_model(os.path.join('models', model_name+'.model'), img = cv2.imread('075189.png') plt.imshow(img)img = cv2.resize(img,(256,256)) [0.8, 0.2] classes = model.predict(img) print (classes) |
What do you mean by result is not good? Like it's plotting something, but the output doesn't look correct? Attach an image or something. |
I'm assuming you only have one class then. If I just follow along with the code in stream.py... img.shape = (256, 256, 3)
Let me know if that works. If it does, please post a picture. If it doesn't post the error code. |
Receiving below error. |
Should be np.expand_dims. I edited the original comment. |
Thank you Now this error. |
Has something to do with the image channels. I guess the error is something with an invalid shape going into cvtColor, but idk. |
Training with a bigger image won't do anything. Can probably remove the edge at the very top. |
Thank you yes i am trying them they are improving the results thank you. Also, I need to train on 1024*1024 i changed the values in config.py but receiving below error. ValueError: Error when checking input: expected input_1 to have shape (1024, 1024, 3) but got array with shape (256, 256, 3) |
I probably missed setting a dimension somewhere. Problem is I don't have time to look into this at the moment. Just look at the stack trace or look for where I have 256 in the code and find the conflicts. |
Made a notebook for this. https://github.com/seth814/Semantic-Shapes/blob/master/Single%20Image%20Multi%20Class.ipynb |
Thank you for the code but i am receiving below error with this code. File "E:\aithe\projects\virtualfitting\dev\semanticshapes2\utils.py", line 80, in add_masks |
Respected sir:
I am trying to convert stream.py code for single image but i am facing many issues can you please provide code for image ?
Thank you
The text was updated successfully, but these errors were encountered: