Skip to content

Commit e662fcb

Browse files
authored
Merge pull request #5 from oracle-devrel/livelabs
Livelabs QA
2 parents 2870b74 + f5a1d4b commit e662fcb

File tree

12 files changed

+114
-45
lines changed

12 files changed

+114
-45
lines changed

mask_detection_training/augment_train/augment_train.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22

33
Estimated Time: 40 minutes
44

5+
## Introduction
6+
7+
In this section, we're going to learn about the benefits of augmenting datasets, the different ways in which this can be achieved; and how to properly train a model using on-demand infrastructure (with Oracle Cloud Infrastructure).
8+
9+
10+
### Prerequisites
11+
12+
* It's highly recommended to have completed [the first workshop](../../workshops/mask_detection_labeling/index.html) before starting to do this one, as we'll use some files and datasets that come from our work in the first workshop.
13+
14+
* An [Oracle Free Tier, Paid or LiveLabs Cloud Account](https://signup.cloud.oracle.com/?language=en&sourceType=:ow:de:ce::::RC_WWMK220210P00063:LoL_handsonLab_introduction&intcmp=:ow:de:ce::::RC_WWMK220210P00063:LoL_handsonLab_introduction)
15+
* Active Oracle Cloud Account with available credits to use for Data Science service.
16+
17+
18+
### Objectives
19+
20+
In this lab, you will complete the following steps:
21+
22+
✓ Learn about Data Augmentation
23+
24+
✓ Learn about when data augmentation is necessary, and when it isn't
25+
26+
✓ Learn how to train a Computer Vision model
27+
528
## Task 1: Hyperparameters & Checkpoints
629

730
The most important part of training a model is choosing the right **hyperparameters**. In this section, I'll explain the parameters I usually use, and why these are recommended for this specific problem.
@@ -178,4 +201,4 @@ The model has a notable mAP of **70%**. This is awesome, but this can always be
178201
## Acknowledgements
179202

180203
* **Author** - Nacho Martinez, Data Science Advocate @ Oracle DevRel
181-
* **Last Updated By/Date** - March 10th, 2023
204+
* **Last Updated By/Date** - May 17th, 2023

mask_detection_training/infer/infer.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
Estimated Time: 10 minutes
44

5-
## How can I perform Inference?
5+
## Introduction
6+
7+
You may be asking yourself: how can I perform inference / how can I use my model?
68

79
Note that, since training & augmentation is done, we can spin down our OCI Instance, unless we want to perform real time inference on it.
810

@@ -11,11 +13,30 @@ In my opinion, it's better to use inference on your **local computer**, as this
1113
And now, we have arrived at the last lab of this workshop. This lab will teach you how to use the model in real time.
1214

1315
There are two notable ways to use the model:
14-
- Using the integrated YOLOv5 predictor and processor (beginner level)
16+
- Using the _integrated_ YOLOv5 predictor and processor (beginner level)
1517
- Using your own custom Python code (intermediate-advanced level)
1618

1719
We'll quickly go over both of these methods so you can use which case is better for you.
1820

21+
### Prerequisites
22+
23+
* It's highly recommended to have completed [the first workshop](../../workshops/mask_detection_labeling/index.html) before starting to do this one, as we'll use some files and datasets that come from our work in the first workshop.
24+
25+
* An [Oracle Free Tier, Paid or LiveLabs Cloud Account](https://signup.cloud.oracle.com/?language=en&sourceType=:ow:de:ce::::RC_WWMK220210P00063:LoL_handsonLab_introduction&intcmp=:ow:de:ce::::RC_WWMK220210P00063:LoL_handsonLab_introduction)
26+
* Active Oracle Cloud Account with available credits to use for Data Science service.
27+
28+
29+
### Objectives
30+
31+
In this lab, you will complete the following steps:
32+
33+
✓ Perform the easiest form of inference with YOLOv5
34+
35+
✓ Perform a more advanced form of inference, with custom Python code
36+
37+
38+
39+
1940
## Task 1: Inference with Integrated YOLOv5 (Beginner)
2041

2142
This inference method is the easiest one, as it's already implemented by YOLO, and we just have to invoke it. I highly recommend running inference on your own local computer.
@@ -96,4 +117,4 @@ Stay tuned...
96117
## Acknowledgements
97118

98119
* **Author** - Nacho Martinez, Data Science Advocate @ Oracle DevRel
99-
* **Last Updated By/Date** - March 10th, 2023
120+
* **Last Updated By/Date** - May 17th, 2023

mask_detection_training/infra/infra.md

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,49 @@ Estimated Time: 10 minutes
44

55
## Introduction
66

7-
If you have completed [the first workshop](../../workshops/mask_detection_labeling/index.html), there's no need for you to complete this lab. You can proceed to the next one in this case, as you will have already prepared all the necessary infrastructure to continue with this workshop.
8-
9-
However, if you haven't completed the first workshop before getting here, we need to quickly prepare the infrastructure that we need to manually train our Computer Vision model in this workshop.
7+
If you have completed [the first workshop](../../workshops/mask_detection_labeling/index.html) and you have your own vision model, there's no need for you to complete this section.
8+
However, if you haven't, and don't have your own custom final dataset ready, you can use my dataset to get started. Additionally, we will need to quickly prepare the infrastructure that we need to manually train our Computer Vision model in this workshop.
109

1110
From this infrastructure, we will learn how to do the things that we've done automatically with RoboFlow during *the first* workshop (training, data augmentation), but using 100% open-source code.
1211

1312
The OCI service that we'll use for this is **OCI Compute**.
1413

15-
## Task 1: Create OCI Instance
14+
### Prerequisites
15+
16+
* It's highly recommended to have completed [the first workshop](../../workshops/mask_detection_labeling/index.html) before starting to do this one, as we'll use some files and datasets that come from our work in the first workshop.
17+
18+
* An [Oracle Free Tier, Paid or LiveLabs Cloud Account](https://signup.cloud.oracle.com/?language=en&sourceType=:ow:de:ce::::RC_WWMK220210P00063:LoL_handsonLab_introduction&intcmp=:ow:de:ce::::RC_WWMK220210P00063:LoL_handsonLab_introduction)
19+
* Active Oracle Cloud Account with available credits to use for Data Science service.
20+
21+
22+
### Objectives
23+
24+
In this lab, you will complete the following steps:
25+
26+
✓ Downloading a Computer Vision dataset (if you don't come with your own)
27+
28+
✓ Creating the necessary infrastructure in OCI to train models
29+
30+
✓ Installing Python dependencies effectively
31+
32+
33+
## Task 1: Download Dataset
34+
35+
If you haven't completed the [first workshop](../../workshops/mask_detection_labeling/index.html), then you can use my dataset to get started. For this, go into [the project's RoboFlow Universe URL](https://universe.roboflow.com/jasperan/public-mask-placement/dataset/4):
36+
37+
![access dataset](./images/access_dataset.png)
38+
39+
Once we're on this website, we choose to download the dataset **in YOLOv5 format**:
40+
41+
![click the download button](./images/click_download_button.png)
42+
43+
We unzip it, and make sure that our _`data.yaml`_ file looks like this:
44+
45+
![yaml format](./images/yaml_modified.png)
46+
47+
This file holds all links between our YOLOv5 dataset, so once we have our paths ready and verified that the class names and the number of classes are correct, we can proceed to augment and train this dataset.
48+
49+
## Task 2: Create OCI Instance
1650

1751
First, we'll go into our [OCI Compute panel](https://cloud.oracle.com/compute/instances) and create a new instance. The name of the instance can be anything you want, and you should choose the Availability Domain (AD) depending on your region and the AD's allocated resources (varies over time). I usually go with AD 1, and if I run into any issues, I iterate.
1852

@@ -33,7 +67,7 @@ Finally, we'll let OCI generate a SSH keypair, which we'll use to connect to the
3367

3468
![create instance - step 5](./images/create_instance_5.png)
3569

36-
## Task 2: Access OCI Instance
70+
## Task 3: Access OCI Instance
3771

3872
To access our instance, let's copy the primary IP address that was allocated to our VM once the provisioning of this machine is done.
3973

@@ -76,7 +110,7 @@ Now, just click on "Quick Connect" and connect:
76110

77111
> **Note**: we will connect to our VM and start training / augmenting our data with open-source repositories.
78112
79-
## Task 3: Clone Open-Source Repositories
113+
## Task 4: Clone Open-Source Repositories
80114

81115
Once we have connected to our instance, let's download two repositories: YOLOv5 and YOLOv8. You're free to choose either one of them to train and augment our computer vision models, but this guide will show you how to proceed with YOLOv5.
82116

@@ -92,7 +126,7 @@ git clone https://github.com/ultralytics/ultralytics.git
92126
```
93127
> **Note**: `git` is another tool that's already installed in the custom image we used to spin up our instance. *YOLOv8 can also be installed directly from pip. More information [in this link.](https://github.com/ultralytics/ultralytics#documentation)
94128
95-
## Task 4: Transfer Dataset
129+
## Task 5: Transfer Dataset
96130

97131
Now that we're connected to the machine, let's move the files from our computer to our OCI Compute Instance.
98132

@@ -122,18 +156,20 @@ Use the integrated MobaXterm FTP explorer to transfer files, dropping files from
122156

123157
![transfer to moba ftp](./images/transfer_moba.gif)
124158

125-
## Task 5: Install Python Dependencies
159+
## Task 6: Install Python Dependencies
126160

127161
Once we have the repositories ready, we need to install dependencies that will allow us to run YOLO code:
128162

129-
```console
163+
```
164+
<copy>
130165
cd /home/$USER/yolov5
131166
pip install -r /home/$USER/yolov5/requirements.txt
167+
</copy>
132168
```
133169

134170
Now that we have cloned our repositories, uploaded our dataset, and have our machine and conda environment ready, we're virtually ready to start training. You may now [proceed to the next lab](#next).
135171

136172
## Acknowledgements
137173

138174
* **Author** - Nacho Martinez, Data Science Advocate @ Oracle DevRel
139-
* **Last Updated By/Date** - March 10th, 2023
175+
* **Last Updated By/Date** - May 17th, 2023
Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Introduction
22

3-
## Introduction
4-
53
Estimated Time: 5 minutes
64

5+
6+
## Overview
7+
78
If you remember what we spoke about [in our last workshop](../../workshops/mask_detection_labeling/index.html), we created a Computer Vision model able to recognize whether someone was wearing their COVID-19 mask correctly, incorrectly, or simply didn't wear any mask.
89

910
We used [RoboFlow](https://roboflow.com) as the platform to help us during the creation of the model. It was especially useful to accelerate our data labeling process, as well as gathering data from other Computer Vision folks using [RoboFlow Universe](https://universe.roboflow.com/).
@@ -18,31 +19,14 @@ Additionally, you will learn how to create your own model versions, which parame
1819

1920
### Prerequisites
2021

21-
It's highly recommended to have completed [the first workshop](../../workshops/mask_detection_labeling/index.html) before starting to do this one, as we'll use some files and datasets that come from our work in the first workshop.
22-
23-
### Hardware
24-
25-
To train our YOLO models, we will learn some infrastructure. We will use Oracle Cloud Infrastructure (OCI) to satisfy our needs. We'll talk more about how to create this hardware (in case you haven't completed the [first workshop](../../workshops/mask_detection_labeling/index.html)) in the next lab.
26-
27-
## Task 0: Download Dataset
28-
29-
If you have completed the first workshop, please skip this section.
30-
31-
However, if you haven't completed the [first workshop](../../workshops/mask_detection_labeling/index.html), and have your own custom final dataset ready, you can use my dataset to get started. For this, go into [the project's RoboFlow Universe URL](https://universe.roboflow.com/jasperan/public-mask-placement/dataset/4):
22+
* It's highly recommended to have completed [the first workshop](../../workshops/mask_detection_labeling/index.html) before starting to do this one, as we'll use some files and datasets that come from our work in the first workshop.
3223

33-
![access dataset](./images/access_dataset.png)
24+
* An [Oracle Free Tier, Paid or LiveLabs Cloud Account](https://signup.cloud.oracle.com/?language=en&sourceType=:ow:de:ce::::RC_WWMK220210P00063:LoL_handsonLab_introduction&intcmp=:ow:de:ce::::RC_WWMK220210P00063:LoL_handsonLab_introduction)
25+
* Active Oracle Cloud Account with available credits to use for Data Science service.
3426

35-
Once we're on this website, we choose to download the dataset **in YOLOv5 format**:
3627

37-
![click the download button](./images/click_download_button.png)
3828

39-
We unzip it, and make sure that our _`data.yaml`_ file looks like this:
40-
41-
![yaml format](./images/yaml_modified.png)
42-
43-
This file holds all links between our YOLOv5 dataset, so once we have our paths ready and verified that the class names and the number of classes are correct, we can proceed to augment and train this dataset.
44-
45-
## Task 1: Objectives
29+
### Objectives
4630

4731
In this lab, you will complete the following steps:
4832

@@ -52,14 +36,20 @@ In this lab, you will complete the following steps:
5236

5337
&check; **Use** these models with Python!
5438

55-
## Task 2: OCI Elements
39+
40+
### Hardware
41+
42+
To train our YOLO models, we will learn some infrastructure. We will use Oracle Cloud Infrastructure (OCI) to satisfy our needs. We'll talk more about how to create this hardware (in case you haven't completed the [first workshop](../../workshops/mask_detection_labeling/index.html)) in the next lab.
43+
44+
### OCI Elements
5645

5746
This solution is designed to work mainly with OCI Compute. We will use an OCI Compute Instance to save costs (compared to other Cloud providers) and train our Computer Vision model.
5847

5948
You can read more about the services used in the lab here:
6049
- [OCI Compute](https://www.oracle.com/cloud/compute/)
6150

62-
## Task 3: Useful Resources
51+
52+
### Useful Resources
6353

6454
Here are three articles to get you from beginner to Computer Vision *hero*. This workshop is partly based on the content present in these Medium articles.
6555

@@ -69,9 +59,8 @@ Here are three articles to get you from beginner to Computer Vision *hero*. This
6959

7060
- [YOLOv5 and OCI: Implementing Custom PyTorch Code From Scratch](https://medium.com/oracledevs/yolov5-and-oci-implementing-custom-pytorch-code-from-scratch-7c6b82b0b6b1)
7161

72-
You may now [proceed to the next lab](#next).
7362

7463
## Acknowledgements
7564

7665
* **Author** - Nacho Martinez, Data Science Advocate @ Oracle DevRel
77-
* **Last Updated By/Date** - March 10th, 2023
66+
* **Last Updated By/Date** - May 17th, 2023

workshops/mask_detection_labeling/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{
1212
"title": "Get Started",
1313
"description": "Prerequisites for LiveLabs (Oracle-owned tenancies). The title of the lab and the Contents Menu title (the title above) match for Prerequisite lab. This lab is always first.",
14-
"filename": "https://raw.githubusercontent.com/oracle/learning-library/master/common/labs/cloud-login/cloud-login.md"
14+
"filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login.md"
1515
},
1616
{
1717
"title": "Lab 1: Understand YOLOv5",

workshops/mask_detection_labeling/manifest_full.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{
1212
"title": "Get Started",
1313
"description": "Prerequisites for LiveLabs (Oracle-owned tenancies). The title of the lab and the Contents Menu title (the title above) match for Prerequisite lab. This lab is always first.",
14-
"filename": "https://raw.githubusercontent.com/oracle/learning-library/master/common/labs/cloud-login/cloud-login.md"
14+
"filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login.md"
1515
},
1616
{
1717
"title": "Lab 1: Explore RoboFlow",

0 commit comments

Comments
 (0)