initial commit
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
# Memory Module Detection API Documentation
|
||||
|
||||
## Overview
|
||||
Flask API for detecting memory modules on motherboard images using YOLOv8. Processes uploaded images and returns bounding box coordinates with confidence scores.
|
||||
|
||||
## Base URL
|
||||
`http://localhost:5000`
|
||||
|
||||
## Endpoints
|
||||
|
||||
### 1. Root Endpoint
|
||||
**GET** `/`
|
||||
- Returns the test interface HTML page
|
||||
- Response: `test.html`
|
||||
|
||||
### 2. Image Detection
|
||||
**POST** `/detect`
|
||||
- Accepts image uploads for processing
|
||||
- **Request:**
|
||||
```bash
|
||||
curl -X POST -F "image=@motherboard.jpg" http://localhost:5000/detect
|
||||
```
|
||||
- **Successful Response (200):**
|
||||
```json
|
||||
{
|
||||
"detections": [
|
||||
{
|
||||
"box": [x1,y1,x2,y2],
|
||||
"confidence": 0.95,
|
||||
"class": 0
|
||||
}
|
||||
],
|
||||
"result_image": "/results/filename.jpg"
|
||||
}
|
||||
```
|
||||
- **Error Responses:**
|
||||
- `400 Bad Request`: Missing/invalid image file
|
||||
- `500 Server Error`: Processing failure
|
||||
|
||||
### 3. Result Retrieval
|
||||
**GET** `/results/<filename>`
|
||||
- Returns annotated image with bounding boxes
|
||||
- Example: `http://localhost:5000/results/out1.jpg`
|
||||
|
||||
## Request/Response Examples
|
||||
**Sample Request:**
|
||||
```python
|
||||
import requests
|
||||
response = requests.post(
|
||||
'http://localhost:5000/detect',
|
||||
files={'image': open('motherboard.jpg', 'rb')}
|
||||
)
|
||||
```
|
||||
|
||||
**Sample Response:**
|
||||
```json
|
||||
{
|
||||
"detections": [
|
||||
{
|
||||
"box": [541,567,661,265],
|
||||
"confidence": 0.98,
|
||||
"class": 0
|
||||
}
|
||||
],
|
||||
"result_image": "/results/out1.jpg"
|
||||
}
|
||||
```
|
||||
|
||||
## Technical Specifications
|
||||
| Parameter | Value |
|
||||
|--------------------|---------------------------|
|
||||
| Model | YOLOv8n (custom-trained) |
|
||||
| Input Formats | JPG/PNG |
|
||||
| Recommended Resolution | 416px |
|
||||
| Processing Time (CPU) | 200-500ms per image |
|
||||
@@ -0,0 +1,54 @@
|
||||
# DS Task Recycling Project
|
||||
|
||||
This project is a toy project for training and quality assurance purposes. It involves developing a simple Flask API that processes an image (or a hardcoded image) of a motherboard and detects memory modules present on it. The API will return the image with bounding boxes drawn around each detected memory module.
|
||||
|
||||
## Project Overview
|
||||
|
||||
- **Input Types:**
|
||||
|
||||
- Image upload via the Flask API.
|
||||
- A hardcoded image for testing purposes.
|
||||
- **Dataset:**
|
||||
|
||||
- 20 pictures of motherboards with memory.
|
||||
- 20 pictures of motherboards without memory.
|
||||
- **Output:**
|
||||
|
||||
- An annotated image with bounding boxes around each detected memory module.
|
||||
For example, if there are two memory modules, two boxes are drawn; if only one is detected, then one box is drawn.
|
||||
- **Annotation Tool Suggestion:**
|
||||
|
||||
- We suggest using [makesense.ai](https://www.makesense.ai/) for manual annotation if needed.
|
||||
|
||||
## Task Details
|
||||
|
||||
The developer is required to research and answer the following questions as part of the task:
|
||||
|
||||
1. **Algorithm Choice:**
|
||||
|
||||
- Which algorithm will you use for detecting the memory modules?
|
||||
- Why do you choose this particular algorithm?
|
||||
2. **Hardware Considerations:**
|
||||
|
||||
- Does CPU or GPU have an impact on your decision? Please explain.
|
||||
3. **Video Input:**
|
||||
|
||||
- What if a video is provided instead of single images?
|
||||
- Does your approach change when processing videos? Please describe your approach.
|
||||
|
||||
## Proposed Flask API Implementation
|
||||
|
||||
1. **API Endpoints:**
|
||||
|
||||
- An endpoint for uploading images which processes and returns the annotated image.
|
||||
- An endpoint parameter for using a hardcoded image for testing purposes.
|
||||
2. **Processing Workflow:**
|
||||
|
||||
- Receive an image (either via file upload or from a hardcoded source).
|
||||
- Apply the chosen object detection algorithm to detect memory modules.
|
||||
- Draw bounding boxes around each detected memory module.
|
||||
- Return the annotated image to the user.
|
||||
|
||||
## Data Set:
|
||||
|
||||
Dataset in on the `training` folder. And there is `memory` and `no_memory` subfolder in it.
|
||||
@@ -0,0 +1,26 @@
|
||||
**1. Algorithm Choice**
|
||||
- **Selected:** YOLOv8n (lightweight version)
|
||||
- **Why:**
|
||||
- Fast detection (0.5s/image on CPU)
|
||||
- Works well with small datasets (40 images)
|
||||
- Accurate for motherboard components
|
||||
|
||||
**2. Hardware Impact**
|
||||
- **Training:**
|
||||
- GPU recommended (4x faster training)
|
||||
- CPU works but slower
|
||||
- **Deployment:**
|
||||
- CPU sufficient for basic use
|
||||
- GPU better for high volume
|
||||
|
||||
**3. Video Handling**
|
||||
- **Approach:** Process each frame individually
|
||||
- **Changes Needed:**
|
||||
- Add frame-by-frame processing
|
||||
- Include tracking to follow memory modules
|
||||
- Optimize for speed (lower resolution helps)
|
||||
|
||||
**Key Facts:**
|
||||
- Same model works for images/video
|
||||
- CPU processing is practical
|
||||
- No architecture changes needed between image/video modes.
|
||||
Reference in New Issue
Block a user