{"id":13653503,"url":"https://github.com/JunweiLiang/social-distancing-prediction","last_synced_at":"2025-04-23T06:31:42.531Z","repository":{"id":41384693,"uuid":"253086544","full_name":"JunweiLiang/social-distancing-prediction","owner":"JunweiLiang","description":"Out-of-the-box code and models for social distancing early forecasting.","archived":false,"fork":false,"pushed_at":"2023-04-06T05:06:00.000Z","size":106168,"stargazers_count":42,"open_issues_count":0,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T18:54:51.953Z","etag":null,"topics":["activity-prediction","object-tracking","social-distancing","trajectory-prediction"],"latest_commit_sha":null,"homepage":"https://medium.com/@junweil/social-distancing-early-forecasting-system-60186baa67f5","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JunweiLiang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-04-04T19:50:35.000Z","updated_at":"2024-10-22T06:38:01.000Z","dependencies_parsed_at":"2024-02-09T16:14:03.250Z","dependency_job_id":null,"html_url":"https://github.com/JunweiLiang/social-distancing-prediction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JunweiLiang%2Fsocial-distancing-prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JunweiLiang%2Fsocial-distancing-prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JunweiLiang%2Fsocial-distancing-prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JunweiLiang%2Fsocial-distancing-prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JunweiLiang","download_url":"https://codeload.github.com/JunweiLiang/social-distancing-prediction/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250385128,"owners_count":21421859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activity-prediction","object-tracking","social-distancing","trajectory-prediction"],"created_at":"2024-08-02T02:01:11.602Z","updated_at":"2025-04-23T06:31:42.490Z","avatar_url":"https://github.com/JunweiLiang.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Social Distancing Early Forecasting System\n\nOut-of-the-box code base for social distancing early forecasting. Given a video, this code will give out a warning if the system predicts that people will violate social distancing (getting closer with each other than 6 feet) in the next 5 seconds. This early warnings could help stop people before they are actually at risk of getting infected. See this [blog](https://medium.com/@junweil/social-distancing-early-forecasting-system-60186baa67f5).\n\nKeep social distancing (about 6 feet) and [save lives](https://www.cdc.gov/)!\n\nBelow we show an example of the system output. If potential risks are detected, trajectory predictions are shown and warnings are printed near the person.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cdiv style=\"\"\u003e\n      \u003cimg src=\"images/VIRAT_S_000008.short.crop.gif\" width=\"600px\" /\u003e\n  \u003c/div\u003e\n  \u003cbr/\u003e\n\u003c/div\u003e\n\n\n## Dependencies\n+ Python 2/3; TensorFlow-GPU==1.15.2; cv2; tqdm; scipy; sklearn; matplotlib; ffmpeg\n\n## Usage\n### Step 1: Download models and a test video\nAssuming you run the code at the top level of this repository. Model size is about 468MB and the test video is about 7MB.\n```\nbash scripts/download_models.sh\nbash scripts/download_test_video.sh\n```\n\n### Step 2: Run inferencing\n```\npython code/inference/main.py test/test_videos.lst test/output --pred_vis_path test/visualization\n```\n\n### Step 3: Make a video\n```\ncd test/visualization\nffmpeg -framerate 30.0 -i test_video/test_video_F_%08d.jpg test_video.mp4\n```\n\n## Speed\nMy limited tests show that on a RTX 2060 (6GB memory) the processing time is 2x real-time, which means a one-minute 1920x1080 video will take 2 minute to process.\nOn a GTX 1080 TI it is about 1x real-time.\nReducing input resolution will significantly decrease the processing time.\nThe visualization is slow since it writes tons of images to the disk.\n\n## Acknowledgments\nThis project is based on [CMU's Object Detection and Tracking](https://github.com/JunweiLiang/Object_Detection_Tracking) and the following papers.\nIf you find this code useful then please cite:\n```\n@inproceedings{liang2019peeking,\n  title={Peeking into the future: Predicting future person activities and locations in videos},\n  author={Liang, Junwei and Jiang, Lu and Niebles, Juan Carlos and Hauptmann, Alexander G and Fei-Fei, Li},\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n  pages={5725--5734},\n  year={2019}\n}\n@inproceedings{liang2020garden,\n  title={The Garden of Forking Paths: Towards Multi-Future Trajectory Prediction},\n  author={Junwei Liang and Lu Jiang and Kevin Murphy and Ting Yu and Alexander Hauptmann},\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n  year={2020}\n}\n```\n\n## More Examples\n\u003cdiv align=\"center\"\u003e\n  \u003cdiv style=\"\"\u003e\n      \u003cimg src=\"images/VIRAT_S_040104_04_000854_000934.crop.gif\" width=\"600px\" /\u003e\n  \u003c/div\u003e\n  \u003cbr/\u003e\n  \u003cdiv style=\"\"\u003e\n      \u003cimg src=\"images/VIRAT_S_000201_05_001081_001215.crop.gif\" width=\"600px\" /\u003e\n  \u003c/div\u003e\n  \u003cbr/\u003e\n  \u003cdiv style=\"\"\u003e\n      \u003cimg src=\"images/VIRAT_S_040104_01_000227_000457.crop.gif\" width=\"500px\" /\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJunweiLiang%2Fsocial-distancing-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJunweiLiang%2Fsocial-distancing-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJunweiLiang%2Fsocial-distancing-prediction/lists"}