keremberke
commited on
Commit
•
a2b318c
1
Parent(s):
c1de773
add ultralytics model card
Browse files
README.md
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
tags:
|
4 |
+
- ultralyticsplus
|
5 |
+
- yolov8
|
6 |
+
- ultralytics
|
7 |
+
- yolo
|
8 |
+
- vision
|
9 |
+
- image-classification
|
10 |
+
- pytorch
|
11 |
+
- awesome-yolov8-models
|
12 |
+
library_name: ultralytics
|
13 |
+
library_version: 8.0.23
|
14 |
+
inference: false
|
15 |
+
|
16 |
+
datasets:
|
17 |
+
- keremberke/painting-style-classification
|
18 |
+
|
19 |
+
model-index:
|
20 |
+
- name: keremberke/yolov8m-painting-classification
|
21 |
+
results:
|
22 |
+
- task:
|
23 |
+
type: image-classification
|
24 |
+
|
25 |
+
dataset:
|
26 |
+
type: keremberke/painting-style-classification
|
27 |
+
name: painting-style-classification
|
28 |
+
split: validation
|
29 |
+
|
30 |
+
metrics:
|
31 |
+
- type: accuracy
|
32 |
+
value: 0.05723 # min: 0.0 - max: 1.0
|
33 |
+
name: top1 accuracy
|
34 |
+
- type: accuracy
|
35 |
+
value: 0.21463 # min: 0.0 - max: 1.0
|
36 |
+
name: top5 accuracy
|
37 |
+
---
|
38 |
+
|
39 |
+
<div align="center">
|
40 |
+
<img width="640" alt="keremberke/yolov8m-painting-classification" src="https://huggingface.co/keremberke/yolov8m-painting-classification/resolve/main/thumbnail.jpg">
|
41 |
+
</div>
|
42 |
+
|
43 |
+
### Supported Labels
|
44 |
+
|
45 |
+
```
|
46 |
+
['Abstract_Expressionism', 'Action_painting', 'Analytical_Cubism', 'Art_Nouveau_Modern', 'Baroque', 'Color_Field_Painting', 'Contemporary_Realism', 'Cubism', 'Early_Renaissance', 'Expressionism', 'Fauvism', 'High_Renaissance', 'Impressionism', 'Mannerism_Late_Renaissance', 'Minimalism', 'Naive_Art_Primitivism', 'New_Realism', 'Northern_Renaissance', 'Pointillism', 'Pop_Art', 'Post_Impressionism', 'Realism', 'Rococo', 'Romanticism', 'Symbolism', 'Synthetic_Cubism', 'Ukiyo_e']
|
47 |
+
```
|
48 |
+
|
49 |
+
### How to use
|
50 |
+
|
51 |
+
- Install [ultralyticsplus](https://github.com/fcakyon/ultralyticsplus):
|
52 |
+
|
53 |
+
```bash
|
54 |
+
pip install ultralyticsplus==0.0.24 ultralytics==8.0.23
|
55 |
+
```
|
56 |
+
|
57 |
+
- Load model and perform prediction:
|
58 |
+
|
59 |
+
```python
|
60 |
+
from ultralyticsplus import YOLO, postprocess_classify_output
|
61 |
+
|
62 |
+
# load model
|
63 |
+
model = YOLO('keremberke/yolov8m-painting-classification')
|
64 |
+
|
65 |
+
# set model parameters
|
66 |
+
model.overrides['conf'] = 0.25 # model confidence threshold
|
67 |
+
|
68 |
+
# set image
|
69 |
+
image = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
|
70 |
+
|
71 |
+
# perform inference
|
72 |
+
results = model.predict(image)
|
73 |
+
|
74 |
+
# observe results
|
75 |
+
print(results[0].probs) # [0.1, 0.2, 0.3, 0.4]
|
76 |
+
processed_result = postprocess_classify_output(model, result=results[0])
|
77 |
+
print(processed_result) # {"cat": 0.4, "dog": 0.6}
|
78 |
+
```
|
79 |
+
|