| title | Traffic Signal RL |
|---|---|
| emoji | 🚦 |
| colorFrom | red |
| colorTo | green |
| sdk | docker |
| sdk_version | 1.0 |
| python_version | 3.9 |
| app_file | inference.py |
| pinned | false |
Traffic Signal RL is a reinforcement learning environment built for the Meta PyTorch OpenEnv Hackathon.
It demonstrates how agents can optimize email sorting, traffic signal control, and multi‑intersection management using the OpenEnv specification (reset(), step(), state()).
- Hugging Face Space 👉 Traffic-Signal-RL Demo
- GitHub Repo 👉 Traffic-Signal-RL Repository
- Reinforcement Learning
- OpenEnv Hackathon
- Hugging Face Spaces
- PyTorch
- Traffic Optimization
- Email Classification
- Multi-Intersection Control
- Action Space: Discrete(3) → [Work, Personal, Spam]
- Observation Space: 10-dimensional vector
- Reward: 1.0 for correct classification, 0.0 otherwise
- Action Space: Discrete(3) → [Red, Green, Orange]
- Observation Space: Queue length of cars at a single intersection
- Reward: Positive for reduced waiting time, 0.0 if jam persists
- Action Space: Discrete(6) → control multiple signals simultaneously
- Observation Space: Cars per lane + traffic density
- Reward: 1.0 for smooth flow during rush hour, partial reward for improvement
- EmailSort → Reward = 1.0 if email sorted correctly, else 0.0
- TrafficSignal → Reward = 1.0 if chosen signal reduces queue length, else 0.0
- MultiIntersection → Reward = 1.0 for optimal flow, partial rewards (0.2–0.5) for improvements, else 0.0
env.py→ Environment definitions (EmailSortEnv, TrafficSignalEnv, MultiIntersectionEnv)openenv.yaml→ Task specifications for all 3 tasksinference.py→ Baseline agent (random actions, reproducible scores)ui_inference.py→ Gradio UI for demo modeDockerfile→ Deployment setup (Gymnasium + NumPy + PyYAML + Gradio)README.md→ Documentation and hackathon notespyproject.toml→ Project metadata and dependencies for OpenEnv validator.gitattributes→ Optional file for repo consistency
pip install gymnasium numpy pyyaml gradio fastapi uvicorn openai huggingface_hub==0.23.0 openenv
python inference.py