Skip to main content

SSOD for Agriculture

This is intended to be a starting point for researching and deploying semi-supervised object detection models for agriculture.

This is achieved by exposing a PyTorch Lightning module which trains a teacher-student model, given labelled and unlabelled data:

from smallteacher.models import SemiSupervised

model = SemiSupervised(
    model_base="SSD",
    num_classes=2,
)

PyTorch torchvision detection models should be drop in replaceable to this pipeline; we currently support Faster R-CNN, Retinanet, YOLO and SSD models.

Given a Labelled Dataset, which returns tuples of images and annotations (as expected by any torchvision detection model), and an Unlabelled Dataset (which returns only unlabelled images), users can construct a DataModule which can be used to train this model:

from smallteacher.data import DataModule

datamodule = DataModule(
    labelled_train_ds,
    labelled_val_ds,
    labelled_test_ds
)
datamodule.add_unlabelled_data(unlabelled_ds)

An example of this code being applied to a semi-supervised dataset is available in the smallSSD folder.

Installation

smallteacher can be installed with the following command:

pip install smallteacher

License

smallteacher has a Creative Commons Attribution-NonCommercial 4.0 International license.

Release files for smallteacher 0.0.1

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

Source distribution (sdist)

Source distribution for smallteacher 0.0.1
File Size Uploaded
smallteacher-0.0.1.tar.gz 36.7 kB Details

Built distribution (wheel)

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

Total release size: 79.3 kB

Release files / smallteacher-0.0.1.tar.gz

Download URL smallteacher-0.0.1.tar.gz
Size 36.7 kB
Tags Source
SHA-256 checksum
How to use checksums
29f4787064495dd665cf8551dba8ae59b91e89b6390cf503939e0b9bdf31419b
BLAKE2b-256 checksum
How to use checksums
d309f6f4a50bf3fac8d7f962d8d7e7131d0186dee44d08fcc3e9f1e3035abce0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / smallteacher-0.0.1-py3-none-any.whl

Download URL smallteacher-0.0.1-py3-none-any.whl
Size 42.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1825a3d8d4918f3dc35a4371db5c60d42e10b1b1dec3da7b90953e08add0be3
BLAKE2b-256 checksum
How to use checksums
42beb4d074c68ed03fa9e5006b98f8c1734ca14eb33a529996a6864509a0965e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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