Skip to content

Commit

Permalink
Merge pull request #61 from savan77/feat-cvat
Browse files Browse the repository at this point in the history
docs: corrected listing on adding custom model page
  • Loading branch information
rushtehrani committed Aug 24, 2020
2 parents 661d0fb + c1d12ff commit 199d5f6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Now, let's see if DETR has main script which takes user inputs and runs training

**If your code supports one of the dataset format that CVAT can export into, then we have to modify only two things: input and output paths.**

### Input paths
### a. Input paths
Since we will be mounting dataset at a fixed location (i.e `/mnt/data/datasets/`), you can hard-code this path in your code. Moreover, we also need to look at directory structure inside this directory. Since our code accepts data in COCO format, let's export data from CVAT in MS COCO format and take a look at it's directory structure.

![COCO Directory Structure](/img/coco_dir.png)
Expand Down Expand Up @@ -92,7 +92,7 @@ def update_img_paths(args):

Once this is done. We are good to go. We can now go ahead and create Onepanel Workflow. This can be used from CVAT or can be executed directly.

### Output path
### b. Output path

If we want Onepanel Workflows to store outputs on cloud storage, we can just write output to `/mnt/output/` and it will automatically upload outputs onto cloud storage. For this to work, we just need to add output artifact in our template as discussed in the following section.

Expand Down Expand Up @@ -244,7 +244,7 @@ volumeClaimTemplates:

Even though this looks cryptic, it isn't. Let us go through following three steps to create template for DETR.

### Update workflow parameters
### a. Update workflow parameters

The first thing you should do is add/remove parameters from above template. Now, how do you figure out which parameters should we use in there? It's simple. Use arguments/parameters that we take from user plus some system related parameter (optional). Some examples of this is `epochs`, `batch_size`, etc. Again, this depends on your code as well. In this case, our `main.py` accepts all those hyperparameters as an argument. If your code didn't have such an argument parser, then you can pass all hyperparameters, as shown above for `hyperparameters` parameter, and parse it in your code.

Expand Down Expand Up @@ -338,7 +338,7 @@ arguments:
value: '1'
visibility: public
```
### 1 - Update container block
### b. Update container block

Now, let's take a look at the second block of a base template.

Expand Down Expand Up @@ -473,7 +473,7 @@ We also attached some input and output artifacts. For inputs, we had training da

Also notice that we selected a node with machine that user specified through parameter `sys-node-pool`. What we are essentially doing here is that we are using PyTorch container on this machine, attaching input artifacts (i.e training data), and running commands that perform required tasks (i.e training a model).

### Update volume claims
### c. Update volume claims

Now, let's take a look at the final block.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ Please note that number of classes will be automatically populated if you have `

- Note that num_clones is 4 because there are 4 GPUs available.

## Choosing the right base model
### Choosing the right base model

- We currently support several faster-rcnn models. All of these models are similar except that of the backbone used for the feature extraction. The backbones used are, in increasing order of complexity (i.e more layers), ResNet50, ResNet101, InceptionResNetV2. As the model complexity increases the computation requirement will also increase. If you have very complicated data (i.e hundreds of annotations in one image), then it is recommended that you choose complex model (i.e InceptionResNetV2).

- Faster-rcnn models are generally more accurate than ssd models. However, sometimes you are better off using ssd models if your data is easy to learn (i.e 1 or 2 bounding box per image).

### frcnn-nas-coco:
#### frcnn-nas-coco:

- If you are using `frcnn-nas-coco`, then please choose a machine with at least 2 GPUs as this model requires more memory. A machine with 1 GPU will throw an error.

Expand All @@ -70,7 +70,7 @@ Please note that current implementation of faster-rcnn inTensorFlow Object Detec
***Defaults***: batch_size: 1, learning_rate: 0.0003, epochs=10000


### frcnn-res101-coco:
#### frcnn-res101-coco:

This is a type of faster-rcnn model with ResNet101 backbone. If you are not sure about which model to use then we recommend you use SSD based model (i.e ssd-mobilenet-v2).

Expand All @@ -81,7 +81,7 @@ Please note that current implementation of faster-rcnn inTensorFlow Object Detec

***Defaults***: batch_size: 1, learning_rate: 0.0003, epochs=10000

### frcnn-res101-lowp
#### frcnn-res101-lowp

This is a type of faster-rcnn model with ResNet101 backbone with low number of proposals. If you are not sure about which model to use then we recommend you use SSD based model (i.e ssd-mobilenet-v2). If you are looking for more complex and accurate model then check out frcnn-res101-coco or frcnn-inc-resv2-atr-coco.

Expand All @@ -92,7 +92,7 @@ Please note that current implementation of faster-rcnn inTensorFlow Object Detec
***Defaults***: batch_size: 1, learning_rate: 0.0003, epochs=10000


### frcnn-res50-coco
#### frcnn-res50-coco

This is a type of faster-rcnn model with ResNet50 backbone. If you are not sure about which model to use then we recommend you use SSD based model (i.e ssd-mobilenet-v2). If you are looking for more complex and accurate model then check out frcnn-res101-coco or frcnn-inc-resv2-atr-coco.

Expand All @@ -102,10 +102,7 @@ Please note that current implementation of faster-rcnn inTensorFlow Object Detec

***Defaults***: batch_size: 1, learning_rate: 0.0003, epochs=10000




### ssd-mobilenet-v2-coco:
#### ssd-mobilenet-v2-coco

SSD-based networks such as `ssd-mobilenet-v2` are faster than faster-rcnn based models. However, they are not as accurate as faster-rcnn based models. This model is generally recommended since its accurate and fast enough. If you don't know much about your data or the complexity of your data, then we recommend you go with this model.

Expand All @@ -115,9 +112,9 @@ This model is a good place to start if you don't have any specific model in mind

Depending upon your data, you can set epochs to train your model. There is no standard value which can work for all datasets. You generally have to try different number of epochs to get the best model. Ideally, you do so by monitoring loss of your model while training. But if you are looking for a recommendation. Then, we recommend you set epochs as follows: (number of images / batch_size (default: 24)) * 1000. For instance, if you have 100 images, then your epochs will be 4000 (rounded). Please note that the model will be trained using a pre-trained model, so you don't need to train as long as you would have to when not using the pre-trained model.

***Defaults***: batch_size: 24, learning_rate: 0.004, epochs=15000

***Defaults***: batch_size: 24, learning_rate: 0.004, epochs=10000

Please note that same instructions apply for ssd-mobilenet-v1 and ssd-mobilenetlite. The only difference is the backbone model (i.e mobilenet v1) that they use.


## Training MaskRCNN model through CVAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For this quick start, we'll setup CVAT on Onepanel, annotate some images, train

## 1. Setting up CVAT

### Creating CVAT workspace
### a. Creating CVAT workspace

To launch CVAT, click on Workspaces, and you will find Create Workspace button as shown below.

Expand All @@ -24,15 +24,15 @@ Now, select CVAT, machine type, you can also modify other parameters such as dis
Please note that the default CVAT workspace comes with a filesyncer which syncs data with your cloud provider. If the directory you will be syncing is large, make sure you allocate appropriate disk size for `share` mount.
:::

### Using filesyncer with CVAT
### b. Using filesyncer with CVAT (optional)

The default CVAT workspace comes with a file syncer which syncs local directory (`/mnt/share`) with directory on your cloud provider. You should not change the directory on local machine since CVAT reads data from that directory. However, you can specify directory on your cloud provider (i.e S3). In other words, you can use data available in that directory on cloud storage directly in CVAT (i.e Connected file storage).

File syncer downloads all data from cloud storage to local directory from where CVAT reads the data. By default, this directory on cloud storage is `workflow-data`. We recommend you don't change this directory. But if required, you can change this directory by modifying default directory name while creating CVAT workspace as shown below.

![CVAT sync directory](/img/sync_dir.png)

### CVAT super user and environment variables (optional)
### c. CVAT super user and environment variables (optional)

CVAT requires super user permission to perform certain tasks. Onepanel automatically creates a superuser when you execute CVAT workspace. Your username will be `admin` and password will be onepanel token. Please note that you generated auth token for Onepanel while setting up the Onepanel. [See step #9](/docs/getting-started/quickstart#step-1-install-onepanel) of installation guide.

Expand All @@ -50,7 +50,7 @@ Now, you can give this task a name you like. Then, labels that you are intereste
If you want to use data from your cloud storage while creating a new task, you can select `Connected file share` while creating new task. It will show all the files from `workflow-data` (by default) directory on cloud storage.
![Create task from shared storage](/img/create_new_task_shared.PNG)

### Manual annotation
### a. Manual annotation

Once you have created a new task, you can start annotating your data. CVAT supports points, box, polylines, polygons for annotation. So, the first thing you should do is go to left sidebar and select the type of annotation you want as shown below.

Expand Down

0 comments on commit 199d5f6

Please sign in to comment.