Documentation (#4)

* add documentation

* fix name

* add pifpaf figure
This commit is contained in:
Lorenzo Bertoni 2021-01-07 17:31:38 +01:00 committed by GitHub
parent ecbe4a0849
commit 1aa484200e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 1 deletions

View File

@ -66,6 +66,11 @@ To show all the instances estimated by MonoLoco add the argument `show_all` to t
![predict_all](out_002282.png.multi_all.jpg)
It is also possible to run [openpifpaf](https://github.com/vita-epfl/openpifpaf) directly
by specifying the network with the argument `--net pifpaf`. All pifpaf arguments are supported.
![predict_all](out_002282_pifpaf.jpg)
### Social Distancing
To visualize social distancing compliance, simply add the argument `--social-distance` to the predict command.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 KiB

After

Width:  |  Height:  |  Size: 411 KiB

BIN
docs/out_002282_pifpaf.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

View File

@ -22,6 +22,7 @@ from .activity import show_social
LOG = logging.getLogger(__name__)
OPENPIFPAF_PATH = 'data/models/shufflenetv2k30-201104-224654-cocokp-d75ed641.pkl' # Default model
def factory_from_args(args):
@ -33,7 +34,12 @@ def factory_from_args(args):
# Model
if not args.checkpoint:
args.checkpoint = 'data/models/shufflenetv2k30-201104-224654-cocokp-d75ed641.pkl' # Default model
if os.path.exists(OPENPIFPAF_PATH):
args.checkpoint = OPENPIFPAF_PATH
else:
print("Checkpoint for OpenPifPaf not specified and default model not found in 'data/models'. "
"Using a ShuffleNet backbone")
args.checkpoint = 'shufflenetv2k30'
# Devices
args.device = torch.device('cpu')