Skip to main content

Python scripts for training CNNs for particle classification

Project description

Particle Classification

Python scripts for particle classification

Used by particle trieur to perform model training.

Installation

conda create -n miso python=3.9
conda activate miso
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
pip install tensorflow==2.10.1
pip install miso

Updating

conda activate miso
pip install -U miso

Command line interface (CLI)

Train a model

TBD

Classify a folder of images

Classifies a folder of images and saves the result in a CSV. This CSV can be imported into Particle Trieur. If the images are organised by sample into subfolders it will use the subfolder name as the sample name, else specify the sample name manually.

Usage: python -m miso classify-folder [OPTIONS]

  Classify images in a folder and output the results to a CSV file.

Options:
  -m, --model PATH              Path to the model information.  [required]
  -i, --input PATH              Path to the directory containing images.
                                [required]
  -o, --output PATH             Path where the output CSV will be saved.
                                [required]
  -b, --batch_size INTEGER      Batch size for processing images.  [default:
                                32]
  -s, --sample TEXT             Default sample name if not using
                                subdirectories.  [default: unknown]
  -u, --unsure_threshold FLOAT  Threshold below which predictions are
                                considered unsure.  [default: 0.0]

Morphology of a folder of plankton images

Does morphology on a folder of plankton images and saves the result in a CSV. This CSV can be imported into Particle Trieur as parameters. If the images are organised by sample into subfolders it will use the subfolder name as the sample name, else specify the sample name manually.

The plankton model must first be downloaded from here: https://1drv.ms/f/s!AiQM7sVIv7fanuNzfcw2O8kAnDU26Q?e=NA5ztG

Make sure to put the model.onnx and the model_info.xml files in the same folder

Usage: python -m miso segment-folder [OPTIONS]

  Segment images in a folder and output the results.

Options:
  -m, --model PATH          Path to the model information.  [required]
  -i, --input PATH          Path to the folder containing images.  [required]
  -o, --output PATH         Path where the morphology csv will be saved.
                            [required]
  -b, --batch_size INTEGER  Batch size for processing images.  [default: 32]
  -s, --sample TEXT         Default sample name  [default: unknown]
  -t, --threshold FLOAT     Threshold for segmentation.  [default: 0.5]
  --save-contours           Whether to save contours or not.

Project details


Download files

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

Source Distribution

miso-3.1.21.tar.gz (84.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

miso-3.1.21-py3-none-any.whl (106.0 kB view details)

Uploaded Python 3

File details

Details for the file miso-3.1.21.tar.gz.

File metadata

  • Download URL: miso-3.1.21.tar.gz
  • Upload date:
  • Size: 84.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for miso-3.1.21.tar.gz
Algorithm Hash digest
SHA256 a86df6cc993df2e6a5c2669135bc102cfc3cee13ba29336c69f5ffaa898b37b0
MD5 673c409cb1497d0e012def185e7b8ffa
BLAKE2b-256 6e728dc508ffca97ced45d9b84cafb15009a02160a1a9251f6704a927a228d2a

See more details on using hashes here.

File details

Details for the file miso-3.1.21-py3-none-any.whl.

File metadata

  • Download URL: miso-3.1.21-py3-none-any.whl
  • Upload date:
  • Size: 106.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for miso-3.1.21-py3-none-any.whl
Algorithm Hash digest
SHA256 652912c37adb494f95e442052bfee196192adc65fe5355906a632ed284a38b37
MD5 521deaaa04fa4305dcb98bd864ea60ab
BLAKE2b-256 d10bf584cf008a80c7dccc110e01c3077d4977c393387a578306633a2580a55f

See more details on using hashes here.

Supported by

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