Skip to content

ng-capstone/ng-tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

104 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup Windows

To set up the camera processor for the first time, proceed with the following.

Install dependencies

  1. pip install -r requirements.txt

Set up a virtual environment

  1. python -m venv venv
  2. venv\scripts\activate.bat
  3. pip install -r requirements.txt again

Setup Mac

To set up the camera processor for the first time, proceed with the following.

Install dependencies

  1. pip install -r requirements.txt

Set up a virtual environment

  1. python3 -m venv {chosen name of venv}
  2. source {chosen name of venv}/bin/activate
  3. pip install -r requirements.txt again

Running Camera Processor

  1. Ensure you're in the virtual environment
  2. Ensure you have docker installed and running on your machine
  3. docker compose up --build
  4. Ensure that the simulation is running
  5. Open a new terminal and navigate to hivemind directory. Enter hivemind venv.
  6. In the hivemind venv python3 main.py (Mac) OR
  7. py main.py (Windows)
  8. In camera processor venv python3 cam_processor.py {camera number, starts at 0} -d (Mac) OR
  9. py cam_processor.py {camera number, starts at 0} -d (Windows)
    • Examples: python3 cam_processor.py 0 -d, py cam_processor.py 0 -d
    • Note: The command may be python rather than py

Running Hivemind

  1. Ensure that the simulation is running
  2. Ensure Camera Processor is running (See above)
  3. Ensure you're in a seperate hivemind virtual environment
  4. python3 hivemind.py (Mac) OR
  5. py hivemind.py (Windows)
    • Note: The command may be python rather than py

Interfaces

API

  • POST /world/init: one-time request from Unity. Responds with cop and camera IDs?
{
    'map': ??,
    'cops': {},
    'cameras': {}
}
  • POST /camera/<camera_id>: request processing camera image with YOLO.
{
    'position': [f, f, f],
    'rotation': [f, f, f, f],
    'fov': f,
    'image': str
}
  • POST /world/robber_report: report initial robber sigthing.
{
    'location': ??,
    'timestamp': f,
    'prefab_id': ??
}
  • GET /world/dispatch/<cop_id>: receive dispatch directions.

About

Tracks hostile cars with a network of microservices and cameras running CV algorithms, and intercepts them using RL algorithms and simulated cops (2024-2025)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors