# sfmp (separate for me please)
Sfmp is a tool to quickly separate images using clustering based on features extracted through a convolutional neural network.
It's really lightweight, using only a mobilenetv2 for feature extraction and kmeans for clustering.
## Installation
To install sfmp, follow there steps:
For cpu
```
pip install "sfmp[cpu]"
```
For cuda 11.X
```
pip install "sfmp[gpu]"
```
For cuda 12.X
```
pip install "sfmp[gpu]" --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
```
## Usage
### Command Line Interface
You can use sfmp from the command line by providing a list of globs:
```
sfmp ../examples/*.jpg ../examples2/*.jpg
```
If you want to use CUDA:
```
sfmp ../examples/*.jpg ../examples2/*.jpg --provider CUDAExecutionProvider
```
Check all execution providers [here](https://onnxruntime.ai/docs/execution-providers/).
To specify the number of clusters:
```
sfmp ../examples/*.jpg ../examples2/*.jpg --n_clusters 2
```
or output dir
To specify the number of clusters:
```
sfmp ../examples/*.jpg ../examples2/*.jpg --output_path result
```
### Example
Before
```
.
├── cat.1.jpg
├── cat.2.jpg
├── dog.3061.jpg
└── dog.3062.jpg
```
```
sfmp ../examples/*.jpg --n_clusters 2
```
After
```
├── cluster_0000
│ ├── dog.3061.jpg
│ └── dog.3062.jpg
└── cluster_0001
├── cat.1.jpg
└── cat.2.jpg
```
Raw data
{
"_id": null,
"home_page": "https://github.com/psthw/sfmp",
"name": "sfmp",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.5",
"maintainer_email": null,
"keywords": "separate, images, automatically, cluster, feature, deeplearning",
"author": null,
"author_email": null,
"download_url": null,
"platform": null,
"description": "# sfmp (separate for me please)\n\nSfmp is a tool to quickly separate images using clustering based on features extracted through a convolutional neural network.\nIt's really lightweight, using only a mobilenetv2 for feature extraction and kmeans for clustering.\n\n## Installation\n\nTo install sfmp, follow there steps:\n\nFor cpu\n```\npip install \"sfmp[cpu]\"\n```\n\nFor cuda 11.X\n```\npip install \"sfmp[gpu]\"\n```\n\nFor cuda 12.X\n```\npip install \"sfmp[gpu]\" --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/\n```\n\n## Usage\n\n### Command Line Interface\n\nYou can use sfmp from the command line by providing a list of globs:\n\n```\nsfmp ../examples/*.jpg ../examples2/*.jpg\n```\n\nIf you want to use CUDA:\n\n\n```\nsfmp ../examples/*.jpg ../examples2/*.jpg --provider CUDAExecutionProvider\n```\n\nCheck all execution providers [here](https://onnxruntime.ai/docs/execution-providers/).\n\nTo specify the number of clusters:\n\n```\nsfmp ../examples/*.jpg ../examples2/*.jpg --n_clusters 2\n```\n\nor output dir\n\nTo specify the number of clusters:\n\n```\nsfmp ../examples/*.jpg ../examples2/*.jpg --output_path result\n```\n\n### Example\n\nBefore\n```\n.\n\u251c\u2500\u2500 cat.1.jpg\n\u251c\u2500\u2500 cat.2.jpg\n\u251c\u2500\u2500 dog.3061.jpg\n\u2514\u2500\u2500 dog.3062.jpg\n```\n\n```\nsfmp ../examples/*.jpg --n_clusters 2\n```\n\nAfter\n\n```\n\u251c\u2500\u2500 cluster_0000\n\u2502 \u251c\u2500\u2500 dog.3061.jpg\n\u2502 \u2514\u2500\u2500 dog.3062.jpg\n\u2514\u2500\u2500 cluster_0001\n \u251c\u2500\u2500 cat.1.jpg\n \u2514\u2500\u2500 cat.2.jpg\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Separate images automatically",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/psthw/sfmp"
},
"split_keywords": [
"separate",
" images",
" automatically",
" cluster",
" feature",
" deeplearning"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "767ec9f8129931c2f015549f8f016cf78170dc5d92d16ff7a99972cabde83a50",
"md5": "dd3860e6f34125c51bd70ca45923d0f3",
"sha256": "922e9901ec3b06f238511d2342cc299ac7f92b9c840efdac1adfc5ae85b2b0b7"
},
"downloads": -1,
"filename": "sfmp-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dd3860e6f34125c51bd70ca45923d0f3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.5",
"size": 4112886,
"upload_time": "2024-07-14T04:50:37",
"upload_time_iso_8601": "2024-07-14T04:50:37.553288Z",
"url": "https://files.pythonhosted.org/packages/76/7e/c9f8129931c2f015549f8f016cf78170dc5d92d16ff7a99972cabde83a50/sfmp-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-14 04:50:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "psthw",
"github_project": "sfmp",
"github_not_found": true,
"lcname": "sfmp"
}