From 8c0ac3c0c548c2260cc37530f482fa20cf710492 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 18 May 2021 10:33:15 +0200 Subject: [PATCH] Better GitHub workflow (#59) * Update tests.yml * Renamed test images * Corrected test * Fixed README * Better images names --- .github/workflows/tests.yml | 15 ++++++++++++++- README.md | 18 +++++++++--------- docs/{out_000840.jpg => out_test_000840.jpg} | Bin ...40_multi.jpg => out_test_000840_multi.jpg} | Bin ...ulti.jpg => out_test_002282.png.multi.jpg} | Bin ....jpg => out_test_002282.png.multi_all.jpg} | Bin ..._pifpaf.jpg => out_test_002282_pifpaf.jpg} | Bin ....jpg => out_test_frame0032_front_bird.jpg} | Bin docs/{000840.png => test_000840.png} | Bin ...000840_right.png => test_000840_right.png} | Bin docs/{002282.png => test_002282.png} | Bin docs/{frame0032.jpg => test_frame0032.jpg} | Bin tests/test_train_mono.py | 12 ++++++------ tests/test_train_stereo.py | 4 ++-- 14 files changed, 31 insertions(+), 18 deletions(-) rename docs/{out_000840.jpg => out_test_000840.jpg} (100%) rename docs/{out_000840_multi.jpg => out_test_000840_multi.jpg} (100%) rename docs/{out_002282.png.multi.jpg => out_test_002282.png.multi.jpg} (100%) rename docs/{out_002282.png.multi_all.jpg => out_test_002282.png.multi_all.jpg} (100%) rename docs/{out_002282_pifpaf.jpg => out_test_002282_pifpaf.jpg} (100%) rename docs/{out_frame0032_front_bird.jpg => out_test_frame0032_front_bird.jpg} (100%) rename docs/{000840.png => test_000840.png} (100%) mode change 100755 => 100644 rename docs/{000840_right.png => test_000840_right.png} (100%) mode change 100755 => 100644 rename docs/{002282.png => test_002282.png} (100%) mode change 100755 => 100644 rename docs/{frame0032.jpg => test_frame0032.jpg} (100%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8dd34fc..9ea76d3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: diff --git a/README.md b/README.md index ca43481..f91f386 100644 --- a/README.md +++ b/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
__[Article](https://arxiv.org/abs/2008.10913)__                 __[Citation](#Citation)__                 __[Video](https://www.youtube.com/watch?v=pGssROjckHU)__ - + --- @@ -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 \ --long-edge --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**
@@ -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**
An example from the Collective Activity Dataset is provided below. - + 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 ``` - + ## C) Hand-raising detection To detect raised hand, you can add the argument `--activities raise_hand` to the prediction command. diff --git a/docs/out_000840.jpg b/docs/out_test_000840.jpg similarity index 100% rename from docs/out_000840.jpg rename to docs/out_test_000840.jpg diff --git a/docs/out_000840_multi.jpg b/docs/out_test_000840_multi.jpg similarity index 100% rename from docs/out_000840_multi.jpg rename to docs/out_test_000840_multi.jpg diff --git a/docs/out_002282.png.multi.jpg b/docs/out_test_002282.png.multi.jpg similarity index 100% rename from docs/out_002282.png.multi.jpg rename to docs/out_test_002282.png.multi.jpg diff --git a/docs/out_002282.png.multi_all.jpg b/docs/out_test_002282.png.multi_all.jpg similarity index 100% rename from docs/out_002282.png.multi_all.jpg rename to docs/out_test_002282.png.multi_all.jpg diff --git a/docs/out_002282_pifpaf.jpg b/docs/out_test_002282_pifpaf.jpg similarity index 100% rename from docs/out_002282_pifpaf.jpg rename to docs/out_test_002282_pifpaf.jpg diff --git a/docs/out_frame0032_front_bird.jpg b/docs/out_test_frame0032_front_bird.jpg similarity index 100% rename from docs/out_frame0032_front_bird.jpg rename to docs/out_test_frame0032_front_bird.jpg diff --git a/docs/000840.png b/docs/test_000840.png old mode 100755 new mode 100644 similarity index 100% rename from docs/000840.png rename to docs/test_000840.png diff --git a/docs/000840_right.png b/docs/test_000840_right.png old mode 100755 new mode 100644 similarity index 100% rename from docs/000840_right.png rename to docs/test_000840_right.png diff --git a/docs/002282.png b/docs/test_002282.png old mode 100755 new mode 100644 similarity index 100% rename from docs/002282.png rename to docs/test_002282.png diff --git a/docs/frame0032.jpg b/docs/test_frame0032.jpg similarity index 100% rename from docs/frame0032.jpg rename to docs/test_frame0032.jpg diff --git a/tests/test_train_mono.py b/tests/test_train_mono.py index af08a10..0e9f309 100644 --- a/tests/test_train_mono.py +++ b/tests/test_train_mono.py @@ -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) diff --git a/tests/test_train_stereo.py b/tests/test_train_stereo.py index 9f0bf2f..d3b196f 100644 --- a/tests/test_train_stereo.py +++ b/tests/test_train_stereo.py @@ -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)