back

Quick Start



About This API

UtagoeML API allows us to use our deep learning algorithms and pre-trained models easily in your apps.

All API accesses are done by HTTPS, base URL is https://ml.api.utagoe.com. Most of the access requires an access key, so that only the authorized users can use our functions.

In most cases, response of the API is in JSON format. One of the few exceptions is the download of datasets and trained models, etc.

For getting more details, please go back to the documentation top page and see any other pages you want.



Environment

We recommend the Postman to use our API. You can download it from here and can use it for free.

Following instructions has been confirmed on the environment below:



Upload the Dataset ~ Train the Yolov2 Model

Prepare for Your Access Key

Before you start using the API, first you should get your own access key of it.

Sign in to your account, then view the profile page on the top right of the page. Access key will be appeared on that page.

Please remember it and DO NOT SHOW IT TO OTHERS.

In the following explanation, the access key is assumed to be "ExampleAccessKey1234".



Upload the Dataset

Assume that the file which is for uploading is placed in the home directory (~/example.zip). "example.zip" has following directory structure.

example.zip
└── example/
    ├── property.json
    └── data/
        ├── 0001.jpg
        ├── 0001.txt
        ├── 0002.jpg
        ├── 0002.txt
        ├── 0003.jpg
        ├── 0003.txt
        └── ...

"property.json" contains both a number and the names of the classes. For example:

{
    "class_num":2,
    "classes":["car", "truck"],
}

A pair of the image and the label file must have same file names such as "0001.jpg" and "0001.txt". All pairs are placed under the data directory.

You can upload your dataset "~/example.zip" as "sample_data" by following command in the home directory.

curl https://ml.api.utagoe.com/data/upload -F access_key=ExampleAccessKey1234 -F data=@example.zip -F type=yolo -F dataset=sample_data



Start Training the Yolov2 Model

When you start training the Yolov2 model, you can pass the parameters below:

Name Type Required In Description
access_key text Yes Body your access key
model_name text Yes Body name of model
dataset text Yes Body specified dataset ID
batch_size int Body batch_size (1 as default)
subdivisions int Body subdivisions (1 as default)
lr float Body learning rate (0.001 as default)
final_epoch int Body final epoch number
source text Body source model name (None as default)

For example:

curl https://ml.api.utagoe.com/yolo/train -H "Content-Type: application/json" --data-binary '{"access_key":"ExampleAccessKey1234", "model_name": "example_model", "dataset": "sample_data", "batch_size": 64, "subdivisions": 8}'



Check the Progress

Response of the previous section will contains the URL which is used for getting a progress of the training process. When you want to check the progress of "example_model", you can get it with follows:

curl https://ml.api.utagoe.com/yolo/progress?model_name=example_model -H "Access-Key: ExampleAccessKey1234"



Stop the Training Process

To stop the training process, you should specify the model's name and send a request to the server. For example:

curl https://ml.api.utagoe.com/yolo/stop -H "Content-Type: application/json" --data-binary '{"access_key":"ExampleAccessKey1234", "model_name": "example_model"}'



Use the Trained Model

Make a Prediction

Result of the prediction on the sample_data using example_model is given by following command.

curl https://ml.api.utagoe.com/yolo/predict -H "Content-Type: application/json" --data-binary '{"access_key":"ExampleAccessKey1234", "model_name": "example_model", "dataset_id": "sample_data"}'

The above request will return a URL to browse the results as a response. Keep your mind that you should copy such URL and check your result.



Download the Model

Finally, you can download trained model data.

curl https://ml.api.utagoe.com/yolo/download?model_name=example_model -H "Access-Key: ExampleAccessKey1234" --output example_model.zip