Skip to main content

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

Metadata

Release files for sfmp 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for sfmp 1.0.1
File Interpreter ABI Platform
sfmp-1.0.1-py3-none-any.whl Python 3 none any Details

Release files / sfmp-1.0.1-py3-none-any.whl

Download URL sfmp-1.0.1-py3-none-any.whl
Size 4.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
922e9901ec3b06f238511d2342cc299ac7f92b9c840efdac1adfc5ae85b2b0b7
BLAKE2b-256 checksum
How to use checksums
767ec9f8129931c2f015549f8f016cf78170dc5d92d16ff7a99972cabde83a50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.16

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page