ubyssey / ubyssey.ca

The code that powers www.ubyssey.ca
GNU General Public License v2.0
36 stars 41 forks source link

Make images more searchable by adding tags and descriptions to past images using OpenAI's Vision #1499

Open SamuelmdLow opened 4 months ago

SamuelmdLow commented 4 months ago

https://platform.openai.com/docs/guides/vision

I think tags denoting this such as Subject: 'building exterior', 'building interior' Subject Name: 'ams nest' Medium: 'photograph', 'illustration', 'digital illustration' 'collage'

Would be very useful for allowing us to surface images from the past. It would be too laborious to go back manually and tag these images so using a image to text api would be the only way. If its not too expensive then I think thats a good idea. It would also be cool if images could be automatically tagged like that as they are uploaded but that might cost too much compared to just instructing editors to tag it and describe it themselves

Nishim12 commented 4 months ago

I was calculating and I found out that cost would depend on the resolution of our images. We have approximately 36,000 images. We can upload images as a batch so we get a 50% discount. I think we should opt for normal resolution rather than low resolution for better results. Based on the calculator provided by OpenAI for vision with an assumption of dimensions to be 1300 x 1300 which is probably slightly more but our cost comes out to be approximately 0.003825 * 36000/2 = $68.85 where cost per image is $0.003825. If we use low resolution then our cost would be around $7-8 but we would need to test and see how good the results are. Here is the documentation for calculating the cost https://openai.com/api/pricing/

SamuelmdLow commented 4 months ago

https://dimillian.medium.com/adding-ai-generated-image-description-to-ice-cubes-c4e7990a5915