Skip to main content

Build and train computer vision models with 5 lines of code

Project description

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!

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

detecto-1.1.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

detecto-1.1.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file detecto-1.1.0.tar.gz.

File metadata

  • Download URL: detecto-1.1.0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for detecto-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7e75de7b06f3c1ee0c3f8010dfb5afc55def7eabfeb6a9032899b1b762f093d0
MD5 c00d6c11e0b781360b1239f01b063e6c
BLAKE2b-256 e608cf300aa346d74c0eef1e03e64e5330005f190454ebdbfa8195649bffc7fe

See more details on using hashes here.

File details

Details for the file detecto-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: detecto-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for detecto-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b17164cf730edb59f2d66d3f66652461d5d2da16b2ede4ffb5f99a6e6b2f78a
MD5 9e22d55efd847858c454c4ceff743e24
BLAKE2b-256 a0ed0259d30cb4f138d26a75bc2fa4626134a3506d97446ca90c00a375cb3a7c

See more details on using hashes here.

Supported by

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