Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Save and return unique image on each call #36

Closed
wants to merge 1 commit into from
Closed

Save and return unique image on each call #36

wants to merge 1 commit into from

Conversation

Mak-3
Copy link

@Mak-3 Mak-3 commented Dec 10, 2022

will show the image which was given as an input. Address #34

will show the image which was given as an input
@robmarkcole
Copy link
Owner

Thanks for this PR! If multiple images are saved the image number increments? If so the api could return the latest image saved in that location

@Mak-3
Copy link
Author

Mak-3 commented Dec 10, 2022

Thanks for this PR! If multiple images are saved the image number increments? If so the api could return the latest image saved in that location

yeah working on the same thing we need to loop it or maintain a count will take some time

@robmarkcole
Copy link
Owner

robmarkcole commented Dec 11, 2022

OK the solution is to use PIL to save the image with a known filename:

 results = model(im)  # inference
 results.render()  # updates results.ims with boxes and labels
 Image.fromarray(results.ims[0]).save("static/images/image0.jpg")

should do it

@robmarkcole robmarkcole changed the title Update webapp.py Save and return unique image on each call Dec 12, 2022
@Mak-3
Copy link
Author

Mak-3 commented Dec 12, 2022

OK the solution is to use PIL to save the image with a known filename:

 results = model(im)  # inference
 results.render()  # updates results.ims with boxes and labels
 Image.fromarray(results.ims[0]).save("static/images/image0.jpg")

should do it

Yup this works I tried it works fine for me

@robmarkcole
Copy link
Owner

closed by #39

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

Successfully merging this pull request may close these issues.

None yet

2 participants