Skip to content

Commit

Permalink
update docs and rename to available-locations
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirezaMorsali committed Oct 12, 2022
1 parent e705f30 commit 2f6000b
Show file tree
Hide file tree
Showing 25 changed files with 5,013 additions and 84 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ iai.add_apikey("XXXXXXXXXXXXXX")

## Browse through available maps (location)
Inverted AI provides an assortment of diverse road configurations and geometries, including real-world locations and maps from simulators (CARLA, Huawei SMARTS, ...).\
To search the catalog use **iai.available_maps** method by providing keywords
To search the catalog use **iai.available_locations** method by providing keywords
```python
iai.available_maps("roundabout", "carla")
iai.available_locations("roundabout", "carla")
```

To get information about a scene use **iai.get_map**.
Expand Down
4,742 changes: 4,742 additions & 0 deletions docs/source/_static/restapi.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/source/apireference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# API Reference

```{eval-rst}
`API Reference <_static/apireference.html>`_
`API Reference <_static/restapi.html>`_
```
57 changes: 57 additions & 0 deletions docs/source/getstarted/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Get Started

## Quick Start

Import `Inverted AI` python package and set the apikey:
```python
import invertedai as iai
iai.add_apikey("XXXXXXXXXXXXXX")
```
Initialize the agents:
```python
response = iai.initialize(
location="CARLA:Town03:Roundabout",
agent_count=10,
)
```
Drive the agents:
```python
response = iai.drive(
location="CARLA:Town03:Roundabout",
agent_attributes=response["attributes"],
states=response["states"],
recurrent_states=response["recurrent_states"],
traffic_states_id=response["traffic_states_id"],
steps=1,
get_birdviews=True,
get_infractions=True,
)
```


## Demo
- **Goolge Colab**: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/inverted-ai/invertedai-drive/blob/develop/examples/Colab-Demo.ipynb)

- **Locally**: Download the
<a href="https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/inverted-ai/invertedai/tree/master/examples" target="_blank">examples directory</a>, navigate to the unzipped directory in terminal and run

```
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
.venv/bin/jupyter notebook Drive-Demo.ipynb
```



```{toctree}
:maxdepth: 2
installation
initdrive
mapinfo
```


44 changes: 44 additions & 0 deletions docs/source/getstarted/initdrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Simulation

## INITIALIZE
To run the simulation, the map must be first populated with agents.
Inverted AI provides the **INITIALIZE**, a state-of-the-art model trained with real-life driving scenarios which can generate realistic positions for the initial state of the simulation.\
Having realistic, complicated and diverse initial conditions are particularly crucial to observer interesting and informative interaction between the agents, i.e., the ego vehicle and NPCs (non-player characters).

You can use **INITIALIZE** in two modes:
- _Initialize all agents_: generates initial conditions (position and speed) for all the agents including the ego vehicle
```python
response = iai.initialize(
location="CARLA:Town03:Roundabout",
agent_count=10,
)
```
- _Initialize NPCs_: generates initial conditions (position and speed) only for the NPCs according to the provided state of the ego vehicle.
```python
response = iai.initialize(
location="CARLA:Town03:Roundabout",
agent_count=10,
)
```
> _response_ is a dictionary of _states_, and _agent-attribute_ (_recurrent-states_ is also returned for compatibility with **drive**)\
> _response["states"]_ is a list of agent states, by default the first on the list is always the ego vehicle.
## DRIVE
**DRIVE** is Inverted AI's cutting-edge realistic driving model trained on millions of miles of traffic data.
This model can drive all the agents with only the current state of the environment, i.e., one step observations (which could be obtained from **INITIALIZE**) or with multiple past observations.
```python
response = iai.drive(
location="CARLA:Town03:Roundabout",
agent_attributes=response["attributes"],
states=response["states"],
recurrent_states=response["recurrent_states"],
traffic_states_id=response["traffic_states_id"],
steps=1,
get_birdviews=True,
get_infractions=True,
)
```
>For convenience and to reduce data overhead, ***drive** also returns _recurrent-states_ which can be feedbacked to the model instead of providing all the past observations.\
>Furthermore, **drive** drive all the agents for $steps\times \frac{1}{FPS}$ where by default $FPS=10[frames/sec]$, should you require other time resolutions [contact us](mailto:info@inverted.ai).

33 changes: 33 additions & 0 deletions docs/source/getstarted/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Installation and Setup

[pypi-badge]: https://badge.fury.io/py/invertedai.svg
[pypi-link]: https://pypi.org/project/invertedai/

## Published Package
For installing the Python package from PyPI [![PyPI][pypi-badge]][pypi-link]:

```bash
pip install invertedai
```

