PIWM / README.md
musictimer's picture
Modify readme
1c8e6d1
---
title: Diamond CSGO AI Player
emoji: 🎮
colorFrom: green
colorTo: blue
sdk: docker
pinned: false
app_file: app.py
---
# Diamond CSGO AI Player 🎮
A web-based demo of the Diamond AI agent playing Counter-Strike: Global Offensive using diffusion models and reinforcement learning.
## Features
- **Real-time Keyboard Input**: Use standard WASD controls and other keys to interact
- **AI Agent**: Pre-trained agent using diffusion-based world models
- **Web Interface**: No installation required, play directly in your browser
- **Live Visualization**: See the AI's perspective and actions in real-time
## Controls
### Movement
- **W** - Move Forward
- **A** - Move Left
- **S** - Move Back
- **D** - Move Right
- **Space** - Jump
- **Ctrl** - Crouch
- **Shift** - Walk
### Actions
- **1, 2, 3** - Switch Weapons
- **R** - Reload
- **Arrow Keys** - Camera Movement
- **Left/Right Click** - Primary/Secondary Fire
### Game Controls
- **M** - Switch between Human/AI control
- **Enter** - Reset Environment
## How to Play
1. Click on the game canvas to focus it
2. Use keyboard controls to play
3. The AI agent will respond to your inputs in real-time
4. Switch to AI mode to watch the agent play autonomously
## Technical Details
This demo uses:
- **FastAPI + WebSocket** for real-time communication
- **PyTorch** for AI model inference
- **Diffusion Models** for next-frame prediction
- **World Model Environment** for simulation
The agent was trained using the Diamond framework, which combines:
- Diffusion-based world models
- Actor-critic reinforcement learning
- Multi-step planning and imagination
## Model Information
The AI agent uses several neural networks:
- **Denoiser**: Diffusion model for generating next observations
- **Upsampler**: High-resolution image generation
- **Reward/End Model**: Predicting game outcomes
- **Actor-Critic**: Action selection and value estimation
## Citation
This work is based on the Diamond framework. If you use this code, please cite:
```bibtex
@article{diamond2024,
title={Diamond: Diffusion for World Modeling},
author={[Authors]},
journal={[Journal]},
year={2024}
}
```
## License
See LICENSE file for details.