Image ML Classify is a versatile web application that serves as a powerful image processing and ResNet-18 model training tool. It provides the convenience of storing and synchronizing datasets in the Yandex Disk cloud storage.
The application utilizes Docker for containerization, and model training occurs in the background, freeing the main thread for other tasks. All datasets can be stored and synchronized with Yandex Disk, ensuring data availability and convenience for model training.
Below are the endpoints and sample CURL requests for using this tool:
Upload an image and obtain classification results using the pre-trained ResNet-18 model.
curl -X POST \
-F "file=@your_image.jpg" \
http://your-api-url/api/v1/image
Initiate the training of the ResNet-18 model with your custom datasets in the background.
curl -X GET \
-H "X-Key: your_api_key" \
http://your-api-url/api/v1/train
curl -X POST \
-H "X-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"epoch": 10, "hard_run": false, "run_as": "all"}' \
http://your-api-url/api/v1/train
How-To?
Requirements:- Create a new application (optional, you can use a third-party
application; you'll need its ID and secret)
- App ID
- App Secret
- Authorize the application to access the disk
- Get the authorization code
- Get the access token
Official instructions - https://yandex.ru/dev/disk/api/concepts/quickstart.html#quickstart__oauth
The main goal is to obtain the App ID and App Secret; you can use an existing application.
Navigate to the following link - https://oauth.yandex.ru/authorize?response_type=code&client_id={APP_ID}
You will be asked to confirm permissions for the application.
After redirection, you will be provided with a code http://.../?code=7122172
the authorization code is valid for 15 minutes
After obtaining the authorization code, you can acquire the application's
authorization token. To do this, make a POST
request, providing the necessary
data
curl -X POST \
-L "https://oauth.yandex.ru/token" \
-F "grant_type=authorization_code" \
-F "client_id={APP_ID}" \
-F "client_secret={APP_SECRET}" \
-F "code={AUTH_CODE}" \