rclip - AI-Powered Command-Line Photo Search Tool

Overview

rclip - AI-Powered Command-Line Photo Search Tool

rclip logo

rclip is a command-line photo search tool based on the awesome OpenAI's CLIP neural network.

Installation

Currently, pre-built distributable is available only for Linux x86_64.

  1. Download the AppImage from the latest release.

  2. Execute following commands:

$ chmod +x <downloaded AppImage filename>
$ sudo mv <downloaded AppImage filename> /usr/local/bin/rclip

Usage

$ cd photos && rclip "search query"

rclip usage demo

How do I preview the results?

The command from below will open top-5 results for "kitty" in your default image viewer. For this to work, you'll have to index the directory beforehand by running rclip in it without the -n key.

$ rclip -nf -t 5 "kitty" | xargs -d '\n' -n 1 xdg-open

Help

$ rclip --help

Contributing

This repository follows the Conventional Commits standard.

Please, execute pipenv shell to set PIP_FIND_LINKS before running pipenv sync or pipenv install.

License

MIT

Comments
  • Draft of feat: allow

    Draft of feat: allow "negative" text queries

    This is a draft of a patch for something similar to issue #18 -- but it was not implemented exactly according to the requirements described in that issue.

    Instead of a single string containing both the positive and negative clauses, I think it would be cleaner if the additive and subtractive phrases used separate command line parameters, like:

    rclip zebra --minus="black and white" --plus="red and blue"
    

    More details are mentioned in a comment under #18 .

    If you think this is a good direction, I could clean it up more (add examples to docs; and remove a no-longer-used method) and re-submit it.

    opened by ramayer 24
  • feat: allow searching for similar images

    feat: allow searching for similar images

    Still a work in progress for #20 . Not yet ready for merging; but creating the pull request early for comments on the patches.

    A couple open issues/questions:

    • What user agent string (if any) should rclip use when it makes http(s) requests? I think it should have a user agent, because some websites like Wikimedia Commons are pretty picky and block requests without one ( https://meta.wikimedia.org/wiki/User-Agent_policy ). I just put in a temporary placeholder for now, mostly so wikimedia.org doesn't complain when I test with things like: ./bin/rclip.sh -f https://upload.wikimedia.org/wikipedia/commons/c/c1/Variegated_golden_frog_%28Mantella_baroni%29_Ranomafana.jpg

    • So far this has only been minimally tested. I've been using this:
      ./bin/rclip.sh ./tmp/d2/img0015.jpg looking for a score of 100% from the identical picture, and this ./bin/rclip.sh -t 999 "" --sub "" --sub ./tmp/d2/img0015.jpg | tail looking at a score of -100% to make sure that adding and subtracting is working; but I haven't really tried many combinations yet. I haven't tried on Windows at all yet.

    • This commit undid the optimization from the previous pull request of calculating many text vectors in a single statement. Not sure it's important. If so, I suppose it could use itertools.groupby to group the user's inputs into text vs image requests; and at least process all the text ones in a single group.

    opened by ramayer 10
  • feat: allow searching for similar images by providing a path or URL to an image

    feat: allow searching for similar images by providing a path or URL to an image

    Sometimes it's more convenient to search for "a picture similar to the one I have in mind", instead of trying to describe it with words. Especially considering the extremely short phrases CLIP allows.

    I'd like to be able to run:

     rclip https://i.redd.it/a7jf5rlghsz51.jpg
    

    to return pictures of similar buildings like these.

    It would also be nice to be able to search for pictures similar to a local file, like rclip /tmp/turtle.jpg and/or rclip file:///tmp/turtle.jpg.

    This branch has a working work-in-progress for both of those features; but probably isn't ready for a pull request yet because it has a python3.9 dependency (str.removeprefix is a 3.9 feature). If you're interested, I'll remove that dependency and open a pull request.

    enhancement 
    opened by ramayer 5
  • Any idea the feasibility of adding an exclude or ignore directory option?

    Any idea the feasibility of adding an exclude or ignore directory option?

    E.g., like rsync has the --exclude=PATTERN that can be repeated...

    I see this in main.py:

    EXCLUDE_DIRS = ['@eaDir', 'node_modules', '.git']
    EXCLUDE_DIR_REGEX = re.compile(r'^.+\/(' + '|'.join(re.escape(dir) for dir in EXCLUDE_DIRS) + r')(\/.+)?$')
    

    Do you have any interest in having additional exclude directories specified as command line arguments? Or perhaps an e.g. .rclipskip, .rclipexclude, .rclipignore file that contains directory patterns?

    good first issue 
    opened by groovenectar 3
  • feat: allow

    feat: allow "negative" text queries

    A good example of what I mean is http://image-search.0ape.com/search?q=naked%20-person.

    Thanks, @ramayer for the rclip-server and the inspiration!

    Requirements:

    • the current interface rclip "query" should continue to work
    • it should correctly support following examples: rclip "multi word query -word1 -word2" rclip "query -'multi word negative'" rclip 'query -"multi word negative"' (i.e., it should work with any type of quotes)

    rclip "multi word query -word2 some other words" should error with the suggestion to use quotes around the negative since it's unclear how to parse it

    enhancement good first issue 
    opened by yurijmikhalevich 2
  • feature(model): switch to ViT-L/14@336px

    feature(model): switch to ViT-L/14@336px

    Switch to the largest OpenAI's CLIP model. This change brings quality improvements for a price of a huge performance penalty. The difference on my small test set is 16.34s vs 192.72s (+1079%) on image ingestion and 4.49s vs 7.41s (+65%) on image search.

    The quality benefits are to be evaluated before merging this change.

    opened by yurijmikhalevich 3
Releases(v1.2.4)
Owner
Yurij Mikhalevich
Yurij Mikhalevich
txtai executes machine-learning workflows to transform data and build AI-powered semantic search applications.

txtai executes machine-learning workflows to transform data and build AI-powered semantic search applications.

NeuML 3.1k Dec 31, 2022
Deep Image Search - AI-Based Image Search Engine

Deep Image Search is an AI-based image search engine that includes deep transfer learning features Extraction and tree-based vectorized search technique.

null 144 Jan 5, 2023
Search emails from a domain through search engines

EmailFinder - search emails through Search Engines

Josué Encinar 155 Dec 30, 2022
Image search service based on imgsmlr extension of PostgreSQL. Support image search by image.

imgsmlr-server Image search service based on imgsmlr extension of PostgreSQL. Support image search by image. This is a sample application of imgsmlr.

jie 45 Dec 12, 2022
GitScanner is a script to make it easy to search for Exposed Git through an advanced Google search.

GitScanner Legal disclaimer Usage of GitScanner for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to

Kaio Gomes 3 Oct 28, 2022
A fast, efficiency python package for searching and getting search results with many different search engines

search A fast, efficiency python package for searching and getting search results with many different search engines. Installation To install the pack

Neurs 0 Oct 6, 2022
Reverse-ikea-image-search - A simple image of ikea search using jina.ai

IKEA Reverse Image Search This is a demo project to fetch ikea product images(IK

SOUVIK GHOSH 4 Mar 8, 2022
cve-search - a tool to perform local searches for known vulnerabilities

cve-search cve-search is a tool to import CVE (Common Vulnerabilities and Exposures) and CPE (Common Platform Enumeration) into a MongoDB to facilitat

cve-search 2k Jan 1, 2023
ForFinder is a search tool for folder and files

ForFinder is a search tool for folder and files. You can use that when you Source Code Analysis at your project's local files or other projects that you are download. Enter a root path and keyword to ForFinder.

Çağrı Aliş 7 Oct 25, 2022
Modular search for Django

Haystack Author: Daniel Lindsley Date: 2013/07/28 Haystack provides modular search for Django. It features a unified, familiar API that allows you to

Haystack Search 3.4k Jan 4, 2023
Full text search for flask.

flask-msearch Installation To install flask-msearch: pip install flask-msearch # when MSEARCH_BACKEND = "whoosh" pip install whoosh blinker # when MSE

honmaple 197 Dec 29, 2022
Senginta is All in one Search Engine Scrapper for used by API or Python Module. It's Free!

Senginta is All in one Search Engine Scrapper. With traditional scrapping, Senginta can be powerful to get result from any Search Engine, and convert to Json. Now support only for Google Product Search Engine (GShop, GVideo and many too) and Baidu Search Engine.

null 33 Nov 21, 2022
document organizer with tags and full-text-search, in a simple and clean sqlite3 schema

document organizer with tags and full-text-search, in a simple and clean sqlite3 schema

Manos Pitsidianakis 152 Oct 29, 2022
Google Search Engine Results Pages (SERP) in locally, no API key, no signup required

Local SERP Google Search Engine Results Pages (SERP) in locally, no API key, no signup required Make sure the chromedriver and required package are in

theblackcat102 4 Jun 29, 2021
A web search server for ParlAI, including Blenderbot2.

Description A web search server for ParlAI, including Blenderbot2. Querying the server: The server reacting correctly: Uses html2text to strip the mar

Jules Gagnon-Marchand 119 Jan 6, 2023
This project is a sample demo of Arxiv search related to AI/ML Papers built using Streamlit, sentence-transformers and Faiss.

This project is a sample demo of Arxiv search related to AI/ML Papers built using Streamlit, sentence-transformers and Faiss.

Karn Deb 49 Oct 30, 2022
Google Project: Search and auto-complete sentences within given input text files, manipulating data with complex data-structures.

Auto-Complete Google Project In this project there is an implementation for one feature of Google's search engines - AutoComplete. Autocomplete, or wo

Hadassah Engel 10 Jun 20, 2022
Full-text multi-table search application for Django. Easy to install and use, with good performance.

django-watson django-watson is a fast multi-model full-text search plugin for Django. It is easy to install and use, and provides high quality search

Dave Hall 1.1k Jan 3, 2023
An image inline search telegram bot.

Image-Search-Bot An image inline search telegram bot. Note: Use Telegram picture bot. That is better. Not recommending to deploy this bot. Made with P

Fayas Noushad 24 Oct 21, 2022