diff --git a/monstereo/activity.py b/monstereo/activity.py index 204e35a..2a343fb 100644 --- a/monstereo/activity.py +++ b/monstereo/activity.py @@ -201,8 +201,8 @@ def predict(args): boxes, keypoints = preprocess_pifpaf(annotations, im_size, enlarge_boxes=False) dic_out = monoloco.forward(keypoints, kk) dic_out = monoloco.post_process(dic_out, boxes, keypoints, kk, dic_gt, reorder=False) - # Print - show_social(args, image_t, output_path, annotations, dic_out) + if args.social_distance: + show_social(args, image, output_path, annotations, dic_out) print('Image {}\n'.format(cnt) + '-' * 120) cnt += 1 diff --git a/monstereo/predict.py b/monstereo/predict.py index eee17ca..11976e3 100644 --- a/monstereo/predict.py +++ b/monstereo/predict.py @@ -17,9 +17,10 @@ from openpifpaf.predict import processor_factory, preprocess_factory from openpifpaf import decoder, network, visualizer, show from .visuals.printer import Printer -from .visuals.pifpaf_show import KeypointPainter, image_canvas -from .network import PifPaf, ImageList, Loco +from .visuals.pifpaf_show import KeypointPainter +from .network import Loco from .network.process import factory_for_gt, preprocess_pifpaf +from .activity import show_social LOG = logging.getLogger(__name__) @@ -132,7 +133,10 @@ def predict(args): if args.net == 'monoloco_pp': print("Prediction with MonoLoco++") dic_out = net.forward(keypoints, kk) - dic_out = net.post_process(dic_out, boxes, keypoints, kk, dic_gt) + reorder = False if args.social_distance else True + dic_out = net.post_process(dic_out, boxes, keypoints, kk, dic_gt, reorder=reorder) + if args.social_distance: + show_social(args, cpu_image, output_path, pifpaf_out, dic_out) else: print("Prediction with MonStereo") diff --git a/monstereo/run.py b/monstereo/run.py index d2ab60e..3ae3862 100644 --- a/monstereo/run.py +++ b/monstereo/run.py @@ -59,8 +59,7 @@ def cli(): predict_parser.add_argument('--show_all', help='only predict ground-truth matches or all', action='store_true') # Social distancing and social interactions - predict_parser.add_argument('--social', help='social', action='store_true') - predict_parser.add_argument('--activity', help='activity', action='store_true') + predict_parser.add_argument('--social_distance', help='social', action='store_true') predict_parser.add_argument('--json_dir', help='for social') predict_parser.add_argument('--threshold_prob', type=float, help='concordance for samples', default=0.25) predict_parser.add_argument('--threshold_dist', type=float, help='min distance of people', default=2) @@ -117,10 +116,7 @@ def cli(): def main(): args = cli() if args.command == 'predict': - if args.activity: - from .activity import predict - else: - from .predict import predict + from .predict import predict predict(args) elif args.command == 'prep': diff --git a/setup.py b/setup.py index 4a724e7..6d974de 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,8 @@ setup( 'monstereo.utils' ], license='GNU AGPLv3', - description='MonStereo: When Monocular and Stereo Meet at the Tail of 3D Human Localization', + description=' Perceiving Humans: from Monocular 3D Localization to Social Distancing ' + '/ MonStereo: When Monocular and Stereo Meet at the Tail of 3D Human Localization', long_description=open('README.md').read(), long_description_content_type='text/markdown', author='Lorenzo Bertoni',