[![Tests](https://github.com/svenkreiss/socialforce/actions/workflows/tests.yml/badge.svg)](https://github.com/svenkreiss/socialforce/actions/workflows/tests.yml)<br />
[Executable Book documentation](https://www.svenkreiss.com/socialforce/).<br />
[Deep Social Force (arXiv:2109.12081)](https://arxiv.org/abs/2109.12081).
# Deep Social Force
> [__Deep Social Force__](https://arxiv.org/abs/2109.12081)<br />
> _[Sven Kreiss](https://www.svenkreiss.com)_, 2021.
>
> The Social Force model introduced by Helbing and Molnar in 1995
> is a cornerstone of pedestrian simulation. This paper
> introduces a differentiable simulation of the Social Force model
> where the assumptions on the shapes of interaction potentials are relaxed
> with the use of universal function approximators in the form of neural
> networks.
> Classical force-based pedestrian simulations suffer from unnatural
> locking behavior on head-on collision paths. In addition, they cannot
> model the bias
> of pedestrians to avoid each other on the right or left depending on
> the geographic region.
> My experiments with more general interaction potentials show that
> potentials with a sharp tip in the front avoid
> locking. In addition, asymmetric interaction potentials lead to a left or right
> bias when pedestrians avoid each other.
# Install and Run
```sh
# install from PyPI
pip install 'socialforce[dev,plot]'
# or install from source
pip install -e '.[dev,plot]'
# run linting and tests
pylint socialforce
pycodestyle socialforce
pytest tests/*.py
```
# Ped-Ped-Space Scenarios
<img src="docs/separator.gif" height=200 />
<img src="docs/gate.gif" height=200 />
Emergent lane forming behavior with 30 and 60 pedestrians:
<img src="docs/walkway_30.gif" height=200 />
<img src="docs/walkway_60.gif" height=200 />
# Download TrajNet++ Data
The [Executable Book](https://www.svenkreiss.com/socialforce/)
requires some real-world data for the TrajNet++ section.
This is how to download and unzip it to the right folder:
```
wget -q https://github.com/vita-epfl/trajnetplusplusdata/releases/download/v4.0/train.zip
mkdir data-trajnet
unzip train.zip -d data-trajnet
```
Raw data
{
"_id": null,
"home_page": "https://github.com/svenkreiss/socialforce",
"name": "socialforce",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Sven Kreiss",
"author_email": "research@svenkreiss.com",
"download_url": "https://files.pythonhosted.org/packages/20/04/cbd370164b4a9cc5b9e34ab3e780977407e0f1bec34536441be9717fa8ad/socialforce-0.2.3.tar.gz",
"platform": null,
"description": "[![Tests](https://github.com/svenkreiss/socialforce/actions/workflows/tests.yml/badge.svg)](https://github.com/svenkreiss/socialforce/actions/workflows/tests.yml)<br />\n[Executable Book documentation](https://www.svenkreiss.com/socialforce/).<br />\n[Deep Social Force (arXiv:2109.12081)](https://arxiv.org/abs/2109.12081).\n\n# Deep Social Force\n\n> [__Deep Social Force__](https://arxiv.org/abs/2109.12081)<br />\n> _[Sven Kreiss](https://www.svenkreiss.com)_, 2021.\n>\n> The Social Force model introduced by Helbing and Molnar in 1995\n> is a cornerstone of pedestrian simulation. This paper\n> introduces a differentiable simulation of the Social Force model\n> where the assumptions on the shapes of interaction potentials are relaxed\n> with the use of universal function approximators in the form of neural\n> networks.\n> Classical force-based pedestrian simulations suffer from unnatural\n> locking behavior on head-on collision paths. In addition, they cannot\n> model the bias\n> of pedestrians to avoid each other on the right or left depending on\n> the geographic region.\n> My experiments with more general interaction potentials show that\n> potentials with a sharp tip in the front avoid\n> locking. In addition, asymmetric interaction potentials lead to a left or right\n> bias when pedestrians avoid each other.\n\n\n# Install and Run\n\n```sh\n# install from PyPI\npip install 'socialforce[dev,plot]'\n\n# or install from source\npip install -e '.[dev,plot]'\n\n# run linting and tests\npylint socialforce\npycodestyle socialforce\npytest tests/*.py\n```\n\n\n# Ped-Ped-Space Scenarios\n\n<img src=\"docs/separator.gif\" height=200 />\n<img src=\"docs/gate.gif\" height=200 />\n\nEmergent lane forming behavior with 30 and 60 pedestrians:\n\n<img src=\"docs/walkway_30.gif\" height=200 />\n<img src=\"docs/walkway_60.gif\" height=200 />\n\n\n# Download TrajNet++ Data\n\nThe [Executable Book](https://www.svenkreiss.com/socialforce/)\nrequires some real-world data for the TrajNet++ section.\nThis is how to download and unzip it to the right folder:\n\n```\nwget -q https://github.com/vita-epfl/trajnetplusplusdata/releases/download/v4.0/train.zip\nmkdir data-trajnet\nunzip train.zip -d data-trajnet\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "PyTorch implementation of DeepSocialForce.",
"version": "0.2.3",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2004cbd370164b4a9cc5b9e34ab3e780977407e0f1bec34536441be9717fa8ad",
"md5": "1256168dfe5db475c91a6344201d199c",
"sha256": "f7735af43b19c0a04b25dcdb73404082b4f36e6f3754fc8e7cde46a1cb36eb3d"
},
"downloads": -1,
"filename": "socialforce-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "1256168dfe5db475c91a6344201d199c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15783,
"upload_time": "2023-03-14T00:33:26",
"upload_time_iso_8601": "2023-03-14T00:33:26.586628Z",
"url": "https://files.pythonhosted.org/packages/20/04/cbd370164b4a9cc5b9e34ab3e780977407e0f1bec34536441be9717fa8ad/socialforce-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-14 00:33:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "svenkreiss",
"github_project": "socialforce",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "socialforce"
}