created: 2025-07-02 tags: [computer-vision] - "#software-architecture" - "#frontend" - "#backend" - database org: - GC goal: Overall design doc of the project
Frontend¶
- More Detailed Plans: 02-Frontend
User Flow - Upload new model¶
- Clicks ‘Upload Model’, select a .pt file
- If success, default select ‘Run Inference’
- A pop-up window shows up for users to upload image/video
- Displays results of the image
User Flow - Run existing model¶
- User sees the models list.
- User clicks on the model name to select this model
- Clicks ‘Run Inference’
- A pop-up window shows up for users to upload image/video
- Displays results of the image
Component Tree¶
![[Screenshot 2025-07-02 at 10.54.04 AM.png]]
HTTP Request¶
- Upload model
- form-data
- .pt file
- name
- form-data
- Run inference
- form data
- event_id
- model id
- temp path to file (image/video)
- form data
Backend¶
API Endpoints¶
- Clicks ‘Upload Model’, select a .pt file
- POST /api/models
- User sees their custom model in the models list.
- GET /api/models
- User clicks on the model name to select this model
- Frontend just stores the selected model id
- Clicks ‘Run Inference’
- POST /api/run
- Displays results of the image
GET /api/models
- Returns a list of models in json format
- .json file should include: id, model name, path
POST /api/models
- (User uploads a new
.ptfile) - Save the file to a path (backend/app/models/{model-name})
- Update models.json (id, model name, path)
DELETE /api/models/:id
- Update models.json
POST /api/run
- Request body:
- event_id
- model id
- temp path to file (image/video)
- Loads the .pt file for that model
- Gets the file
- Runs the inference
- ~~(Stores the results in DB)~~
- Return results as JSON
Should have two blueprints:
- model
- inference
Database¶
Fields:
- event_id (PK)
- model_id
- results
- input_file
- timestamp
Deployment
Reference¶
previous proposal: CV Playground Backend