clorps


Nameclorps JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/vaidatascientist
SummaryCLORPS: A module for CLIP, LPIPS, and ORB based image similarity.
upload_time2024-11-13 04:04:03
maintainerNone
docs_urlNone
authorVaibhav Gupta
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CLORPS

**CLORPS** is a Python package for calculating image similarity based on three complementary techniques: **CLIP embeddings**, **LPIPS (Learned Perceptual Image Patch Similarity)**, and **ORB (Oriented FAST and Rotated BRIEF)**. It provides a combined similarity score for one image compared to another image or a set of target images. Ideal for image retrieval, similarity-based ranking, and image comparison tasks.

## Features

- **CLIP Embeddings**: Uses OpenAI’s CLIP model for embedding-based similarity.
- **LPIPS Similarity**: Calculates perceptual similarity using LPIPS.
- **ORB Keypoint Matching**: Traditional ORB-based similarity for structural comparison.
- **Combined Score**: Normalizes and combines the three scores for a final similarity metric.

## Installation

```bash
pip install clorps
```
**Usage**
```bash
from clorps import CLORPS

# Initialize CLORPS instance
clorps_instance = CLORPS()

# Paths to input and target images
input_image_path = "/path/to/input/image.jpg"
target_image_paths = ["/path/to/target/image1.jpg", "/path/to/target/image2.jpg"]

# Calculate combined similarity scores
combined_scores = clorps_instance.calculate_combined_similarity(input_image_path, target_image_paths)
print("Combined similarity scores:", combined_scores)
```
**Input:** Path to the input image and either a single target image path or a list of target image paths.
**Output:** A list of similarity scores, one for each target image.

**Requirements:**
- Python 3.6+
- torch
- open_clip_torch
- lpips
- numpy
- scikit-learn
- Pillow
- opencv-python

**LICENSE**
This project is licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/vaidatascientist",
    "name": "clorps",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Vaibhav Gupta",
    "author_email": "vaibhavgupta.ggwp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/32/5d/0d62ecc3e8c251da6efa883563864669bb2f14d845a9b06e6f528405f38e/clorps-0.1.0.tar.gz",
    "platform": null,
    "description": "# CLORPS\n\n**CLORPS** is a Python package for calculating image similarity based on three complementary techniques: **CLIP embeddings**, **LPIPS (Learned Perceptual Image Patch Similarity)**, and **ORB (Oriented FAST and Rotated BRIEF)**. It provides a combined similarity score for one image compared to another image or a set of target images. Ideal for image retrieval, similarity-based ranking, and image comparison tasks.\n\n## Features\n\n- **CLIP Embeddings**: Uses OpenAI\u2019s CLIP model for embedding-based similarity.\n- **LPIPS Similarity**: Calculates perceptual similarity using LPIPS.\n- **ORB Keypoint Matching**: Traditional ORB-based similarity for structural comparison.\n- **Combined Score**: Normalizes and combines the three scores for a final similarity metric.\n\n## Installation\n\n```bash\npip install clorps\n```\n**Usage**\n```bash\nfrom clorps import CLORPS\n\n# Initialize CLORPS instance\nclorps_instance = CLORPS()\n\n# Paths to input and target images\ninput_image_path = \"/path/to/input/image.jpg\"\ntarget_image_paths = [\"/path/to/target/image1.jpg\", \"/path/to/target/image2.jpg\"]\n\n# Calculate combined similarity scores\ncombined_scores = clorps_instance.calculate_combined_similarity(input_image_path, target_image_paths)\nprint(\"Combined similarity scores:\", combined_scores)\n```\n**Input:** Path to the input image and either a single target image path or a list of target image paths.\n**Output:** A list of similarity scores, one for each target image.\n\n**Requirements:**\n- Python 3.6+\n- torch\n- open_clip_torch\n- lpips\n- numpy\n- scikit-learn\n- Pillow\n- opencv-python\n\n**LICENSE**\nThis project is licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "CLORPS: A module for CLIP, LPIPS, and ORB based image similarity.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/vaidatascientist"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d255d8ea2b9931b5d8d92e35cd30b2769efb92ddadc9e7337ebf1c52296da1c9",
                "md5": "a33560c664cdc9db672717788bac9b00",
                "sha256": "2c7b74465161f5e673bc54620aab3b09a61e49d3665172e1cd27f14563f05632"
            },
            "downloads": -1,
            "filename": "clorps-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a33560c664cdc9db672717788bac9b00",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 3417,
            "upload_time": "2024-11-13T04:04:01",
            "upload_time_iso_8601": "2024-11-13T04:04:01.758241Z",
            "url": "https://files.pythonhosted.org/packages/d2/55/d8ea2b9931b5d8d92e35cd30b2769efb92ddadc9e7337ebf1c52296da1c9/clorps-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "325d0d62ecc3e8c251da6efa883563864669bb2f14d845a9b06e6f528405f38e",
                "md5": "3775056e7305a3566da81b61748beaa0",
                "sha256": "10592bf0f992aab9e6129a393d6e7ab64b828ca7c4f5c691d9108baff0dc21b0"
            },
            "downloads": -1,
            "filename": "clorps-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3775056e7305a3566da81b61748beaa0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3233,
            "upload_time": "2024-11-13T04:04:03",
            "upload_time_iso_8601": "2024-11-13T04:04:03.536738Z",
            "url": "https://files.pythonhosted.org/packages/32/5d/0d62ecc3e8c251da6efa883563864669bb2f14d845a9b06e6f528405f38e/clorps-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-13 04:04:03",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "clorps"
}
        
Elapsed time: 1.34983s