harperreed / photo-similarity-search

Super simple MLX (apple silicon) CLIP based photo similarity web app
MIT License
445 stars 34 forks source link

Sample larger than population or is negative #5

Open CherryLover opened 5 months ago

CherryLover commented 5 months ago

hi, I'm a Python beginner, you did what I wanted to do, this project so cool.

I clone and run, it will show on the web page: 'Sample larger than population or is negative'.

I guess it's because I'm providing too little data? I have 60 images in the images directory. If that's the problem, how many images do I need to provide for proper use?

Also, although I provided 60 images, after executing 'python generate_embeddings.py', I printed them in the console

Inserted embeddings 30 photos into Chroma in 0.05 seconds
tomhallmain commented 5 months ago

@CherryLover For some reason embeddings are only generated for JPGs in the current version. Either make the images all JPG (not JPEG) or update the line in generate_embeddings.py to add conditions for other file types: if file_path.lower().endswith('.jpg'):

JenniePing commented 4 months ago

hi, I got the same problem. But I did use .jpg, it doesn't work for me. I have no idea about the problem. Did anyone fix it plz ? :(

tomhallmain commented 4 months ago

@JenniePing Not sure how to help in your case except to double check you have enough images in the directory and that you run generate_embeddings.py before running start_web.py.

JenniePing commented 4 months ago

@tomhallmain Thank you! It worked as I provided 2k images. I saw the random range is 52, so maybe it works exactly when having more than 52 images? Or can just make the range smaller.

marckohlbrugge commented 1 month ago

Are there any other requirements besides using .jpg?

I've been trying to get this set up, but the web interface doesn't see any of the images. Despite the embedding script saying "Inserted embeddings 419 photos into Chroma in 0.51 seconds"

Edit: setting CHROME_PATH=./images/foobar_chrome in front of the commands fixed my issue. I think the CHROME_PATH was calculated differently between the generate_embeddings.py and start_web.py scripts

tomhallmain commented 1 month ago

@marckohlbrugge Not sure how to help in your case either, but you can try using my fork here

marckohlbrugge commented 1 month ago

@marckohlbrugge Not sure how to help in your case either, but you can try using my fork here

I was able to fix the issue by manually setting CHROME_PATH. But I will try out your fork as well as I like the additions you made 🙌