Update README.md
Browse files
README.md
CHANGED
|
@@ -1,7 +1,15 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: cc-by-nc-nd-3.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
```python
|
| 6 |
import torch
|
| 7 |
from PIL import Image as PILImage
|
|
@@ -72,4 +80,21 @@ print("-" * 30)
|
|
| 72 |
print("Scores per class:")
|
| 73 |
for i, label in model.config.id2label.items():
|
| 74 |
print(f" - {label}: {probabilities[0, i].item():.4f}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-nd-3.0
|
| 3 |
+
metrics:
|
| 4 |
+
- accuracy
|
| 5 |
+
pipeline_tag: image-classification
|
| 6 |
+
tags:
|
| 7 |
+
- art
|
| 8 |
+
---
|
| 9 |
|
| 10 |
+
# AI and Human Image Classification Model
|
| 11 |
+
|
| 12 |
+
## Usage
|
| 13 |
```python
|
| 14 |
import torch
|
| 15 |
from PIL import Image as PILImage
|
|
|
|
| 80 |
print("Scores per class:")
|
| 81 |
for i, label in model.config.id2label.items():
|
| 82 |
print(f" - {label}: {probabilities[0, i].item():.4f}")
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
## Output
|
| 86 |
+
```
|
| 87 |
+
Using device: cpu
|
| 88 |
+
Model and processor loaded successfully.
|
| 89 |
+
Loading image: /content/images.jpg
|
| 90 |
+
Preprocessing image...
|
| 91 |
+
Running inference...
|
| 92 |
+
------------------------------
|
| 93 |
+
Image: /content/images.jpg
|
| 94 |
+
Predicted Label: ai
|
| 95 |
+
Confidence Score: 0.9996
|
| 96 |
+
------------------------------
|
| 97 |
+
Scores per class:
|
| 98 |
+
- ai: 0.9996
|
| 99 |
+
- hum: 0.0004
|
| 100 |
```
|