Metadata-Version: 2.1
Name: miso
Version: 3.1.7
Summary: Python scripts for training CNNs for particle classification
Home-page: https://github.com/microfossil/particle-classification
Author: Ross Marchant
Author-email: ross.g.marchant@gmail.com
License: MIT
Project-URL: Source, https://github.com/microfossil/particle-classification
Project-URL: Paper, https://jm.copernicus.org/articles/39/183/2020/
Keywords: microfossil,cnn
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.9,<=3.11
Description-Content-Type: text/markdown
License-File: LICENCE.txt
Requires-Dist: tensorflow ==2.10.1
Requires-Dist: image-classifiers ==1.0.0
Requires-Dist: lxml ==5.1.0
Requires-Dist: matplotlib ==3.8.2
Requires-Dist: numpy ==1.26.3
Requires-Dist: pandas ==2.1.4
Requires-Dist: Pillow ==10.2.0
Requires-Dist: imagecodecs ==2024.1.1
Requires-Dist: scikit-image ==0.22.0
Requires-Dist: scikit-learn ==1.3.2
Requires-Dist: scipy ==1.11.4
Requires-Dist: segmentation-models ==1.0.1
Requires-Dist: dill ==0.3.7
Requires-Dist: flask ==3.0.0
Requires-Dist: itsdangerous ==2.1.2
Requires-Dist: tqdm ==4.66.1
Requires-Dist: openpyxl ==3.1.2
Requires-Dist: imbalanced-learn ==0.11.0
Requires-Dist: tf2onnx ==1.14.0
Requires-Dist: protobuf ==3.19.6
Requires-Dist: cleanlab ==2.5.0
Requires-Dist: packaging ==23.2
Requires-Dist: tensorflow-addons ==0.19.0
Requires-Dist: marshmallow-dataclass ==8.6.0

# 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, will extract the sample as the subfolder 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]
  -f, --in_samples / --no-in_samples
                                  Set this flag if images are stored in
                                  subfolders, using the subfolder names as
                                  sample labels.  [default: no-in_samples]
  -s, --sample TEXT               Default sample name if not using
                                  subdirectories.  [default: unknown]
  --unsure_threshold FLOAT        Threshold below which predictions are
                                  considered unsure.  [default: 0.0]
```
