Research codebase for teacher-student based semi-supervised object detection in agricultural settings
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smallteacher-0.0.1.tar.gz.
File metadata
- Download URL: smallteacher-0.0.1.tar.gz
- Upload date:
- Size: 36.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29f4787064495dd665cf8551dba8ae59b91e89b6390cf503939e0b9bdf31419b
|
|
| MD5 |
5db365f366a0ea9088ebf7b4f40accc3
|
|
| BLAKE2b-256 |
d309f6f4a50bf3fac8d7f962d8d7e7131d0186dee44d08fcc3e9f1e3035abce0
|
File details
Details for the file smallteacher-0.0.1-py3-none-any.whl.
File metadata
- Download URL: smallteacher-0.0.1-py3-none-any.whl
- Upload date:
- Size: 42.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1825a3d8d4918f3dc35a4371db5c60d42e10b1b1dec3da7b90953e08add0be3
|
|
| MD5 |
4f23e2a92721a8e994aec8f64f7f372f
|
|
| BLAKE2b-256 |
42beb4d074c68ed03fa9e5006b98f8c1734ca14eb33a529996a6864509a0965e
|