Skip to main content

Separate images automatically

Project description

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.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

sfmp-1.0.1-py3-none-any.whl (4.1 MB view details)

Uploaded Python 3

File details

Details for the file sfmp-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sfmp-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.16

File hashes

Hashes for sfmp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 922e9901ec3b06f238511d2342cc299ac7f92b9c840efdac1adfc5ae85b2b0b7
MD5 dd3860e6f34125c51bd70ca45923d0f3
BLAKE2b-256 767ec9f8129931c2f015549f8f016cf78170dc5d92d16ff7a99972cabde83a50

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page