back
Yolo v7
You can perform transfer learning of PyTorch's yolov7 using your own dataset.
BaseURL
https://ml.api.utagoe.com/yolov7
Dataset structure
Pack dataset in following directory structure.
(dataset_name)
│
├── property.json
└── data
├── IMG_20190709_153520.jpg
├── IMG_20190709_153520.txt
├── IMG_20190709_153537.jpg
├── IMG_20190709_153537.txt
├── IMG_20190709_153542.jpg
├── IMG_20190709_153542.txt
└── ...
property.json
You should prepare property.json, that have information of class label.
Example:
{
"class_num":2,
"classes":["car", "truck"]
}
- class_num: number of classes.
- classes: list of class label.
Train yolov7
URL
POST /train
Header
| Key |
Value |
| Content-Type |
application/json |
Parameters
| Name |
Type |
Required |
In |
Description |
| access_key |
Text |
Yes |
Body |
|
| model_name |
Text |
Yes |
Body |
Name to identify the model |
| dataset |
Text |
Yes |
Body |
Dataset ID |
Code sample
Shell
curl https://ml.api.utagoe.com/yolov7/train -H "Content-Type: application/json" --data-binary '{"access_key":"ExampleAccessKey1234", "model_name": "yourmodel", "dataset": "yourdata"}'
Response
Status: 200 OK
{
"url": "https://ml.api.utagoe.com/yolov7/progress?model_name=yourmodel"
}
Stop the training process
URL
POST /stop
Header
| Key |
Value |
| Content-Type |
application/json |
Parameters
| Name |
Type |
Required |
In |
Description |
| access_key |
Text |
Yes |
Body |
|
| model_name |
Text |
Yes |
Body |
Name to identify the model |
Code sample
Shell
curl https://ml.api.utagoe.com/yolov7/stop -H "Content-Type: application/json" --data-binary '{"access_key":"ExampleAccessKey1234", "model_name": "yourmodel"}'
Response
Status: 200 OK
{}
Restart the training process
URL
POST /restart
Header
| Key |
Value |
| Content-Type |
application/json |
Parameters
| Name |
Type |
Required |
In |
Description |
| access_key |
Text |
Yes |
Body |
|
| model_name |
Text |
Yes |
Body |
Name to identify the model |
Code sample
Shell
curl https://ml.api.utagoe.com/yolov7/restart -H "Content-Type: application/json" --data-binary '{"access_key":"ExampleAccessKey1234", "model_name": "yourmodel"}'
Response
Status: 200 OK
{
"url": "https://ml.api.utagoe.com/yolov7/progress?model_name=yourmodel"
}
Get a progress of the training
URL
GET /progress
Header
| Key |
Value |
| Access-Key |
YourAccessKey |
Parameters
| Name |
Type |
Required |
In |
Description |
| model_name |
Text |
Yes |
Query |
Name to identify the model |
Code sample
Shell
curl "https://ml.api.utagoe.com/yolov7/progress?model_name=yourmodel" -H "Access-Key: ExampleAccessKey1234"
Response
Status: 200 OK
{
"model_name": "yourmodel",
"dataset": "yourdata",
"message": "",
"running": true,
"epoch": "5",
"train/box_loss": "0.0948256328701973",
"train/obj_loss": "0.00872495211660862",
"train/cls_loss": "0.03885503485798836",
"metrics/precision": "0.0",
"metrics/recall": "0.0",
"metrics/mAP_0.5": "0.0",
"metrics/mAP_0.5:0.95": "0.0",
"val/box_loss": "0.1425204575061798",
"val/obj_loss": "0.013971827924251556",
"val/cls_loss": "0.039018262177705765",
"x/lr0": "0.0014894118575812846",
"x/lr1": "0.0014894118575812846",
"x/lr2": "0.08658941185758129"
}
Make a prediction using trained model
URL
POST /predict
Header
| Key |
Value |
| Content-Type |
application/json |
Parameters
| Name |
Type |
Required |
In |
Description |
| access_key |
Text |
Yes |
Body |
|
| model_name |
Text |
Yes |
Body |
Name to identify the model |
| dataset_id |
Text |
Yes |
Body |
Dataset ID |
Code sample
Shell
curl https://ml.api.utagoe.com/yolov7/predict -H "Content-Type: application/json" --data-binary '{"access_key":"ExampleAccessKey1234", "model_name": "yourmodel", "dataset": "yourdata"}'
Response
Status: 200 OK
{
"url": "https://ml.api.utagoe.com/yolov7/output?key=20210615120845",
"key": "20210615120845"
}
Get an output of the prediction
URL
GET /output
Header
| Key |
Value |
| Access-Key |
YourAccessKey |
Parameters
| Name |
Type |
Required |
In |
Description |
| key |
Text |
Yes |
Query |
Specific key string |
Code sample
Shell
curl "https://ml.api.utagoe.com/yolov7/output?key=20210615120845" -H "Access-Key: ExampleAccessKey1234"
Response
Status: 200 OK
{
"progress": 37.5625,
"results": [
{
"filename": "cat.1004.jpg",
"class": "dog"
},
{
"filename": "cat.1005.jpg",
"class": "cat"
}
]
}
URL
GET /result
Header
| Key |
Value |
| Access-Key |
YourAccessKey |
Parameters
| Name |
Type |
Required |
In |
Description |
| key |
Text |
Yes |
Query |
Specific key string |
Code sample
Shell
curl "https://ml.api.utagoe.com/yolov7/result?key=20210615120845" -H "Access-Key: ExampleAccessKey1234" --output 20210615120845.zip
Response
Status: 200 OK
Get a list of trained model
URL
GET /list
Header
| Key |
Value |
| Access-Key |
YourAccessKey |
Parameters
| Name |
Type |
Required |
In |
Description |
|
|
|
|
|
Code sample
Shell
curl "https://ml.api.utagoe.com/yolov7/list" -H "Access-Key: ExampleAccessKey1234"
Response
Status: 200 OK
{
"model_list": [
{
"model_name": "yourmodel",
"dataset_id": "yourdata"
}
]
}
Delete the model
URL
POST /delete
Header
| Key |
Value |
| Content-Type |
application/json |
Parameters
| Name |
Type |
Required |
In |
Description |
| access_key |
Text |
Yes |
Body |
|
| model_name |
Text |
Yes |
Body |
Name to identify the model |
Code sample
Shell
curl https://ml.api.utagoe.com/yolov7/delete -H "Content-Type: application/json" --data-binary '{"access_key":"ExampleAccessKey1234", "model_name": "yourmodel"}'
Response
Status: 200 OK
{}
Check if specific dataset is available
URL
GET /validate
Header
| Key |
Value |
| Access-Key |
YourAccessKey |
Parameters
| Name |
Type |
Required |
In |
Description |
| dataset |
Text |
Yes |
Query |
Dataset ID |
Code sample
Shell
curl "https://ml.api.utagoe.com/yolov7/validate?dataset=yourdata" -H "Access-Key: ExampleAccessKey1234"
Response
Status: 200 OK
{
"valid": true,
"message": ""
}
Download the model
URL
GET /download
Header
| Key |
Value |
| Access-Key |
YourAccessKey |
Parameters
| Name |
Type |
Required |
In |
Description |
| model_name |
Text |
Yes |
Query |
Name to identify the model |
Code sample
Shell
curl "https://ml.api.utagoe.com/yolov7/download?model_name=yourmodel" -H "Access-Key: ExampleAccessKey1234" --output yourmodel.zip
Response
Status: 200 OK