File size: 2,197 Bytes
1c8e6d1
 
 
 
 
 
 
 
 
 
c64c726
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
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.