The `invertedai` package has minimal dependencies to other python packages. However, it is always recommended to install the package in a virtual environment.

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install invertedai
```


## Build and Install Manually
To install the latest version, clone the projects [github repository](https://github.com/inverted-ai/invertedai.git)
and install the package:
```bash
git clone https://github.com/inverted-ai/invertedai.git
cd invertedai
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install .
```
19 changes: 19 additions & 0 deletions docs/source/getstarted/mapinfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Locations and Maps

Inverted AI provides an assortment of diverse road configurations and geometries, including real-world locations and maps from simulators (CARLA, Huawei SMARTS, ...).\

## AVAILABLE-LOCATIONS
To search the catalog for available maps to your account (API key) use **iai.available_locations** method by providing keywords
```python
iai.available_locations("roundabout", "carla")
```

## GET-MAP
To get information about a scene use **iai.get_map**.
```python
iai.get_map**("CARLA:Town03:Roundabout")
```
The scene information include the map in [Lanelet2](https://github.com/fzi-forschungszentrum-informatik/Lanelet2) format, map in JPEG format, maximum number of allowed (driveable) vehicles, latitude longitude coordinates (for real-world locations), id and list of traffic light and signs (if any exist in the map), etc.



41 changes: 5 additions & 36 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ hide-toc: true

## Overview

Breaking Down Barriers to Level 4-5 Autonomy
Breaking Down Barriers to Level 4-5 Autonomy.

```{button-ref} quickstart
```{button-ref} getstarted/index
:ref-type: doc
:color: primary
:class: sd-rounded-pill
Expand All @@ -27,67 +27,36 @@ Get Started
- **Training and Testing**
- **Real-World Results From Simulation**

![](../images/top_camera.gif)
![](../images/top_camera.gif)

Inverted-AI provides cutting-edge solutions for closing the SIM2Real gap for autonomous vehicle (AV) industry.
Industry leading AV simulators such as [Carla](https://carla.org/) and [NVIDIA DRIVE Sim](https://www.nvidia.com/en-us/self-driving-cars/simulation/) have closed the SIM2Real gap and allow for obtaining real-world results from simulation by:

- Accurate Physics Simulation
- Photo-Realistic Scenes
- Accurate Sensor Data

However, one crucial piece of the puzzle is missing: **Human-Like NPCs** (non player characters).
State-of-the-art probabilistic behavioral models of Inverted-AI quantitatively and qualitatively outperform exiting logic-based and data-driven NPCs.

Inverted-AI also provides another product:

- Simulation as a service(SimaaS): AV simulation + Inverted-AI NPCs
- Currently [Carla](https://carla.org/) ([Huawei SMARTS](https://github.com/huawei-noah/SMARTS) and [NVIDIA DRIVE Sim](https://www.nvidia.com/en-us/self-driving-cars/simulation/) in production.)

```{toctree}
:caption: GET STARTED
:hidden:
:maxdepth: 4
self
quickstart
```

```{toctree}
:caption: API REFERENCE
:hidden:
:maxdepth: 2
sdk
getstarted/index
pythonapi/index
apireference
```

```{toctree}
:caption: GUIDES
:hidden:
:maxdepth: 2
carlasim
smarts
```

```{toctree}
:caption: Python SDK Library
:hidden:
:maxdepth: 2
modules/modules
```



```{eval-rst}
REFERENCES
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Expand Down
2 changes: 1 addition & 1 deletion docs/source/modules/invertedai_drive.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
invertedai package
Core Package
============================

Submodules
Expand Down
2 changes: 1 addition & 1 deletion docs/source/modules/modules.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Inverted AI Drive
Packages
===================

.. toctree::
Expand Down
7 changes: 7 additions & 0 deletions docs/source/pythonapi/availablemaps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# AVAILABLE-LOCATIONS

```{eval-rst}
.. autofunction:: invertedai.api_resources.available_locations
```


8 changes: 8 additions & 0 deletions docs/source/pythonapi/drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# DRIVE


```{eval-rst}
.. autofunction:: invertedai.api_resources.drive
```


8 changes: 8 additions & 0 deletions docs/source/pythonapi/getmap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# GET-MAP


```{eval-rst}
.. autofunction:: invertedai.api_resources.get_map
```


13 changes: 13 additions & 0 deletions docs/source/pythonapi/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Python SDK


```{toctree}
:maxdepth: 1
initialize
drive
availablemaps
getmap
```


7 changes: 7 additions & 0 deletions docs/source/pythonapi/initialize.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# INITIALIZE

```{eval-rst}
.. autofunction:: invertedai.api_resources.initialize
```


6 changes: 0 additions & 6 deletions docs/source/quickstart.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/sdk.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/source/smarts.md

This file was deleted.

6 changes: 3 additions & 3 deletions examples/Colab-Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
],
"source": [
"iai.add_apikey(\"\")\n",
"available_maps = iai.available_maps(\"carla\", \"roundabout\")\n",
"print(available_maps)"
"available_locations = iai.available_locations(\"carla\", \"roundabout\")\n",
"print(available_locations)"
]
},
{
Expand All @@ -52,7 +52,7 @@
"metadata": {},
"outputs": [],
"source": [
"location=available_maps[0]\n",
"location=available_locations[0]\n",
"simulation_length = 30"
]
},
Expand Down
3 changes: 2 additions & 1 deletion examples/Demo_Drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@

iai.add_apikey("")

response = iai.available_maps("carla", "roundabout")
response = iai.available_locations("carla", "roundabout")
response = iai.get_map(location=args.location)
breakpoint()
file_name = args.location.replace(":", "_")
if response["lanelet_map_source"] is not None:
file_path = f"{file_name}.osm"
Expand Down
6 changes: 3 additions & 3 deletions examples/Drive-Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
],
"source": [
"iai.add_apikey(\"\")\n",
"available_maps = iai.available_maps(\"carla\", \"roundabout\")\n",
"print(available_maps)"
"available_locations = iai.available_locations(\"carla\", \"roundabout\")\n",
"print(available_locations)"
]
},
{
Expand Down Expand Up @@ -94,7 +94,7 @@
}
],
"source": [
"location=available_maps[0]\n",
"location=available_locations[0]\n",
"simulation_length = 100\n",
"renderer = Jupyter_Render()\n",
"display(renderer)"
Expand Down

0 comments on commit 2f6000b

Please sign in to comment.