Skip to main content

Detecto Logo

CircleCI Documentation Status

Detecto is a Python package for quick and easy object detection. Below are just a few of the features available:

  • Train models on custom datasets
  • Get all or top predictions on an image
  • Run object detection on videos
  • Save and load models from files

Detecto is built on top of PyTorch, meaning models trained with Detecto can easily be extracted and used with PyTorch code.

Video demo of Detecto

Usage and Docs

To install Detecto using pip, run the following command:

pip3 install detecto

After installing Detecto, you can train a machine learning model on a custom dataset and run object detection on a video with under ten lines of code:

from detecto.core import Model, Dataset, DataLoader
from detecto.utils import xml_to_csv
from detecto.visualize import detect_video

xml_to_csv('xml_labels/', 'labels.csv')
dataset = Dataset('labels.csv', 'images/')
loader = DataLoader(dataset)

model = Model(['dog', 'cat', 'rabbit'])
model.fit(loader)

detect_video(model, 'input_video.mp4', 'output_video.avi')

Visit the docs for a full guide, including a quickstart tutorial.

Alternatively, check out the demo on Colab.

Contributing

All issues and pull requests are welcome! To run the code locally, first fork the repository and then run the following commands on your computer:

git clone https://github.com/<your-username>/detecto.git
cd detecto
# Recommended to create a virtual environment before the next step
pip3 install -r requirements.txt

When adding code, be sure to write unit tests and docstrings where necessary.

Tests are located in detecto/tests and can be run using pytest:

python3 -m pytest

To generate the documentation locally, run the following commands:

cd docs
make html

The documentation can then be viewed at docs/_build/html/index.html.

Contact

Detecto was created by Alan Bi. Feel free to reach out on Twitter or through email!

Release files for detecto 1.1.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 detecto 1.1.1
File Size Uploaded
detecto-1.1.1.tar.gz 19.0 kB Details

Built distribution (wheel)

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

Total release size: 41.5 kB

Release files / detecto-1.1.1.tar.gz

Download URL detecto-1.1.1.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fdcafae390e36349a4b022fee32177f519071d2ce6e57b96d8146d7307f49ac1
BLAKE2b-256 checksum
How to use checksums
1f822f43617b81afb1c2db45314b35a78c0a2c4a410cc3e8d046fa51149589c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.4

Release files / detecto-1.1.1-py3-none-any.whl

Download URL detecto-1.1.1-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a648ed185f4d64f0c881555d37d96ae5615947a2246a47dd2221821ded7dd94
BLAKE2b-256 checksum
How to use checksums
e8aea2808b4ad1d9d0d472154965217ef8aca6ed5fe962fac020d75c7e5fba80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.4

Release history Release notifications | RSS feed

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

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