Reference for ultralytics/hub/__init__.py
Note
Full source code for this file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/init.py. Help us fix any issues you see by submitting a Pull Request 🛠️. Thank you 🙏!
ultralytics.hub.login(api_key='')
Log in to the Ultralytics HUB API using the provided API key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_key |
str
|
May be an API key or a combination API key and model ID, i.e. key_id |
''
|
Source code in ultralytics/hub/__init__.py
ultralytics.hub.logout()
Log out of Ultralytics HUB by removing the API key from the settings file. To log in again, use 'yolo hub login'.
Source code in ultralytics/hub/__init__.py
ultralytics.hub.reset_model(model_id='')
Reset a trained model to an untrained state.
Source code in ultralytics/hub/__init__.py
ultralytics.hub.export_fmts_hub()
Returns a list of HUB-supported export formats.
ultralytics.hub.export_model(model_id='', format='torchscript')
Export a model to all formats.
Source code in ultralytics/hub/__init__.py
ultralytics.hub.get_export(model_id='', format='torchscript')
Get an exported model dictionary with download URL.
Source code in ultralytics/hub/__init__.py
ultralytics.hub.check_dataset(path='', task='detect')
Function for error-checking HUB dataset Zip file before upload. It checks a dataset for errors before it is uploaded to the HUB. Usage examples are given below.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
Path to data.zip (with data.yaml inside data.zip). Defaults to ''. |
''
|
task |
str
|
Dataset task. Options are 'detect', 'segment', 'pose', 'classify'. Defaults to 'detect'. |
'detect'
|