yuvalkirstain / PickScore

MIT License
373 stars 20 forks source link

Download images #28

Closed IlliaHavr95 closed 1 month ago

IlliaHavr95 commented 1 month ago

Hello!

Please tell me, I’m just now starting to work with Python and am trying to download pictures from the pickapic_v1. The final result I came to is links to images, but when I click on them I get that there is no access. Am I doing something wrong or is there no way to get the images themselves?

Thank you in advance for your response.

yuvalkirstain commented 1 month ago

The hugging face dataset has the images as bytes. Have you tried using it?

IlliaHavr95 commented 1 month ago

Unfortunately, I'm not experienced with this yet. I tried to download the database with streaming=True and displayed an example of the data. There I saw that there were links to images, but access was needed. I would be grateful if you could tell me how to upload the images.

yuvalkirstain commented 1 month ago

Which dataset fields do you see when running with streaming = true?

IlliaHavr95 commented 1 month ago

Record 1: {'are_different': True, 'best_image_uid': '63b9f453-d3d6-4d6e-bca2-f6752fc8dd63', 'caption': 'A panda bear as a mad scientist', 'created_at': datetime.datetime(2023, 3, 22, 14, 11, 18, 787846), 'has_label': True, 'image_0_uid': '63b9f453-d3d6-4d6e-bca2-f6752fc8dd63', 'image_0_url': 'https://text-to-image-human-preferences.s3.us-east-2.amazonaws.com/images/63b9f453-d3d6-4d6e-bca2-f6752fc8dd63.png', 'image_1_uid': 'bd5f4d7a-2a6c-4437-bacb-c1fa2173e256', 'image_1_url': 'https://text-to-image-human-preferences.s3.us-east-2.amazonaws.com/images/bd5f4d7a-2a6c-4437-bacb-c1fa2173e256.png', 'jpg_0': b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00C\x00....

Such record I received from which I tried to use image_0_url and image_1_url

IlliaHavr95 commented 1 month ago

I think I got what you meant about bytes and resolved my issue successfully. I appreciate your help! Thanks a lot!

yuvalkirstain commented 1 month ago

Sure thing. Closing the issue. Good luck with your research.