# ISCC - Semantic Image-Code
[![Version](https://img.shields.io/pypi/v/iscc-sci.svg)](https://pypi.python.org/pypi/iscc-sci/)
[![Downloads](https://pepy.tech/badge/iscc-sci)](https://pepy.tech/project/iscc-sci)
`iscc-sci` is a **proof of concept implementation** of a semantic Image-Code for the
[ISCC](https://core.iscc.codes) (*International Standard Content Code*). Semantic Image-Codes are
designed to capture and represent the semantic content of images for improved similarity detection.
> [!CAUTION]
> This is an early proof of concept. All releases with release numbers below v1.0.0 may
> break backward compatibility and produce incompatible Semantic Image-Codes.
## What is ISCC Semantic Image-Code
The ISCC framework already comes with an Image-Code that is based on perceptual hashing and can
match near duplicates. The ISCC Semantic Image-Code is planned as a new additional ISCC-UNIT focused
on capturing a more abstract and broad semantic similarity. As such the Semantic Image-Code is
engineered to be robust against a broader range of variations that cannot be matched with the
perceptual Image-Code.
## Features
- **Semantic Similarity**: Leverages deep learning models to generate codes that reflect the
semantic content of images.
- **Bit-Length Flexibility**: Supports generating codes of various bit lengths (up to 256 bits),
allowing for adjustable granularity in similarity detection.
- **ISCC Compatible**: Generates codes that are fully compatible with the ISCC specification,
facilitating integration with existing ISCC-based systems.
## Installation
Before you can install `iscc-sci`, you need to have Python 3.8 or newer installed on your system.
Install the library as any other python package:
```bash
pip install iscc-sci
```
## Usage
To generate a Semantic Image-Code for an image, use the `code_image_semantic` function. You can
specify the bit length of the code to control the level of granularity in the semantic
representation.
```python
import iscc_sci as sci
# Generate a 64-bit ISCC Semantic Image-Code for an image file
image_file_path = "path/to/your/image.jpg"
semantic_code = sci.code_image_semantic(image_file_path, bits=64)
print(semantic_code)
```
## How It Works
`iscc-sci` uses a pre-trained deep learning model based on the 1st Place Solution of the Image
Similarity Challenge (ISC21) to create semantic embeddings of images. The model generates a feature
vector that captures the essential characteristics of the image. This vector is then binarized to
produce a Semantic Image-Code that is robust to variations in image presentation but sensitive to
content differences.
## Development
This is a proof of concept and welcomes contributions to enhance its capabilities, efficiency, and
compatibility with the broader ISCC ecosystem. For development, you'll need to install the project
in development mode using [Poetry](https://python-poetry.org).
```shell
git clone https://github.com/iscc/iscc-sci.git
cd iscc-sci
poetry install
```
## Contributing
Contributions are welcome! If you have suggestions for improvements or bug fixes, please open an
issue or pull request. For major changes, please open an issue first to discuss what you would like
to change.
Raw data
{
"_id": null,
"home_page": "https://iscc.codes",
"name": "iscc-sci",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "iscc,semantic,media,hash,similarity",
"author": "Titusz",
"author_email": "tp@py7.de",
"download_url": "https://files.pythonhosted.org/packages/4f/02/d117bc9d847b99c360baa1fa55d15691edaddb08880954170c7ebad8a772/iscc_sci-0.1.0.tar.gz",
"platform": null,
"description": "# ISCC - Semantic Image-Code\n\n[![Version](https://img.shields.io/pypi/v/iscc-sci.svg)](https://pypi.python.org/pypi/iscc-sci/)\n[![Downloads](https://pepy.tech/badge/iscc-sci)](https://pepy.tech/project/iscc-sci)\n\n`iscc-sci` is a **proof of concept implementation** of a semantic Image-Code for the\n[ISCC](https://core.iscc.codes) (*International Standard Content Code*). Semantic Image-Codes are\ndesigned to capture and represent the semantic content of images for improved similarity detection.\n\n> [!CAUTION]\n> This is an early proof of concept. All releases with release numbers below v1.0.0 may\n> break backward compatibility and produce incompatible Semantic Image-Codes.\n\n## What is ISCC Semantic Image-Code\n\nThe ISCC framework already comes with an Image-Code that is based on perceptual hashing and can\nmatch near duplicates. The ISCC Semantic Image-Code is planned as a new additional ISCC-UNIT focused\non capturing a more abstract and broad semantic similarity. As such the Semantic Image-Code is\nengineered to be robust against a broader range of variations that cannot be matched with the\nperceptual Image-Code.\n\n## Features\n\n- **Semantic Similarity**: Leverages deep learning models to generate codes that reflect the\n semantic content of images.\n- **Bit-Length Flexibility**: Supports generating codes of various bit lengths (up to 256 bits),\n allowing for adjustable granularity in similarity detection.\n- **ISCC Compatible**: Generates codes that are fully compatible with the ISCC specification,\n facilitating integration with existing ISCC-based systems.\n\n## Installation\n\nBefore you can install `iscc-sci`, you need to have Python 3.8 or newer installed on your system.\nInstall the library as any other python package:\n\n```bash\npip install iscc-sci\n```\n\n## Usage\n\nTo generate a Semantic Image-Code for an image, use the `code_image_semantic` function. You can\nspecify the bit length of the code to control the level of granularity in the semantic\nrepresentation.\n\n```python\nimport iscc_sci as sci\n\n# Generate a 64-bit ISCC Semantic Image-Code for an image file\nimage_file_path = \"path/to/your/image.jpg\"\nsemantic_code = sci.code_image_semantic(image_file_path, bits=64)\n\nprint(semantic_code)\n```\n\n## How It Works\n\n`iscc-sci` uses a pre-trained deep learning model based on the 1st Place Solution of the Image\nSimilarity Challenge (ISC21) to create semantic embeddings of images. The model generates a feature\nvector that captures the essential characteristics of the image. This vector is then binarized to\nproduce a Semantic Image-Code that is robust to variations in image presentation but sensitive to\ncontent differences.\n\n## Development\n\nThis is a proof of concept and welcomes contributions to enhance its capabilities, efficiency, and\ncompatibility with the broader ISCC ecosystem. For development, you'll need to install the project\nin development mode using [Poetry](https://python-poetry.org).\n\n```shell\ngit clone https://github.com/iscc/iscc-sci.git\ncd iscc-sci\npoetry install\n```\n\n## Contributing\n\nContributions are welcome! If you have suggestions for improvements or bug fixes, please open an\nissue or pull request. For major changes, please open an issue first to discuss what you would like\nto change.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "ISCC - Semantic Code Image",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://iscc.codes",
"Repository": "https://github.com/iscc/iscc-sci"
},
"split_keywords": [
"iscc",
"semantic",
"media",
"hash",
"similarity"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "399a07cc0a9485f1ce85cf42af0c1f2a9f9564e922b9863d94cf432c18d1b6a8",
"md5": "98b19f9cf4a4ddd78436f498b98efa15",
"sha256": "4d9716ed246324cd797752b496a78cced7b690211981800eba86659de7cff463"
},
"downloads": -1,
"filename": "iscc_sci-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "98b19f9cf4a4ddd78436f498b98efa15",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 10629,
"upload_time": "2024-02-07T19:52:52",
"upload_time_iso_8601": "2024-02-07T19:52:52.572909Z",
"url": "https://files.pythonhosted.org/packages/39/9a/07cc0a9485f1ce85cf42af0c1f2a9f9564e922b9863d94cf432c18d1b6a8/iscc_sci-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4f02d117bc9d847b99c360baa1fa55d15691edaddb08880954170c7ebad8a772",
"md5": "3acb6124591563da174f09602f514dcd",
"sha256": "a6a9273200c087266093aebabbaa254f36acc7f2810f1f4c049f7236ede099ff"
},
"downloads": -1,
"filename": "iscc_sci-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3acb6124591563da174f09602f514dcd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 9962,
"upload_time": "2024-02-07T19:52:54",
"upload_time_iso_8601": "2024-02-07T19:52:54.239258Z",
"url": "https://files.pythonhosted.org/packages/4f/02/d117bc9d847b99c360baa1fa55d15691edaddb08880954170c7ebad8a772/iscc_sci-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-07 19:52:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "iscc",
"github_project": "iscc-sci",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "iscc-sci"
}