-
Print
-
DarkLight
-
PDF
AI Model Library
-
Print
-
DarkLight
-
PDF
Model architectures are presented in the 'AI Library', and are the foundation to beginning model management, versioning and training with various data. Use a public model architecture or add your own from GIT to create the first model version.
To access model architectures in the AI Library - Select "AI Library" button in the model-management module
To return to model-management main page Click on "back to versions"
Public Models
The Dataloop system has several pre-installed and publicly available model architectures, which can be installed in your project and trained with your data to achieve pre-annotations of your labels.
- ResNet - For image classification
- yolo-v5 - For box annotations
- unet - for mask/segmentation (COMING SOON)
Add Your Own Model
Connect your own models to the dataloop system by placing them in GIT repository and allowing Dataloop to access it.
To train your model in the Dataloop system, it should have a Train function that facilitates the training process you wish to facilitate.
Model Adaptor
The Model Adapter is a python class to create a single API between Dataloop’s platform and your Model. By inheriting from a Dataloop class dl.BaseModelAdapter that facilitates all the necessary functions, all that is left is to create these 4 methods:
- Train
- Predict
- Load (to load model weights)
- Save (to save model weights)
For example, your model adapter can be:
import dtlpy as dl
import torch
import os
class SimpleModelAdapter(dl.BaseModelAdapter):
def load(self, local_path, **kwargs):
print('loading a model')
self.model = torch.load(os.path.join(local_path, 'model.pth'))
def save(self, local_path, **kwargs):
print('saving a model to {}'.format(local_path))
torch.save(self.model, os.path.join(local_path, 'model.pth'))
def train(self, data_path, output_path, **kwargs):
print('running a training session')
def predict(self, batch, **kwargs):
print('predicting batch of size: {}'.format(len(batch)))
preds = self.model(batch)
return preds
Install Your Model (GIT Codebase)
-
Click on "Import AI Application"
-
In the "New Model" popup, enter the relevant information to allow connecting to your code on GIT
- Model Name - The name you wish to assign to the model when represented and referred to in the Dataloop system
- GIT URL
- Model description (optional)
- Class name (optiona)- the class where you have the model adaptor
- Entry poin (optiona) - the python file to use as entry point
- Input type expected by the model (image, video etc)
- Output expected from the model (box annotation, classification etc)
- Tags - optional tags to assign to the model