From 89ad484839639844e56d37a866d82607ab36cd30 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Wed, 9 Nov 2022 11:28:46 +0200 Subject: [PATCH] Improve manual model uploading example --- examples/reporting/model_reporting.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/reporting/model_reporting.py b/examples/reporting/model_reporting.py index 5a177c03..2000caab 100644 --- a/examples/reporting/model_reporting.py +++ b/examples/reporting/model_reporting.py @@ -7,10 +7,15 @@ task = Task.init(project_name="examples", task_name="Model reporting example") # Create output model and connect it to the task output_model = OutputModel(task=task) +# Optional: add labels to the model, so we do not forget labels = {"background": 0, "cat": 1, "dog": 2} output_model.update_labels(labels) -model_url = "https://allegro-examples.s3.amazonaws.com/clearml-public-resources/v1.0/clearml-examples-open/newexamples/examples/pytorch%20lightning%20mnist%20example.fb969db720e241e5859d522aa5226b81/models/training.pt" - -# Manually log a model file, which will have the labels connected above +# Register an already existing Model file somewhere +model_url = "https://github.com/ultralytics/yolov5/releases/download/v6.2/yolov5x6.pt" output_model.update_weights(register_uri=model_url) + +# Or upload a local model file to be later used +# output_model.update_weights(weights_filename="/path/to/file.onnx") + +print("Model registration completed")