This is a repository for an object detection inference API using YOLOv8 and FastAPI
This repository is used for 스마트해상물류 ICT project.
There are three operations: estimate_distance, custom_model, and area_intrusion.
Each of these operations can be used to detect different anomalies in video.
| Operation | Description |
|---|---|
| estimate_distance | GitHub Container Registry Token |
| custom_model | Remote server IP |
| area_intrusion | Remote server user name |
In this system, a publisher (camera) sends frames to multiple subscribers (users) via WebSocket. Subscribers receive processed frames based on the operation specified. For example:
{host}/ws/publishers/{location_name}?op={operation_name}{host}: APAP AI server address{location_name}: Camera location or context{operation_name}: Operation to apply (e.g., estimate_distance)
{host}/ws/subscribers/{location_name}{host}: APAP AI server address{location_name}: Camera location or context
Dependencies are managed using Poetry.
pip install poetry
poetry installpoetry run uvicorn --host=127.0.0.1 app.main:appEnvironment variables are managed through dotenv.
The defined variables are referenced from the .env file in the root directory.
Documentation is provided through SwaggerUI, which is built into FastAPI by default.
http://localhost:8080/docs poetry run pytestThe following variables need to be defined in the Environment secrets:
| Variable | Description |
|---|---|
| GHCR_TOKEN | GitHub Container Registry Token |
| REMOTE_IP | Remote server IP |
| REMOTE_USER | Remote server user name |
| REMOTE_PRIVATE_KEY | Remote server private key |
| REMOTE_SSH_PORT | 22 |