rclip

AI-Powered Command-Line Photo Search Tool

https://github.com/yurijmikhalevich/rclip

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.4%) to scientific vocabulary

Keywords

artificial-intelligence computer-vision hacktoberfest image-search photography python

Scientific Fields

Mathematics Computer Science - 84% confidence
Sociology Social Sciences - 64% confidence
Last synced: 4 months ago · JSON representation ·

Repository

AI-Powered Command-Line Photo Search Tool

Basic Info
  • Host: GitHub
  • Owner: yurijmikhalevich
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 52.8 MB
Statistics
  • Stars: 836
  • Watchers: 4
  • Forks: 64
  • Open Issues: 26
  • Releases: 93
Topics
artificial-intelligence computer-vision hacktoberfest image-search photography python
Created over 4 years ago · Last pushed 4 months ago
Metadata Files
Readme License Citation

README.md

rclip - AI-Powered Command-Line Photo Search Tool

All Contributors <!-- ALL-CONTRIBUTORS-BADGE:END -->

[Blog] [Demo on YouTube] [Paper]

rclip logo

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

Installation

Linux

bash sudo snap install rclip

Alternative options (AppImage and pip) If your Linux distribution doesn't support [snap](https://snapcraft.io/rclip), you can use one of the alternative installation options: #### AppImage (self-contained x86_64 executable) On Linux x86_64, you can install **rclip** as a self-contained executable. 1. Download the AppImage from the latest [release](https://github.com/yurijmikhalevich/rclip/releases). 2. Execute the following commands: ```bash chmod +x sudo mv /usr/local/bin/rclip ``` #### Using pip ```bash pip install --extra-index-url https://download.pytorch.org/whl/cpu rclip ```

macOS

bash brew install yurijmikhalevich/tap/rclip

Alternative option (pip) ```bash pip install rclip ```

Windows

  1. Download the "*.msi" from the latest release.
  2. Install rclip by running the installer.
Alternative option (pip) ```bash pip install rclip ```

Usage

bash cd photos && rclip "search query"

rclip usage demo

When you run rclip for the first time in a particular directory, it will extract features from the photos, which takes time. How long it will take depends on your CPU and the number of pictures you will search through. It took about a day to process 73 thousand photos on my NAS, which runs an old-ish Intel Celeron J3455, 7 minutes to index 50 thousand images on my MacBook with an M1 Max CPU, and three hours to process 1.28 million images on the same MacBook.

For a detailed demonstration, watch the video: https://www.youtube.com/watch?v=tAJHXOkHidw.

Similar image search

You can use another image as a query by passing a file path or even an URL to the image file, and rclip will find the images most similar to the one you used as a query. If you are referencing a local image via a relative path, you must prefix it with ./. For example:

```bash cd photos && rclip ./cat.jpg

or use URL

cd photos && rclip https://raw.githubusercontent.com/yurijmikhalevich/rclip/main/tests/e2e/images/cat.jpg ```

Check this video out for the image-to-image search demo: https://www.youtube.com/watch?v=1YQZKeCBxWM.

Combining multiple queries

You can add and subtract image and text queries from each other; here are a few usage examples:

bash cd photos && rclip horse + stripes cd photos && rclip apple - fruit cd photos && rclip "./new york city.jpg" + night cd photos && rclip "2:golden retriever" + "./swimming pool.jpg" cd photos && rclip "./racing car.jpg" - "2:sports car" + "2:snow"

If you want to see how these queries perform when executed on the 1.28 million images ImageNet-1k dataset, check out the demo on YouTube: https://www.youtube.com/watch?v=MsTgYdOpgcQ.

How do I preview the results?

If you are using either one of iTerm2, Konsole (version 22.04 and higher), wezterm, Mintty, or mlterm all you need to do is pass --preview (or -p) argument to rclip:

bash rclip -p kitty

Using a different terminal or viewer If you are using any other terminal or want to view the results in your viewer of choice, you can pass the output of **rclip** to it. For example, on Linux, the command from below will open top-5 results for "kitty" in your default image viewer: ```bash rclip -f -t 5 kitty | xargs -d '\n' -n 1 xdg-open ``` The `-f` param or `--filepath-only` makes **rclip** print the file paths only, without scores or the header, which makes it ideal to use together with a custom viewer as in the example. I prefer to use **feh**'s thumbnail mode to preview multiple results: ```bash rclip -f -t 5 kitty | feh -f - -t ```

Get help

https://github.com/yurijmikhalevich/rclip/discussions/new/choose

Contributing

This repository follows the Conventional Commits standard.

Running locally from the source code

To run rclip locally from the source code, you must have Python and Poetry installed.

Then do: ```bash

clone the source code repository

git clone git@github.com:yurijmikhalevich/rclip.git

install dependencies and rclip

cd rclip poetry install

activate the new poetry environment

poetry shell ```

If the poetry environment is active, you can use rclip locally, as described in the Usage section above.

Contributors ✨

Thanks go to these wonderful people and organizations (emoji key):

ramayer
ramayer

💻
Caphyon
Caphyon

🚇
AbId KhAn
AbId KhAn

💻

Thanks to Caphyon and Advanced Installer team for generously supplying rclip project with the Professional Advanced Installer license for creating the Windows installer.

This project follows the all-contributors specification. Contributions of any kind are welcome!

License

MIT

Owner

  • Name: Yurij Mikhalevich
  • Login: yurijmikhalevich
  • Kind: user
  • Company: @Lightning-AI

Building the future at @Lightning-AI 🚀

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you want to cite rclip, feel free to use this"
authors:
- family-names: "Mikhalevich"
  given-names: "Yurij"
title: "rclip"
version: 1.2.5
date-released: 2023-01-14
license: "MIT"
url: "https://github.com/yurijmikhalevich/rclip"
repository-code: "https://github.com/yurijmikhalevich/rclip/commit/0ded434ee826dae2823a897813a21d8012d7ed9b"
keywords:
  - machine learning
  - deep learning
  - artificial intelligence
  - computer vision
  - image search
  - image indexing
  - photo management
  - natural language processing

GitHub Events

Total
  • Create event: 108
  • Issues event: 18
  • Release event: 13
  • Watch event: 82
  • Delete event: 42
  • Issue comment event: 61
  • Push event: 176
  • Pull request review event: 50
  • Pull request review comment event: 42
  • Pull request event: 88
  • Fork event: 11
Last Year
  • Create event: 108
  • Issues event: 18
  • Release event: 13
  • Watch event: 82
  • Delete event: 42
  • Issue comment event: 61
  • Push event: 176
  • Pull request review event: 50
  • Pull request review comment event: 42
  • Pull request event: 88
  • Fork event: 11

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 252
  • Total Committers: 4
  • Avg Commits per committer: 63.0
  • Development Distribution Score (DDS): 0.024
Past Year
  • Commits: 66
  • Committers: 3
  • Avg Commits per committer: 22.0
  • Development Distribution Score (DDS): 0.03
Top Committers
Name Email Commits
Yurij Mikhalevich y****j@m****h 246
allcontributors[bot] 4****] 3
ramayer r****r@g****m 2
AbId KhAn a****4@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 44
  • Total pull requests: 139
  • Average time to close issues: 6 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 11
  • Total pull request authors: 9
  • Average comments per issue: 2.8
  • Average comments per pull request: 0.35
  • Merged pull requests: 121
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 10
  • Pull requests: 73
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 2 days
  • Issue authors: 3
  • Pull request authors: 8
  • Average comments per issue: 2.7
  • Average comments per pull request: 0.12
  • Merged pull requests: 58
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • yurijmikhalevich (32)
  • sugizo (2)
  • sweetkane (2)
  • Fethbita (2)
  • josalhor (1)
  • manfromfms (1)
  • walking-octopus (1)
  • groovenectar (1)
  • Sobsz (1)
  • ramayer (1)
  • timepp (1)
  • zhilongjia (1)
  • jantigenie (1)
  • rebelzion (1)
  • iynaix (1)
