updated readme
Browse files
README.md
CHANGED
@@ -1,3 +1,172 @@
|
|
1 |
-
---
|
2 |
-
license: mit
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
---
|
4 |
+
---
|
5 |
+
tags:
|
6 |
+
- yolov8
|
7 |
+
- ultralytics
|
8 |
+
- yolo
|
9 |
+
- vision
|
10 |
+
- object-detection
|
11 |
+
- pytorch
|
12 |
+
library_name: ultralytics
|
13 |
+
library_version: 8.2.31
|
14 |
+
inference: false
|
15 |
+
model-index:
|
16 |
+
- name: Bodhi108/Yolov8n_RD
|
17 |
+
results:
|
18 |
+
- task:
|
19 |
+
type: object-detection
|
20 |
+
language:
|
21 |
+
- en
|
22 |
+
pipeline_tag: object-detection
|
23 |
+
---
|
24 |
+
|
25 |
+
# Model Card for YOLOv8n_RD
|
26 |
+
|
27 |
+
|
28 |
+
### Model Description
|
29 |
+
The YOLOv8n_RD Record Detection model is designed to detect multiple records in scanned images of birth, death, and marriage certificates.
|
30 |
+
This model enhances data processing by accurately identifying and detecting multiple records, facilitating quick extraction and further
|
31 |
+
analysis.
|
32 |
+
|
33 |
+
Integrate this model into your document management systems for real-time, automated record detection and data extraction.
|
34 |
+
For customization or integration assistance, contact us https://www.linkedin.com/in/bodhi108/
|
35 |
+
Your feedback is essential for improving the model's performance.
|
36 |
+
|
37 |
+
- **Developed by:** FATA_SCIENTISTS
|
38 |
+
- **Model type:** Object Detection
|
39 |
+
- **Task:** Record Detection in Images
|
40 |
+
|
41 |
+
|
42 |
+
### Supported Labels
|
43 |
+
|
44 |
+
```
|
45 |
+
['records']
|
46 |
+
```
|
47 |
+
|
48 |
+
## Uses
|
49 |
+
|
50 |
+
### Direct Use
|
51 |
+
|
52 |
+
The YOLOv8n_RD Record Detection model can be directly integrated into document management systems to provide real-time detection
|
53 |
+
and classification of multiple records in scanned images of birth, death, and marriage certificates. This facilitates quick data
|
54 |
+
extraction and analysis.
|
55 |
+
|
56 |
+
### Downstream Use
|
57 |
+
|
58 |
+
The model's real-time capabilities can be leveraged to automate data extraction processes, generate alerts for specific record detections,
|
59 |
+
and enhance overall document processing efficiency.
|
60 |
+
|
61 |
+
### Training data
|
62 |
+
|
63 |
+
The YOLOv8n_RD model was trained on a custom dataset consisting of annotated images of birth, death, and marriage records for
|
64 |
+
training and validation.
|
65 |
+
|
66 |
+
|
67 |
+
### Out-of-Scope Use
|
68 |
+
|
69 |
+
The model is not designed for unrelated object detection tasks or scenarios outside the scope of detecting multiple records
|
70 |
+
in scanned images of vital records.
|
71 |
+
|
72 |
+
## Bias, Risks, and Limitations
|
73 |
+
|
74 |
+
The YOLOv8n_RD Record Detection model may exhibit some limitations and biases:
|
75 |
+
|
76 |
+
- Performance may be affected by variations in image quality, document layout, and handwriting styles within scanned records.
|
77 |
+
- Poor quality scans or damaged documents may impact the model's accuracy and responsiveness.
|
78 |
+
- Record-specific anomalies not well-represented in the training data may pose challenges for detection.
|
79 |
+
|
80 |
+
### Recommendations
|
81 |
+
|
82 |
+
Users should be aware of the model's limitations and potential biases. Thorough testing and validation within specific document
|
83 |
+
processing environments are advised before deploying the model in production systems.
|
84 |
+
|
85 |
+
## How to Get Started with the Model
|
86 |
+
|
87 |
+
To begin using the YOLOv8s_RD model for multiple record detection in an image, follow these steps:
|
88 |
+
```python
|
89 |
+
pip install ultralytics==8.2.31
|
90 |
+
pip install opencv-python==4.8.0.76
|
91 |
+
```
|
92 |
+
|
93 |
+
- Load model and perform real-time prediction:
|
94 |
+
|
95 |
+
```python
|
96 |
+
from ultralytics import YOLO
|
97 |
+
import os
|
98 |
+
import cv2
|
99 |
+
import matplotlib.pyplot as plt
|
100 |
+
model = YOLO("your yolov8 trained model.pt")
|
101 |
+
def detect_records(input_folder):
|
102 |
+
# Iterate over all images in the input folder
|
103 |
+
for filename in os.listdir(input_folder):
|
104 |
+
if filename.endswith(('.jpg', '.jpeg', '.png')):
|
105 |
+
img_path = os.path.join(input_folder, filename)
|
106 |
+
img = cv2.imread(img_path)
|
107 |
+
results = model(img)
|
108 |
+
for result in results:
|
109 |
+
if result.boxes.data.shape[0] > 0: # Check for detections
|
110 |
+
for i, box in enumerate(result.boxes.data.tolist()):
|
111 |
+
xmin, ymin, xmax, ymax, conf, cls = box
|
112 |
+
|
113 |
+
# Draw the bounding box on the image
|
114 |
+
cv2.rectangle(img, (int(xmin), int(ymin)), (int(xmax), int(ymax)), (0, 255, 0), 5)
|
115 |
+
|
116 |
+
plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
|
117 |
+
plt.title(f"Detections on {filename}")
|
118 |
+
plt.axis('off')
|
119 |
+
plt.show()
|
120 |
+
|
121 |
+
input_folder = 'your input image directory'
|
122 |
+
detect_records(input_folder)
|
123 |
+
```
|
124 |
+
|
125 |
+
<div align="center">
|
126 |
+
<img width="500" src="https://huggingface.co/Bodhi108/Yolov8n_RD/blob/main/ex1.png">
|
127 |
+
</div>
|
128 |
+
|
129 |
+
## Training Details
|
130 |
+
|
131 |
+
### Training Data
|
132 |
+
|
133 |
+
The model is trained on a diverse dataset containing scanned images of birth, death, and marriage records,
|
134 |
+
capturing various document layouts, handwriting styles, and conditions.
|
135 |
+
|
136 |
+
### Training Procedure
|
137 |
+
|
138 |
+
The training process involves extensive computation and is conducted over multiple epochs.
|
139 |
+
The model's weights are adjusted to minimize detection loss and optimize performance for accurate record detection in scanned images.
|
140 |
+
|
141 |
+
#### Metrics
|
142 |
+
|
143 |
+
<div align="center">
|
144 |
+
<img width="500" src="https://huggingface.co/Bodhi108/Yolov8n_RD/blob/main/Metrics.png">
|
145 |
+
</div>
|
146 |
+
|
147 |
+
### Model Architecture and Objective
|
148 |
+
|
149 |
+
The YOLOv8n_RD architecture incorporates modifications tailored to multiple record detections in an image.
|
150 |
+
It integrates a self-attention mechanism in the head of the network and a feature pyramid network for multi-scaled object detection,
|
151 |
+
enabling it to focus on various parts of an image and detect records of different sizes and scales
|
152 |
+
|
153 |
+
### Compute Infrastructure
|
154 |
+
|
155 |
+
#### Hardware
|
156 |
+
|
157 |
+
NVIDIA GeForce RTX A6000 card
|
158 |
+
|
159 |
+
#### Software
|
160 |
+
|
161 |
+
The model was trained and fine-tuned using a Jupyter Notebook environment.
|
162 |
+
|
163 |
+
## Model Card Contact
|
164 |
+
|
165 |
+
```bibtex
|
166 |
+
@ModelCard{
|
167 |
+
author = {Tonumoy Mukherjee, Kazi Mostaq Hridoy, and Aryadip Mridha},
|
168 |
+
title = {YOLOv8n Multi-Record Detection in an image},
|
169 |
+
year = {2024}
|
170 |
+
}
|
171 |
+
```
|
172 |
+
|