Create
Hub¶
Hub provide a unified interface for training, evaluating, exporting and benchmarking. You can create a hub by Hub.new
function.
Select Backend¶
In [1]:
Copied!
from waffle_hub.hub import Hub
Hub.get_available_backends()
from waffle_hub.hub import Hub
Hub.get_available_backends()
/home/lhj/anaconda3/envs/waffle/lib/python3.9/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html from .autonotebook import tqdm as notebook_tqdm
Out[1]:
['ultralytics', 'autocare_dlt', 'transformers']
In [2]:
Copied!
Hub.get_available_tasks("ultralytics")
Hub.get_available_tasks("ultralytics")
Out[2]:
[OBJECT_DETECTION, CLASSIFICATION, INSTANCE_SEGMENTATION]
In [4]:
Copied!
Hub.get_available_model_types("ultralytics", "OBJECT_DETECTION")
Hub.get_available_model_types("ultralytics", "OBJECT_DETECTION")
Out[4]:
['yolov8']
In [5]:
Copied!
Hub.get_available_model_sizes("ultralytics", "OBJECT_DETECTION", "yolov8")
Hub.get_available_model_sizes("ultralytics", "OBJECT_DETECTION", "yolov8")
Out[5]:
['n', 's', 'm', 'l', 'x']
Create Hub¶
In [6]:
Copied!
Hub.new(
name="detector",
backend="ultralytics",
task="OBJECT_DETECTION",
model_type="yolov8",
model_size="n",
categories=["1", "2"]
)
Hub.new(
name="detector",
backend="ultralytics",
task="OBJECT_DETECTION",
model_type="yolov8",
model_size="n",
categories=["1", "2"]
)
Out[6]:
ModelConfig(name='detector', backend='ultralytics', version='8.0.112', task='OBJECT_DETECTION', model_type='yolov8', model_size='n', categories=[{'supercategory': 'object', 'name': '1'}, {'supercategory': 'object', 'name': '2'}])