Better GitHub workflow (#59)
* Update tests.yml * Renamed test images * Corrected test * Fixed README * Better images names
15
.github/workflows/tests.yml
vendored
@ -5,7 +5,20 @@
|
|||||||
|
|
||||||
name: Tests
|
name: Tests
|
||||||
|
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'monoloco/**'
|
||||||
|
- 'test/**'
|
||||||
|
- 'docs/test*'
|
||||||
|
- '.github/workflows/tests.yml'
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'monoloco/**'
|
||||||
|
- 'test/**'
|
||||||
|
- 'docs/test*'
|
||||||
|
- '.github/workflows/tests.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
18
README.md
@ -17,7 +17,7 @@ This library is based on three research projects for monocular/stereo 3D human l
|
|||||||
[T. Mordan](https://people.epfl.ch/taylor.mordan/?lang=en), [A. Alahi](https://scholar.google.com/citations?user=UIhXQ64AAAAJ&hl=en)_, ICRA 2021 <br />
|
[T. Mordan](https://people.epfl.ch/taylor.mordan/?lang=en), [A. Alahi](https://scholar.google.com/citations?user=UIhXQ64AAAAJ&hl=en)_, ICRA 2021 <br />
|
||||||
__[Article](https://arxiv.org/abs/2008.10913)__ __[Citation](#Citation)__ __[Video](https://www.youtube.com/watch?v=pGssROjckHU)__
|
__[Article](https://arxiv.org/abs/2008.10913)__ __[Citation](#Citation)__ __[Video](https://www.youtube.com/watch?v=pGssROjckHU)__
|
||||||
|
|
||||||
<img src="docs/out_000840_multi.jpg" width="700"/>
|
<img src="docs/out_test_000840_multi.jpg" width="700"/>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -125,24 +125,24 @@ If you provide a ground-truth json file to compare the predictions of the networ
|
|||||||
For an example image, run the following command:
|
For an example image, run the following command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m monoloco.run predict docs/002282.png \
|
python -m monoloco.run predict docs/test_002282.png \
|
||||||
--path_gt names-kitti-200615-1022.json \
|
--path_gt names-kitti-200615-1022.json \
|
||||||
-o <output directory> \
|
-o <output directory> \
|
||||||
--long-edge <rescale the image by providing dimension of long side>
|
--long-edge <rescale the image by providing dimension of long side>
|
||||||
--n_dropout <50 to include epistemic uncertainty, 0 otherwise>
|
--n_dropout <50 to include epistemic uncertainty, 0 otherwise>
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
To show all the instances estimated by MonoLoco add the argument `--show_all` to the above command.
|
To show all the instances estimated by MonoLoco add the argument `--show_all` to the above command.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
It is also possible to run [openpifpaf](https://github.com/vita-epfl/openpifpaf) directly
|
It is also possible to run [openpifpaf](https://github.com/vita-epfl/openpifpaf) directly
|
||||||
by using `--mode keypoints`. All the other pifpaf arguments are also supported
|
by using `--mode keypoints`. All the other pifpaf arguments are also supported
|
||||||
and can be checked with `python -m monoloco.run predict --help`.
|
and can be checked with `python -m monoloco.run predict --help`.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
**Stereo Examples** <br />
|
**Stereo Examples** <br />
|
||||||
@ -161,7 +161,7 @@ python3 -m monoloco.run predict --mode stereo \
|
|||||||
-o data/output -long_edge 2500
|
-o data/output -long_edge 2500
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python3 -m monoloco.run predict --glob docs/005523*.png \ --output_types multi \
|
python3 -m monoloco.run predict --glob docs/005523*.png \ --output_types multi \
|
||||||
@ -183,7 +183,7 @@ For more info, run:
|
|||||||
**Examples** <br>
|
**Examples** <br>
|
||||||
An example from the Collective Activity Dataset is provided below.
|
An example from the Collective Activity Dataset is provided below.
|
||||||
|
|
||||||
<img src="docs/frame0032.jpg" width="500"/>
|
<img src="docs/test_frame0032.jpg" width="500"/>
|
||||||
|
|
||||||
To visualize social distancing run the below, command:
|
To visualize social distancing run the below, command:
|
||||||
|
|
||||||
@ -192,11 +192,11 @@ pip install scipy
|
|||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m monoloco.run predict docs/frame0032.jpg \
|
python -m monoloco.run predict docs/test_frame0032.jpg \
|
||||||
--activities social_distance --output_types front bird
|
--activities social_distance --output_types front bird
|
||||||
```
|
```
|
||||||
|
|
||||||
<img src="docs/out_frame0032_front_bird.jpg" width="700"/>
|
<img src="docs/out_test_frame0032_front_bird.jpg" width="700"/>
|
||||||
|
|
||||||
## C) Hand-raising detection
|
## C) Hand-raising detection
|
||||||
To detect raised hand, you can add the argument `--activities raise_hand` to the prediction command.
|
To detect raised hand, you can add the argument `--activities raise_hand` to the prediction command.
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 197 KiB After Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 633 KiB After Width: | Height: | Size: 633 KiB |
|
Before Width: | Height: | Size: 398 KiB After Width: | Height: | Size: 398 KiB |
|
Before Width: | Height: | Size: 411 KiB After Width: | Height: | Size: 411 KiB |
|
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB |
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 138 KiB |
0
docs/000840.png → docs/test_000840.png
Executable file → Normal file
|
Before Width: | Height: | Size: 736 KiB After Width: | Height: | Size: 736 KiB |
0
docs/000840_right.png → docs/test_000840_right.png
Executable file → Normal file
|
Before Width: | Height: | Size: 732 KiB After Width: | Height: | Size: 732 KiB |
0
docs/002282.png → docs/test_002282.png
Executable file → Normal file
|
Before Width: | Height: | Size: 831 KiB After Width: | Height: | Size: 831 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
@ -24,7 +24,7 @@ TRAIN_COMMAND = [
|
|||||||
PREDICT_COMMAND = [
|
PREDICT_COMMAND = [
|
||||||
'python3', '-m', 'monoloco.run',
|
'python3', '-m', 'monoloco.run',
|
||||||
'predict',
|
'predict',
|
||||||
'docs/002282.png',
|
'docs/test_002282.png',
|
||||||
'--output_types', 'multi', 'json',
|
'--output_types', 'multi', 'json',
|
||||||
'--decoder-workers=0' # for windows
|
'--decoder-workers=0' # for windows
|
||||||
]
|
]
|
||||||
@ -32,7 +32,7 @@ PREDICT_COMMAND = [
|
|||||||
PREDICT_COMMAND_SOCIAL_DISTANCE = [
|
PREDICT_COMMAND_SOCIAL_DISTANCE = [
|
||||||
'python3', '-m', 'monoloco.run',
|
'python3', '-m', 'monoloco.run',
|
||||||
'predict',
|
'predict',
|
||||||
'docs/frame0032.jpg',
|
'docs/test_frame0032.jpg',
|
||||||
'--activities', 'social_distance',
|
'--activities', 'social_distance',
|
||||||
'--output_types', 'front', 'bird',
|
'--output_types', 'front', 'bird',
|
||||||
'--decoder-workers=0' # for windows'
|
'--decoder-workers=0' # for windows'
|
||||||
@ -64,8 +64,8 @@ def test_train_mono(tmp_path):
|
|||||||
print(' '.join(predict_cmd))
|
print(' '.join(predict_cmd))
|
||||||
subprocess.run(predict_cmd, check=True, capture_output=True)
|
subprocess.run(predict_cmd, check=True, capture_output=True)
|
||||||
print(os.listdir(tmp_path))
|
print(os.listdir(tmp_path))
|
||||||
assert 'out_002282.png.multi.png' in os.listdir(tmp_path)
|
assert 'out_test_002282.png.multi.png' in os.listdir(tmp_path)
|
||||||
assert 'out_002282.png.monoloco.json' in os.listdir(tmp_path)
|
assert 'out_test_002282.png.monoloco.json' in os.listdir(tmp_path)
|
||||||
|
|
||||||
predict_cmd_sd = PREDICT_COMMAND_SOCIAL_DISTANCE + [
|
predict_cmd_sd = PREDICT_COMMAND_SOCIAL_DISTANCE + [
|
||||||
'--model={}'.format(model),
|
'--model={}'.format(model),
|
||||||
@ -75,5 +75,5 @@ def test_train_mono(tmp_path):
|
|||||||
print(' '.join(predict_cmd_sd))
|
print(' '.join(predict_cmd_sd))
|
||||||
subprocess.run(predict_cmd_sd, check=True, capture_output=True)
|
subprocess.run(predict_cmd_sd, check=True, capture_output=True)
|
||||||
print(os.listdir(tmp_path))
|
print(os.listdir(tmp_path))
|
||||||
assert 'out_frame0032.jpg.front.png' in os.listdir(tmp_path)
|
assert 'out_test_frame0032.jpg.front.png' in os.listdir(tmp_path)
|
||||||
assert 'out_frame0032.jpg.bird.png' in os.listdir(tmp_path)
|
assert 'out_test_frame0032.jpg.bird.png' in os.listdir(tmp_path)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ PREDICT_COMMAND = [
|
|||||||
'python3', '-m', 'monoloco.run',
|
'python3', '-m', 'monoloco.run',
|
||||||
'predict',
|
'predict',
|
||||||
'--mode=stereo',
|
'--mode=stereo',
|
||||||
'--glob', 'docs/000840*.png',
|
'--glob', 'docs/test_000840*.png',
|
||||||
'--output_types', 'multi', 'json',
|
'--output_types', 'multi', 'json',
|
||||||
'--decoder-workers=0', # for windows'
|
'--decoder-workers=0', # for windows'
|
||||||
]
|
]
|
||||||
@ -56,4 +56,4 @@ def test_train_stereo(tmp_path):
|
|||||||
print(' '.join(predict_cmd))
|
print(' '.join(predict_cmd))
|
||||||
subprocess.run(predict_cmd, check=True, capture_output=True)
|
subprocess.run(predict_cmd, check=True, capture_output=True)
|
||||||
print(os.listdir(tmp_path))
|
print(os.listdir(tmp_path))
|
||||||
assert 'out_000840.png.multi.png' in os.listdir(tmp_path)
|
assert 'out_test_000840.png.multi.png' in os.listdir(tmp_path)
|
||||||
|
|||||||