Update README.md
Browse files
README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
---
|
3 |
language: en
|
4 |
tags:
|
@@ -45,25 +45,32 @@ def detect_image(image_path):
|
|
45 |
# Example usage
|
46 |
# result, confidence = detect_image("path/to/image.jpg")
|
47 |
# print(f"Result: {result} (Confidence: {confidence:.2f}%)")
|
48 |
-
|
|
|
|
|
49 |
The model classifies images into two categories:
|
50 |
|
51 |
-
Real Image (0)
|
52 |
-
AI Generated (1)
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
67 |
async function detectImage(imageFile) {
|
68 |
const formData = new FormData();
|
69 |
formData.append('image', imageFile);
|
@@ -75,17 +82,9 @@ async function detectImage(imageFile) {
|
|
75 |
|
76 |
return await response.json();
|
77 |
}
|
78 |
-
|
79 |
-
Created by: yaya36095
|
80 |
-
License: MIT
|
81 |
-
Repository: https://huggingface.co/yaya36095/ai-image-detector
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
### **ماذا يميز هذا التنسيق؟**
|
86 |
-
1. **استخدام العناوين بشكل مناسب:** كل قسم له عنوان محدد.
|
87 |
-
2. **استخدام الكود بشكل واضح:** أكواد Python و JavaScript موضوعة داخل كتل كود.
|
88 |
-
3. **تفاصيل واضحة للمستخدمين:** يوضح التصنيفات (Classes)، المتطلبات، والقيود بوضوح.
|
89 |
-
4. **قابلية القراءة:** النص منظم وسهل الفهم.
|
90 |
|
91 |
-
|
|
|
|
|
|
|
|
1 |
+
|
2 |
---
|
3 |
language: en
|
4 |
tags:
|
|
|
45 |
# Example usage
|
46 |
# result, confidence = detect_image("path/to/image.jpg")
|
47 |
# print(f"Result: {result} (Confidence: {confidence:.2f}%)")
|
48 |
+
```
|
49 |
+
|
50 |
+
## Classes
|
51 |
The model classifies images into two categories:
|
52 |
|
53 |
+
- **Real Image (0)**: The image is real and not AI-generated.
|
54 |
+
- **AI Generated (1)**: The image is generated by AI.
|
55 |
+
|
56 |
+
## Technical Details
|
57 |
+
- **Model Architecture**: Vision Transformer (ViT)
|
58 |
+
- **Input**: Images (RGB)
|
59 |
+
- **Output**: Binary classification with confidence score
|
60 |
+
- **Max Image Size**: 224x224 (automatically resized)
|
61 |
+
|
62 |
+
## Requirements
|
63 |
+
- `transformers>=4.30.0`
|
64 |
+
- `torch>=2.0.0`
|
65 |
+
- `Pillow>=9.0.0`
|
66 |
+
|
67 |
+
## Limitations
|
68 |
+
- Best performance with clear, high-quality images.
|
69 |
+
- May have reduced accuracy with heavily edited photos.
|
70 |
+
- Designed for general image detection.
|
71 |
+
|
72 |
+
## Web Integration Example
|
73 |
+
```javascript
|
74 |
async function detectImage(imageFile) {
|
75 |
const formData = new FormData();
|
76 |
formData.append('image', imageFile);
|
|
|
82 |
|
83 |
return await response.json();
|
84 |
}
|
85 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
+
## Developer
|
88 |
+
- **Created by**: yaya36095
|
89 |
+
- **License**: MIT
|
90 |
+
- **Repository**: [https://huggingface.co/yaya36095/ai-image-detector](https://huggingface.co/yaya36095/ai-image-detector)
|