February 12, 2021 (Python SDK)
almost 4 years ago by Grace H
We are committed to your success, that's why we are always improving our platform. You can now integrate training and prediction calls within the Python pipeline.
Run model training
To run a model training:
sa.run_training(
project = ["city_batch1","city_batch2"],
base_model = "Instance Segmentation (trained on COCO)",
model_name = "Cityscapes Segmentation Model",
model_description = "Model Finetuned on Cityscapes",
task = "Instance Segmentation for Vector Projects",
hyperparameters = {"base_lr": 0.02, "images_per_batch": 8},
log = True)
Adjust the default values of the training hyperparameters based on the following table:
Parameter | Description | Default Value |
---|---|---|
instance_type | The type of the devices (GPUs) available to train your model. You have two options: One GPU of type T4 with 16GB memory or 4 GPUs of the same type | 1 x T4 16 GB |
num_epochs | The number of times the dataset undergoes training. The epoch count ranges from 10 to 200. | 12 |
images_per_batch | Number of images fed to network per training iteration per GPU | 4 |
base_lr | The model’s initial learning step. The learning rate ranges from 0 to 1. | 0.02 |
batch_per_image | The number of regions of interest (ROI) per image. The ROI ranges from 2 to 512 and is a power of 2. The smaller the ROI, the faster the learning rate. Image (ROIs) per batch works only with Instance segmentation. | 512 |
evaluation_period | The number of epochs to run evaluation periodically. If the epoch count is 10 and the evaluation period is 2, it means that the dataset will undergo an evaluation every 2 epochs. The user will be reported of the best model that resulted from the evaluation period. | 12 |
dataset_split_ratio | The number of images that need to be trained to the number of images that need to be tested. The train/test split ratio ranges from 0 to 100. | 80 |
gamma | Gamma is needed for the learning rate. Its value ranges from 0 to 1, and it will be multiplied with the learning rate. | 0.5 |
steps | List of epoch counts to decrease learning rate gamma times | [ 5 ] |
Run smart prediction
To run smart prediction on a model:
project_name = "city_batch3"
images = sa.search_images(
project = project_name,
annotation_status = "NotStarted")
succeeded, failed = sa.run_prediction(
project = project_name,
images_list = images,
model = "Cityscapes Segmentation Mode")
This function logs the progress bar which shows the number of successful predicted images.
Run smart segmentation
To run smart segmentation on a model:
succeeded, failed = sa.run_segmentation(
project = project_name,
images_list = images,
model = "generic")
There are two segmentation model available: generic and autonomous. Choose the option that best suits your use case.
Other changes and improvements
With Python SDK, you can also:
- Stop model trainings.
- Download, compare, and delete models.
What do you think of the updates? We’d love to hear your feedback.
We have a blog! Follow us to stay updated.