Skip to content

Kharzette/FindMyImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FindMyImage

Use magic to search your own local images for whatever you are looking for

So disclaimer: I have no idea what I'm doing. I'm a C programmer. Python is wierd.

Apparently python doesn't work well with git submodules.

So to get this going I had to add the MetaCLIP dir to the front of the string on line 101 of src/mini_clip/factory.py

I also did a hack where I modify sys path

I also changed torch load in checkpoint.py to have weights_only=False because I completely and totally trust Facebook

So what is this? I'm old and I don't allow embeds on discord or slack. So when people post an image or link, I just see it as a link. I tend to save alot of images as a result.

I also scoop up images from the web off forums and boorus and whatnot, so my directories get rather large.

Sometimes in a conversation with someone I'll think of a perfect image to show them, something that solves their problem or shows a particular thing.

My filenames are whatever they were to begin with so usually just a spew of numbers and letters. Going to an icon view and scrolling through and eyeballing takes awhile, and I often miss what I want in the scroll.

So voila! Make the magic of whatever kind of neural thingy this is do it!

I started out with Resnet50, but the results didn't work well for anime stuff, and I do like me some anime, so I decided to try this MetaCLIP thing I found.

It is a bit square peg/round hole though. It isn't really designed for "find me that picture of cats" as it does more of a comparison of tags you feed it.

What MetaCLIP does is if you give it a list of stuff like "dog, beer, house", it will look at an image and give you a percentage for each item of how much it resembles the item. So a picture of a car might say 30% dog, 10% beer, 60% house. Not super useful.

So what I do is throw some really generic parameters at it, then the user can specify what they really want. This seems to work most of the time, but I'm sure there are cases where it will fail utterly.

To run it, get set up to use metaclip the way it describes down in their docs. In my case I use miniconda. Then just python FindMyImage.py. If you try some command line args you'll get a usage.

I'll be working on it a bit more to pretty up the result print instead of just dumping a dictionary.

About

Use magic to search your own local images for whatever you are looking for

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages