@@ -4,49 +4,65 @@ A small command line program to test and run AutoAnnotation Scripts.
4
4
5
5
## Instructions
6
6
7
- Change in to the root of the project directory and run
7
+ There are two modes to run this script in. If you already have a model uploaded into the server, and you're having
8
+ issues with running it in production, you can pass in the model name and a task id that you want to test against.
8
9
9
10
``` shell
10
- $ python cvat/utils/auto_annotation/run_model.py --py /path/to/python/interp.py \
11
- --xml /path/to/xml/file.xml \
12
- --bin /path/to/bin/file.bin \
13
- --json /path/to/json/mapping/mapping.json
11
+ # Note that this module can be found in cvat/utils/auto_annotation/run_model.py
12
+ $ python /path/to/run_model.py --model-name mymodel --task-id 4
13
+ ```
14
+
15
+ If you're running in docker, this can be useful way to debug your model.
16
+
17
+ ``` shell
18
+ $ docker exec -it cvat bash -ic ' python3 ~/cvat/apps/auto_annotation/run_model.py --model-name my-model --task-id 4
19
+ ```
20
+
21
+ If you are developing an auto annotation model or you can' t get something uploaded into the server,
22
+ then you' ll need to specify the individual inputs.
23
+
24
+ ```shell
25
+ # Note that this module can be found in cvat/utils/auto_annotation/run_model.py
26
+ $ python path/to/run_model.py --py /path/to/python/interp.py \
27
+ --xml /path/to/xml/file.xml \
28
+ --bin /path/to/bin/file.bin \
29
+ --json /path/to/json/mapping/mapping.json
14
30
```
15
31
16
32
Some programs need to run unrestricted or as an administer. Use the `--unrestriced` flag to simulate.
17
33
18
34
You can pass image files in to fully simulate your findings. Images are passed in as a list
19
35
20
36
```shell
21
- $ python cvat/utils/auto_annotation /run_model.py --py /path/to/python/interp.py \
22
- --xml /path/to/xml/file.xml \
23
- --bin /path/to/bin/file.bin \
24
- --json /path/to/json/mapping/mapping.json \
25
- --image-files /path/to/img.jpg /path2/to/img2.png /path/to/img3.jpg
37
+ $ python /path/to /run_model.py --py /path/to/python/interp.py \
38
+ --xml /path/to/xml/file.xml \
39
+ --bin /path/to/bin/file.bin \
40
+ --json /path/to/json/mapping/mapping.json \
41
+ --image-files /path/to/img.jpg /path2/to/img2.png /path/to/img3.jpg
26
42
```
27
43
28
44
Additionally, it' s sometimes useful to visualize your images.
29
45
Use the ` --show-images` flag to have each image with the annotations pop up.
30
46
31
47
` ` ` shell
32
- $ python cvat/utils/auto_annotation /run_model.py --py /path/to/python/interp.py \
33
- --xml /path/to/xml/file.xml \
34
- --bin /path/to/bin/file.bin \
35
- --json /path/to/json/mapping/mapping.json \
36
- --image-files /path/to/img.jpg /path2/to/img2.png /path/to/img3.jpg \
37
- --show-images
48
+ $ python /path/to /run_model.py --py /path/to/python/interp.py \
49
+ --xml /path/to/xml/file.xml \
50
+ --bin /path/to/bin/file.bin \
51
+ --json /path/to/json/mapping/mapping.json \
52
+ --image-files /path/to/img.jpg /path2/to/img2.png /path/to/img3.jpg \
53
+ --show-images
38
54
` ` `
39
55
40
56
If you' d like to see the labels printed on the image, use the `--show-labels` flag
41
57
42
58
```shell
43
- $ python cvat/utils/auto_annotation /run_model.py --py /path/to/python/interp.py \
44
- --xml /path/to/xml/file.xml \
45
- --bin /path/to/bin/file.bin \
46
- --json /path/to/json/mapping/mapping.json \
47
- --image-files /path/to/img.jpg /path2/to/img2.png /path/to/img3.jpg \
48
- --show-images \
49
- --show-labels
59
+ $ python /path/to /run_model.py --py /path/to/python/interp.py \
60
+ --xml /path/to/xml/file.xml \
61
+ --bin /path/to/bin/file.bin \
62
+ --json /path/to/json/mapping/mapping.json \
63
+ --image-files /path/to/img.jpg /path2/to/img2.png /path/to/img3.jpg \
64
+ --show-images \
65
+ --show-labels
50
66
```
51
67
52
68
There' s a command that let' s you scan quickly by setting the length of time (in milliseconds) to display each image.
@@ -55,13 +71,13 @@ In this example, 2000 milliseconds is 2 seconds for each image.
55
71
56
72
```shell
57
73
# Display each image in a window for 2 seconds
58
- $ python cvat/utils/auto_annotation /run_model.py --py /path/to/python/interp.py \
59
- --xml /path/to/xml/file.xml \
60
- --bin /path/to/bin/file.bin \
61
- --json /path/to/json/mapping/mapping.json \
62
- --image-files /path/to/img.jpg /path2/to/img2.png /path/to/img3.jpg \
63
- --show-images \
64
- --show-image-delay 2000
74
+ $ python /path/to /run_model.py --py /path/to/python/interp.py \
75
+ --xml /path/to/xml/file.xml \
76
+ --bin /path/to/bin/file.bin \
77
+ --json /path/to/json/mapping/mapping.json \
78
+ --image-files /path/to/img.jpg /path2/to/img2.png /path/to/img3.jpg \
79
+ --show-images \
80
+ --show-image-delay 2000
65
81
```
66
82
67
83
Visualization isn' t always enough.
@@ -70,10 +86,10 @@ You must install the necessary packages installed, but then you can add the `--s
70
86
results will serialize correctly.
71
87
72
88
` ` ` shell
73
- $ python cvat/utils/auto_annotation /run_model.py --py /path/to/python/interp.py \
74
- --xml /path/to/xml/file.xml \
75
- --bin /path/to/bin/file.bin \
76
- --json /path/to/json/mapping/mapping.json \
77
- --image-files /path/to/img.jpg /path2/to/img2.png /path/to/img3.jpg \
78
- --serialize
89
+ $ python /path/to /run_model.py --py /path/to/python/interp.py \
90
+ --xml /path/to/xml/file.xml \
91
+ --bin /path/to/bin/file.bin \
92
+ --json /path/to/json/mapping/mapping.json \
93
+ --image-files /path/to/img.jpg /path2/to/img2.png /path/to/img3.jpg \
94
+ --serialize
79
95
` ` `
0 commit comments