Pull Request Authors
  • yurijmikhalevich (160)
  • prayas7102 (4)
  • NickR23 (4)
  • unanthropomorph (2)
  • ramayer (2)
  • allcontributors[bot] (2)
  • abidkhan484 (2)
  • benroeder (2)
  • TheChaoticor (2)
Top Labels
Issue Labels
feat (20) hacktoberfest (11) good first issue (11) priority:medium (10) priority:low (10) priority:high (10) bug (6) help wanted (3) documentation (2) enhancement (2)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 1,856 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 235
  • Total maintainers: 1
proxy.golang.org: github.com/yurijmikhalevich/rclip
  • Versions: 88
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 4 months ago
pypi.org: rclip

AI-Powered Command-Line Photo Search Tool

  • Versions: 147
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,856 Last month
Rankings
Stargazers count: 2.9%
Downloads: 4.2%
Forks count: 6.4%
Dependent packages count: 7.5%
Average: 18.1%
Dependent repos count: 69.8%
Maintainers (1)
Last synced: 4 months ago

Dependencies

.github/workflows/release.yaml actions
  • AppImageCrafters/build-appimage v1.3 composite
  • actions/checkout v3 composite
  • ncipollo/release-action v1 composite
Dockerfile docker
  • python 3.8-slim build
.github/workflows/validate.yaml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • actions/setup-python v4 composite
poetry.lock pypi
  • certifi 2023.7.22
  • charset-normalizer 3.3.0
  • colorama 0.4.6
  • exceptiongroup 1.1.3
  • filelock 3.12.4
  • fsspec 2023.9.2
  • ftfy 6.1.1
  • homebrew-pypi-poet 0.10.0
  • huggingface-hub 0.17.3
  • idna 3.4
  • iniconfig 2.0.0
  • jinja2 3.1.2
  • markupsafe 2.1.3
  • mpmath 1.3.0
  • networkx 3.1
  • numpy 1.24.4
  • open-clip-torch 2.20.0
  • packaging 23.2
  • pillow 10.0.1
  • pluggy 1.3.0
  • protobuf 3.20.3
  • pycodestyle 2.11.0
  • pytest 7.4.2
  • pyyaml 6.0.1
  • regex 2023.10.3
  • requests 2.31.0
  • safetensors 0.3.3
  • sentencepiece 0.1.99
  • setuptools 68.2.2
  • sympy 1.12
  • timm 0.9.7
  • tomli 2.0.1
  • torch 2.0.1
  • torch 2.0.1+cpu
  • torchvision 0.15.2
  • torchvision 0.15.2+cpu
  • tqdm 4.66.1
  • typing-extensions 4.8.0
  • urllib3 2.0.6
  • wcwidth 0.2.8
pyproject.toml pypi
  • open_clip_torch ^2.20.0
  • pillow ^10.0.0
  • python ^3.8
  • requests ~=2.26
  • torch --- - !ruby/hash:ActiveSupport::HashWithIndifferentAccess version: "==2.0.1" source: pypi markers: sys_platform != 'linux' or platform_machine == 'aarch64' - !ruby/hash:ActiveSupport::HashWithIndifferentAccess version: "==2.0.1+cpu" source: pytorch-cpu markers: sys_platform == 'linux' and platform_machine != 'aarch64'
  • torchvision --- - !ruby/hash:ActiveSupport::HashWithIndifferentAccess version: "==0.15.2" source: pypi markers: sys_platform != 'linux' or platform_machine == 'aarch64' - !ruby/hash:ActiveSupport::HashWithIndifferentAccess version: "==0.15.2+cpu" source: pytorch-cpu markers: sys_platform == 'linux' and platform_machine != 'aarch64'
  • tqdm ^4.65.0