Alex Hortua commited on
Commit
745c38a
Β·
1 Parent(s): ba8c27e

Add additional changes to this dataset

Browse files
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 Fully connected to detect Planes in objects
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
- β”‚ β”œβ”€β”€ dataset.py # Dataset class (LegoDataset)
34
- β”‚ β”œβ”€β”€ train.py # Training script
35
- β”‚ β”œβ”€β”€ evaluate.py # mAP Calculation
36
- β”‚ β”œβ”€β”€ utils.py # IoU, AP calculation functions
 
 
 
 
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