You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mask_detection_training/augment_train/augment_train.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,29 @@
2
2
3
3
Estimated Time: 40 minutes
4
4
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
+
5
28
## Task 1: Hyperparameters & Checkpoints
6
29
7
30
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
178
201
## Acknowledgements
179
202
180
203
***Author** - Nacho Martinez, Data Science Advocate @ Oracle DevRel
Copy file name to clipboardExpand all lines: mask_detection_training/infer/infer.md
+24-3Lines changed: 24 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
3
3
Estimated Time: 10 minutes
4
4
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?
6
8
7
9
Note that, since training & augmentation is done, we can spin down our OCI Instance, unless we want to perform real time inference on it.
8
10
@@ -11,11 +13,30 @@ In my opinion, it's better to use inference on your **local computer**, as this
11
13
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.
12
14
13
15
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)
15
17
- Using your own custom Python code (intermediate-advanced level)
16
18
17
19
We'll quickly go over both of these methods so you can use which case is better for you.
18
20
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
+
19
40
## Task 1: Inference with Integrated YOLOv5 (Beginner)
20
41
21
42
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...
96
117
## Acknowledgements
97
118
98
119
***Author** - Nacho Martinez, Data Science Advocate @ Oracle DevRel
Copy file name to clipboardExpand all lines: mask_detection_training/infra/infra.md
+46-10Lines changed: 46 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,49 @@ Estimated Time: 10 minutes
4
4
5
5
## Introduction
6
6
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.
10
9
11
10
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.
12
11
13
12
The OCI service that we'll use for this is **OCI Compute**.
14
13
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
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
+

38
+
39
+
Once we're on this website, we choose to download the dataset **in YOLOv5 format**:
40
+
41
+

42
+
43
+
We unzip it, and make sure that our _`data.yaml`_ file looks like this:
44
+
45
+

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
16
50
17
51
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.
18
52
@@ -33,7 +67,7 @@ Finally, we'll let OCI generate a SSH keypair, which we'll use to connect to the
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.
39
73
@@ -76,7 +110,7 @@ Now, just click on "Quick Connect" and connect:
76
110
77
111
> **Note**: we will connect to our VM and start training / augmenting our data with open-source repositories.
78
112
79
-
## Task 3: Clone Open-Source Repositories
113
+
## Task 4: Clone Open-Source Repositories
80
114
81
115
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.
> **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)
94
128
95
-
## Task 4: Transfer Dataset
129
+
## Task 5: Transfer Dataset
96
130
97
131
Now that we're connected to the machine, let's move the files from our computer to our OCI Compute Instance.
98
132
@@ -122,18 +156,20 @@ Use the integrated MobaXterm FTP explorer to transfer files, dropping files from
122
156
123
157

124
158
125
-
## Task 5: Install Python Dependencies
159
+
## Task 6: Install Python Dependencies
126
160
127
161
Once we have the repositories ready, we need to install dependencies that will allow us to run YOLO code:
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).
135
171
136
172
## Acknowledgements
137
173
138
174
***Author** - Nacho Martinez, Data Science Advocate @ Oracle DevRel
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.
8
9
9
10
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
18
19
19
20
### Prerequisites
20
21
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.
32
23
33
-

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.
34
26
35
-
Once we're on this website, we choose to download the dataset **in YOLOv5 format**:
36
27
37
-

38
28
39
-
We unzip it, and make sure that our _`data.yaml`_ file looks like this:
40
-
41
-

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
46
30
47
31
In this lab, you will complete the following steps:
48
32
@@ -52,14 +36,20 @@ In this lab, you will complete the following steps:
52
36
53
37
✓**Use** these models with Python!
54
38
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
56
45
57
46
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.
58
47
59
48
You can read more about the services used in the lab here:
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.
65
55
@@ -69,9 +59,8 @@ Here are three articles to get you from beginner to Computer Vision *hero*. This
69
59
70
60
-[YOLOv5 and OCI: Implementing Custom PyTorch Code From Scratch](https://medium.com/oracledevs/yolov5-and-oci-implementing-custom-pytorch-code-from-scratch-7c6b82b0b6b1)
71
61
72
-
You may now [proceed to the next lab](#next).
73
62
74
63
## Acknowledgements
75
64
76
65
***Author** - Nacho Martinez, Data Science Advocate @ Oracle DevRel
Copy file name to clipboardExpand all lines: workshops/mask_detection_labeling/manifest.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
{
12
12
"title": "Get Started",
13
13
"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.",
Copy file name to clipboardExpand all lines: workshops/mask_detection_labeling/manifest_full.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
{
12
12
"title": "Get Started",
13
13
"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.",
0 commit comments