{"id":13653522,"url":"https://github.com/agrimgupta92/sgan","last_synced_at":"2025-04-23T06:31:48.335Z","repository":{"id":34128703,"uuid":"139102670","full_name":"agrimgupta92/sgan","owner":"agrimgupta92","description":"Code for \"Social GAN: Socially Acceptable Trajectories with Generative Adversarial Networks\", Gupta et al, CVPR 2018","archived":false,"fork":false,"pushed_at":"2023-11-24T09:20:51.000Z","size":210,"stargazers_count":825,"open_issues_count":68,"forks_count":261,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-11-10T04:36:27.441Z","etag":null,"topics":["deep-learning","generative-adversarial-network","human-trajectory-prediction","pytorch","social-navigation","trajectory-prediction"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agrimgupta92.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,"publiccode":null,"codemeta":null}},"created_at":"2018-06-29T04:58:03.000Z","updated_at":"2024-11-07T11:17:13.000Z","dependencies_parsed_at":"2023-01-15T05:00:52.692Z","dependency_job_id":"b2feb7db-17fb-4beb-b113-68b9242ca144","html_url":"https://github.com/agrimgupta92/sgan","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/agrimgupta92%2Fsgan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrimgupta92%2Fsgan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrimgupta92%2Fsgan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrimgupta92%2Fsgan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agrimgupta92","download_url":"https://codeload.github.com/agrimgupta92/sgan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250385133,"owners_count":21421860,"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":["deep-learning","generative-adversarial-network","human-trajectory-prediction","pytorch","social-navigation","trajectory-prediction"],"created_at":"2024-08-02T02:01:12.078Z","updated_at":"2025-04-23T06:31:43.306Z","avatar_url":"https://github.com/agrimgupta92.png","language":"Python","funding_links":[],"categories":["Prediction","Python","Papers"],"sub_categories":["Vector Map"],"readme":"# Social GAN\n\nThis is the code for the paper\n\n**\u003ca href=\"https://arxiv.org/abs/1803.10892\"\u003eSocial GAN: Socially Acceptable Trajectories with Generative Adversarial Networks\u003c/a\u003e**\n\u003cbr\u003e\n\u003ca href=\"http://web.stanford.edu/~agrim/\"\u003eAgrim Gupta\u003c/a\u003e,\n\u003ca href=\"http://cs.stanford.edu/people/jcjohns/\"\u003eJustin Johnson\u003c/a\u003e,\n\u003ca href=\"http://vision.stanford.edu/feifeili/\"\u003eFei-Fei Li\u003c/a\u003e,\n\u003ca href=\"http://cvgl.stanford.edu/silvio/\"\u003eSilvio Savarese\u003c/a\u003e,\n\u003ca href=\"http://web.stanford.edu/~alahi/\"\u003eAlexandre Alahi\u003c/a\u003e\n\u003cbr\u003e\nPresented at [CVPR 2018](http://cvpr2018.thecvf.com/)\n\nHuman motion is interpersonal, multimodal and follows social conventions. In this paper, we tackle this problem by combining tools from sequence prediction and generative adversarial networks: a recurrent sequence-to-sequence model observes motion histories and predicts future behavior, using a novel pooling mechanism to aggregate information across\npeople.\n\nBelow we show an examples of socially acceptable predictions made by our model in complex scenarios. Each person is denoted by a different color. We denote observed trajectory by dots and predicted trajectory by stars.\n\u003cdiv align='center'\u003e\n\u003cimg src=\"images/2.gif\"\u003e\u003c/img\u003e\n\u003cimg src=\"images/3.gif\"\u003e\u003c/img\u003e\n\u003c/div\u003e\n\nIf you find this code useful in your research then please cite\n```\n@inproceedings{gupta2018social,\n  title={Social GAN: Socially Acceptable Trajectories with Generative Adversarial Networks},\n  author={Gupta, Agrim and Johnson, Justin and Fei-Fei, Li and Savarese, Silvio and Alahi, Alexandre},\n  booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},\n  number={CONF},\n  year={2018}\n}\n```\n\n## Model\nOur model consists of three key components: Generator (G), Pooling Module (PM) and Discriminator (D). G is based on encoder-decoder framework where we link the hidden states of encoder and decoder via PM. G takes as input trajectories of all people involved in a scene and outputs corresponding predicted trajectories. D inputs the entire sequence comprising both input trajectory and future prediction and classifies them as “real/fake”.\n\n\u003cdiv align='center'\u003e\n  \u003cimg src='images/model.png' width='1000px'\u003e\n\u003c/div\u003e\n\n## Setup\nAll code was developed and tested on Ubuntu 16.04 with Python 3.5 and PyTorch 0.4.\n\nYou can setup a virtual environment to run the code like this:\n\n```bash\npython3 -m venv env               # Create a virtual environment\nsource env/bin/activate           # Activate virtual environment\npip install -r requirements.txt   # Install dependencies\necho $PWD \u003e env/lib/python3.5/site-packages/sgan.pth  # Add current directory to python path\n# Work for a while ...\ndeactivate  # Exit virtual environment\n```\n\n## Pretrained Models\nYou can download pretrained models by running the script `bash scripts/download_models.sh`. This will download the following models:\n\n- `sgan-models/\u003cdataset_name\u003e_\u003cpred_len\u003e.pt`: Contains 10 pretrained models for all five datasets. These models correspond to SGAN-20V-20 in Table 1.\n- `sgan-p-models/\u003cdataset_name\u003e_\u003cpred_len\u003e.pt`: Contains 10 pretrained models for all five datasets. These models correspond to SGAN-20VP-20 in Table 1.\n\nPlease refer to [Model Zoo](MODEL_ZOO.md) for results.\n\n## Running Models\nYou can use the script `scripts/evaluate_model.py` to easily run any of the pretrained models on any of the datsets. For example you can replicate the Table 1 results for all datasets for SGAN-20V-20 like this:\n\n```bash\npython scripts/evaluate_model.py \\\n  --model_path models/sgan-models\n```\n\n## Training new models\nInstructions for training new models can be [found here](TRAINING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrimgupta92%2Fsgan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrimgupta92%2Fsgan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrimgupta92%2Fsgan/lists"}