Upload 5 files
Browse files- README.md +57 -8
- app.py +8 -0
- best.pt +3 -0
- requirements.txt +2 -0
- yolov8_background1k_best.pt +3 -0
README.md
CHANGED
@@ -1,11 +1,60 @@
|
|
1 |
---
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
9 |
---
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: mit
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
metrics:
|
6 |
+
- precision
|
7 |
+
pipeline_tag: object-detection
|
8 |
+
tags:
|
9 |
+
- Classification
|
10 |
+
- YoloV8
|
11 |
+
- Guns Detection
|
12 |
---
|
13 |
|
14 |
+
## Model Details
|
15 |
+
YoloV8n 3M parameters model for Guns Detection, trained on 16k images
|
16 |
+
### Model Description
|
17 |
+
|
18 |
+
<!-- Provide a longer summary of what this model is. -->
|
19 |
+
|
20 |
+
|
21 |
+
|
22 |
+
- **Shared by [optional]:** Karun Sharma
|
23 |
+
- **License:** MIT
|
24 |
+
|
25 |
+
### Model Sources [optional]
|
26 |
+
|
27 |
+
<!-- Provide the basic links for the model. -->
|
28 |
+
|
29 |
+
- **Demo:** https://huggingface.co/spaces/Zcket/Gun_Detect
|
30 |
+
|
31 |
+
## Uses
|
32 |
+
Can be used to detect presenece of Guns in images for Moderation.
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
### Downstream Use [optional]
|
37 |
+
Classes of Arms/Guns(Pistols, Grenades)
|
38 |
+
|
39 |
+
|
40 |
+
## How to Get Started with the Model
|
41 |
+
|
42 |
+
Use the code below to get started with the model.
|
43 |
+
|
44 |
+
```py
|
45 |
+
from ultralytics import YOLO
|
46 |
+
|
47 |
+
model = YOLO('best.pt')
|
48 |
+
|
49 |
+
results = model(['im1.jpg', 'im2.jpg']) # return a list of Results objects
|
50 |
+
|
51 |
+
# Process results list
|
52 |
+
for result in results:
|
53 |
+
boxes = result.boxes # Boxes object for bounding box outputs
|
54 |
+
masks = result.masks # Masks object for segmentation masks outputs
|
55 |
+
keypoints = result.keypoints # Keypoints object for pose outputs
|
56 |
+
probs = result.probs # Probs object for classification outputs
|
57 |
+
result.show() # display to screen
|
58 |
+
result.save(filename='result.jpg') # save to disk
|
59 |
+
```
|
60 |
+
|
app.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ultralytics import YOLO
|
2 |
+
|
3 |
+
model = YOLO('best.pt')
|
4 |
+
|
5 |
+
image_path = input("Enter image path: ")
|
6 |
+
results = model(image_path, device = 0, amp = 'True') # return a list of Results objects
|
7 |
+
|
8 |
+
print(results)
|
best.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7741299264b8915ef70c8eadd9e443bb77dd2dc3756012fc933d0e6d023fe913
|
3 |
+
size 132
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
torch
|
2 |
+
ultralytics
|
yolov8_background1k_best.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:34ab3b563e937680ad12b5a382b086b9e6a79c1bc950e70106560b2ad3a3e2aa
|
3 |
+
size 133
|