Spaces:
Sleeping
Sleeping
Alex Hortua
commited on
Commit
Β·
745c38a
1
Parent(s):
ba8c27e
Add additional changes to this dataset
Browse files- README.md +37 -5
- datasets/annotations.json +3 -0
- models/faster_rcnn_custom.pth +3 -0
- models/lego_fasterrcnn.pth +3 -0
README.md
CHANGED
@@ -7,7 +7,7 @@ sdk: gradio
|
|
7 |
sdk_version: 5.18.0
|
8 |
app_file: src/app.py
|
9 |
pinned: false
|
10 |
-
short_description: Using RCNN and
|
11 |
---
|
12 |
|
13 |
|
@@ -18,22 +18,54 @@ short_description: Using RCNN and Fully connected to detect Planes in objects
|
|
18 |
This project trains a **Faster R-CNN** model with a **ResNet-50 backbone** to detect LEGO objects using a custom dataset.
|
19 |
|
20 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
## **Project Structure**
|
23 |
```yaml
|
24 |
lego_detection/
|
25 |
βββ models/ # Trained models
|
26 |
β βββ lego_fasterrcnn.pth # Saved model
|
|
|
27 |
β
|
28 |
βββ datasets/ # Dataset folder
|
29 |
β βββ images/ # Training images
|
30 |
β βββ annotations/ # Corresponding XML annotations
|
|
|
|
|
31 |
β
|
32 |
βββ src/ # Source code
|
33 |
-
β βββ
|
34 |
-
β βββ
|
35 |
-
β βββ
|
36 |
-
β βββ
|
|
|
|
|
|
|
|
|
37 |
β
|
38 |
βββ config.yaml # Hyperparameters & settings
|
39 |
βββ README.md # Project documentation
|
|
|
7 |
sdk_version: 5.18.0
|
8 |
app_file: src/app.py
|
9 |
pinned: false
|
10 |
+
short_description: Using RESTNET-RCNN with a RPN (Regional Proposal Network) and A FNN to detect lego pieces
|
11 |
---
|
12 |
|
13 |
|
|
|
18 |
This project trains a **Faster R-CNN** model with a **ResNet-50 backbone** to detect LEGO objects using a custom dataset.
|
19 |
|
20 |
---
|
21 |
+
## π Project Overview
|
22 |
+
|
23 |
+
This project implements an advanced object detection system specifically designed for LEGO pieces using a combination of powerful deep learning architectures:
|
24 |
+
|
25 |
+
1. **ResNet-50 Backbone**:
|
26 |
+
- Serves as the feature extractor
|
27 |
+
- Pre-trained on ImageNet for robust feature learning
|
28 |
+
- Deep residual learning framework for improved training of deep networks
|
29 |
+
|
30 |
+
2. **Region Proposal Network (RPN)**:
|
31 |
+
- Scans the image and proposes potential object regions
|
32 |
+
- Generates anchor boxes of various scales and ratios
|
33 |
+
- Outputs "objectness" scores and bounding box refinements
|
34 |
+
|
35 |
+
3. **Fast Neural Network (FNN)**:
|
36 |
+
- Performs final classification and bounding box regression
|
37 |
+
- Takes features from proposed regions
|
38 |
+
- Outputs class probabilities and precise box coordinates
|
39 |
+
|
40 |
+
### Key Features
|
41 |
+
|
42 |
+
- **End-to-End Training**: The entire network is trained jointly for optimal performance
|
43 |
+
- **Multi-Scale Detection**: Capable of detecting LEGO pieces of varying sizes
|
44 |
+
- **Real-Time Processing**: Efficient architecture allows for quick inference
|
45 |
+
- **High Accuracy**: Achieves strong mean Average Precision (mAP) on LEGO detection
|
46 |
|
47 |
## **Project Structure**
|
48 |
```yaml
|
49 |
lego_detection/
|
50 |
βββ models/ # Trained models
|
51 |
β βββ lego_fasterrcnn.pth # Saved model
|
52 |
+
β βββ faster_rcnn_custom.pth # Latest model
|
53 |
β
|
54 |
βββ datasets/ # Dataset folder
|
55 |
β βββ images/ # Training images
|
56 |
β βββ annotations/ # Corresponding XML annotations
|
57 |
+
β βββ test_images/ # Testing the model
|
58 |
+
β βββ annotations.json/ # To format annotation in one only file
|
59 |
β
|
60 |
βββ src/ # Source code
|
61 |
+
β βββ transformdata.py # Formats the data to COCO.json
|
62 |
+
β βββ new_trainer.py # Train the model based on the new assumptions
|
63 |
+
β βββ app.py # Allow users to interact with this model
|
64 |
+
β βββ Attempt1 # First Implementation
|
65 |
+
β βββ dataset.py # Dataset class (LegoDataset)
|
66 |
+
β βββ train.py # Training script
|
67 |
+
β βββ evaluate.py # mAP Calculation
|
68 |
+
β βββ utils.py # IoU, AP calculation functions
|
69 |
β
|
70 |
βββ config.yaml # Hyperparameters & settings
|
71 |
βββ README.md # Project documentation
|
datasets/annotations.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d18c0c9781488fb7c4c7b82b9b127c747f221405d5060c5c9d5af1f3927f5f11
|
3 |
+
size 181544908
|
models/faster_rcnn_custom.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1c1ba12d16031c5c1dad0bbbaa8138ef08e10e247ab62d521e2822a05fb540d6
|
3 |
+
size 165726397
|
models/lego_fasterrcnn.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2b08d7f42aed84b00eb994a2d922141867e86596324a24cef3e9c4c3e777058e
|
3 |
+
size 165725500
|