Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added roboflow example #855

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

robertgshaw2-neuralmagic
Copy link
Contributor

No description provided.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB


Download the dataset. Your $DATASET_URL should look something like `neural-magic/soccer-player-detection-gjrbw/2`.
```bash
!roboflow download $DATASET_URL --format yolov5pytorch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!roboflow download $DATASET_URL --format yolov5pytorch
roboflow download $DATASET_URL --format yolov5pytorch

dbogunowicz
dbogunowicz previously approved these changes Jan 11, 2023
Copy link
Contributor

@dbogunowicz dbogunowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (from the logging code side, I did not dive deep into the technicalities of RoboFlow API). I would clean up the jupyter notebook though (a lot of ugly prints there)

5. Re-deploy the newly trained YOLOv5-s model with DeepSparse

Run the following to install the packages needed for the Tutorial. We recommend you
use a virtual enviornment with Python.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use a virtual enviornment with Python.
use a virtual environment with Python.

This should be an em dash without spaces.
Copy link
Contributor

@Beth-Kosis Beth-Kosis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 64: Is ORT commonly known? If not, the acronym should be spelled out.

Lines 209-210: Something seems to be missing in the second part of this sentence. But, I can't figure it out. Is it really saying, "...passing the arguments to the constructor" the local path part as a qualifier?
In the loggers section, we declare the RoboflowLogger, passing a local path its definition in roboflow-logger.py the arguments to the constructor (dataset_name and api_key).


## **What Is Continual Learning?**

The distribution of the incoming data to your production model will vary over time as the enviornment evolves. For example input images to a YOLOv5 model will look very different on a sunny day versus on a rainy day.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The distribution of the incoming data to your production model will vary over time as the enviornment evolves. For example input images to a YOLOv5 model will look very different on a sunny day versus on a rainy day.
The distribution of the incoming data to your production model will vary over time as the environment evolves. For example, input images to a YOLOv5 model will look very different on a sunny day versus on a rainy day.


## **Tutorial Overview**

This example will demonstrate how to setup a Continual Learning system with Neural Magic and Roboflow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This example will demonstrate how to setup a Continual Learning system with Neural Magic and Roboflow
This example will demonstrate how to set up a Continual Learning system with Neural Magic and Roboflow

to train YOLOv5-s to detect soccer players in video clips.

There are 5 steps:
1. Deploy a YOLOv5-s model trained on COCO with DeepSparse
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Deploy a YOLOv5-s model trained on COCO with DeepSparse
1. Deploy a YOLOv5-s model trained on COCO with DeepSparse.


There are 5 steps:
1. Deploy a YOLOv5-s model trained on COCO with DeepSparse
2. Log raw images from production to Roboflow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Log raw images from production to Roboflow
2. Log raw images from production to Roboflow.

There are 5 steps:
1. Deploy a YOLOv5-s model trained on COCO with DeepSparse
2. Log raw images from production to Roboflow
3. Label images with Roboflow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Label images with Roboflow
3. Label images with Roboflow.


## **Step 5: Redeploy the New Model**

We will create a new configuration file for the server which contains two endpoints - one with the sparse YOLOv5s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We will create a new configuration file for the server which contains two endpoints - one with the sparse YOLOv5s
We will create a new configuration file for the Server which contains two endpointsone with the sparse YOLOv5s

trained on COCO and the sparse YOLOv5s fine-tuned on the production data.

Note that we provided a `last.onnx` file (which we trained in the manner described above) in the `server` directory.
You can swap a path to your ONNX file if desired.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can swap a path to your ONNX file if desired.
You can swap a path to your ONNX file, if desired.


You have successfully created a data flywheel for continual learning with DeepSparse and Roboflow!

**Interested In Deploying DeepSparse To Production? [Start your 90 day free trial!](https://neuralmagic.com/deepsparse-free-trial/)**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Interested In Deploying DeepSparse To Production? [Start your 90 day free trial!](https://neuralmagic.com/deepsparse-free-trial/)**
**Interested in deploying DeepSparse to production? [Start your 90 day free trial!](https://neuralmagic.com/deepsparse-free-trial/)**


#### **Send Request to the Server**

Now that the model endpoint is running, we can send raw images over HTTP and recieve back
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Now that the model endpoint is running, we can send raw images over HTTP and recieve back
Now that the model endpoint is running, we can send raw images over HTTP and receive back

### **Train a Sparse YOLOv5 with SparseML**

SparseML is an open-source optimization library which allows you to create sparse models trained on your dataset. One of the workflows enabled by
SparseML is called Sparse Transfer Learning, which is similiar to typical transfer learning, except
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SparseML is called Sparse Transfer Learning, which is similiar to typical transfer learning, except
SparseML is called Sparse Transfer Learning, which is similar to typical transfer learning, except

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants