Better GitHub workflow (#59)

* Update tests.yml

* Renamed test images

* Corrected test

* Fixed README

* Better images names
This commit is contained in:
Charles Beauville 2021-05-18 10:33:15 +02:00 committed by GitHub
parent 9254d15e8e
commit 8c0ac3c0c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 31 additions and 18 deletions

View File

@ -5,7 +5,20 @@
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:
build:

View File

@ -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 />
__[Article](https://arxiv.org/abs/2008.10913)__ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; __[Citation](#Citation)__ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; __[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:
```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 \
-o <output directory> \
--long-edge <rescale the image by providing dimension of long side>
--n_dropout <50 to include epistemic uncertainty, 0 otherwise>
```
![predict](docs/out_002282.png.multi.jpg)
![predict](docs/out_test_002282.png.multi.jpg)
To show all the instances estimated by MonoLoco add the argument `--show_all` to the above command.
![predict_all](docs/out_002282.png.multi_all.jpg)
![predict_all](docs/out_test_002282.png.multi_all.jpg)
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
and can be checked with `python -m monoloco.run predict --help`.
![predict](docs/out_002282_pifpaf.jpg)
![predict](docs/out_test_002282_pifpaf.jpg)
**Stereo Examples** <br />
@ -161,7 +161,7 @@ python3 -m monoloco.run predict --mode stereo \
-o data/output -long_edge 2500
```
![Crowded scene](docs/out_000840_multi.jpg)
![Crowded scene](docs/out_test_000840_multi.jpg)
```sh
python3 -m monoloco.run predict --glob docs/005523*.png \ --output_types multi \
@ -183,7 +183,7 @@ For more info, run:
**Examples** <br>
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:
@ -192,11 +192,11 @@ pip install scipy
```
```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
```
<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
To detect raised hand, you can add the argument `--activities raise_hand` to the prediction command.

View File

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 197 KiB

View File

Before

Width:  |  Height:  |  Size: 633 KiB

After

Width:  |  Height:  |  Size: 633 KiB

View File

Before

Width:  |  Height:  |  Size: 398 KiB

After

Width:  |  Height:  |  Size: 398 KiB

View File

Before

Width:  |  Height:  |  Size: 411 KiB

After

Width:  |  Height:  |  Size: 411 KiB

View File

Before

Width:  |  Height:  |  Size: 193 KiB

After

Width:  |  Height:  |  Size: 193 KiB

View File

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 138 KiB

0
docs/000840.png → docs/test_000840.png Executable file → Normal file
View 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
View 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
View File

Before

Width:  |  Height:  |  Size: 831 KiB

After

Width:  |  Height:  |  Size: 831 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -24,7 +24,7 @@ TRAIN_COMMAND = [
PREDICT_COMMAND = [
'python3', '-m', 'monoloco.run',
'predict',
'docs/002282.png',
'docs/test_002282.png',
'--output_types', 'multi', 'json',
'--decoder-workers=0' # for windows
]
@ -32,7 +32,7 @@ PREDICT_COMMAND = [
PREDICT_COMMAND_SOCIAL_DISTANCE = [
'python3', '-m', 'monoloco.run',
'predict',
'docs/frame0032.jpg',
'docs/test_frame0032.jpg',
'--activities', 'social_distance',
'--output_types', 'front', 'bird',
'--decoder-workers=0' # for windows'
@ -64,8 +64,8 @@ def test_train_mono(tmp_path):
print(' '.join(predict_cmd))
subprocess.run(predict_cmd, check=True, capture_output=True)
print(os.listdir(tmp_path))
assert 'out_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.multi.png' in os.listdir(tmp_path)
assert 'out_test_002282.png.monoloco.json' in os.listdir(tmp_path)
predict_cmd_sd = PREDICT_COMMAND_SOCIAL_DISTANCE + [
'--model={}'.format(model),
@ -75,5 +75,5 @@ def test_train_mono(tmp_path):
print(' '.join(predict_cmd_sd))
subprocess.run(predict_cmd_sd, check=True, capture_output=True)
print(os.listdir(tmp_path))
assert 'out_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.front.png' in os.listdir(tmp_path)
assert 'out_test_frame0032.jpg.bird.png' in os.listdir(tmp_path)

View File

@ -26,7 +26,7 @@ PREDICT_COMMAND = [
'python3', '-m', 'monoloco.run',
'predict',
'--mode=stereo',
'--glob', 'docs/000840*.png',
'--glob', 'docs/test_000840*.png',
'--output_types', 'multi', 'json',
'--decoder-workers=0', # for windows'
]
@ -56,4 +56,4 @@ def test_train_stereo(tmp_path):
print(' '.join(predict_cmd))
subprocess.run(predict_cmd, check=True, capture_output=True)
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)