Giter VIP home page Giter VIP logo

custom-vision-autotrainer's Introduction

Custom-Vision-Autotrainer

An autotraining tool for customvision.ai using Azure Blob Storage and Azure Pipelines

Build Status

Features

  • Data Catalogue
  • Train, Test, and Holdout sets
  • CLI, Python and CI/CD friendly
  • Get started quickly with local uploads
  • Store labels with images
  • Select data for training Custom Vision models
  • Train and export your models

Data Catalogue

Backed by Azure Storage, Autotrainer helps you maintain a large collection of labelled images for machine learning.

Train, Test, and Holdout sets

Machine learning often requires the use of multiple datasets that must remain segregated. Autotrainer provides three containers for image datasets: train, test, and holdout.

  • Train: Used to training the model.
  • Test: Used to test the model during training, and potentially join the training set.
  • Holdout: Validate your model using this unseen data.

CLI, Python and CI/CD Friendly

Consume autotrainer via the CLI, in Python code, or run in Azure Pipelines.

Get started quickly

Upload a set of images from a directory in a single command.

Store labels with images

Labels are stored in special label files, right next to the image in blob storage.

Select data for a Custom Vision project

Select images from your training set, and push them to a Custom Vision project.

Train and export your models

Automate the training and exporting of models.

Quickstart

Docker

docker run -it -e "CV_ENDPOINT=https://southcentralus.api.cognitive.microsoft.com" -e "CV_TRAINING_KEY=your_key" -e "STORAGE_ACCOUNT_CONNECTION_STRING=your_connection_string" flanagan89/custom-vision-autotrainer -h

Configuration

Autotrainer requires three environment variables:

Build

Setup environment and install dependencies

I recommend using Mini Conda to manage your python environment. Download and install miniconda, then in a shell:

  1. Create a conda environment: conda create -n customvisionautotrainer python=3.6
  2. Activate the environment: activate customvisionautotrainer.
  3. Install runtime dependencies: pip install -r src/autotrainer/requirements.txt
  4. Install developer dependencies: pip install -r src/autotrainer/requirements-dev.txt
  5. Configure environment variables (see above)

Run the Autotrainer CLI

$ cd src/autotrainer
$ python ./autotrainer_cli.py -h
usage: autotrainer [cv, catalogue, select] <options>

Autotrainer tools

positional arguments:
  command     Subcommand to run

optional arguments:
  -h, --help  show this help message and exit

$ python ./autotrainer_cli.py catalogue -h
usage: autotrainer catalogue <options>

Data Catalogue tools

positional arguments:
  {describe,upload}  Catalogue options

optional arguments:
  -h, --help         show this help message and exit

Test

Autotrainer uses nose

First, run Azurite for local blob storage testing:

$ cd src/
$ docker-compose up -d

Then you can run the tests.

$ cd src/autotrainer
$ nosetests
............
----------------------------------------------------------------------
Ran 12 tests in 7.088s

OK

NOTE: Some tests require access to a real Azure Storage account and Custom Vision service. See the environment variable section above.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

custom-vision-autotrainer's People

Contributors

jasonthedeveloper avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar xtellurian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

custom-vision-autotrainer's Issues

`autotrainer_cli.py select` requires unnecessary input argument

When selecting data from blobs to add to Custom Vision, a --num argument specifying the number of data items from blob is required.

Autotrainer should be able to handle instances where --num is not given and the entire dataset from blob is added to Custom Vision in its absence.

PR validation builds have access to build secrets

Some of the tests require access to a Storage Account and Custom Vision training key.

For the tests to pass, the PR validation builds require access to those secrets.

There's nothing valuable in the accounts, but in general we don't want to be giving away those secrets.

We should fix that - maybe we can spin up the Azure resources before doing the PR build, and then destroy them afterwards

Save Custom Vision image Id to blob storage

When an image is uploaded from blob storage to Custom Vision, we wish to record that identity relationship.

By saving the Id from CV into the blob (somehow) that Id will be preserved.

Also, we need this Id in order to extract and save the bounding boxes (#1 )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.