yaya36095 commited on
Commit
f2475cd
·
verified ·
1 Parent(s): a143240

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -37
README.md CHANGED
@@ -13,6 +13,7 @@ license: mit
13
  This model is designed to detect whether an image is real or AI-generated. It uses Vision Transformer (VIT) architecture to provide accurate classification.
14
 
15
  ## Model Usage
 
16
  ```python
17
  from transformers import ViTImageProcessor, ViTForImageClassification
18
  from PIL import Image
@@ -43,40 +44,4 @@ def detect_image(image_path):
43
 
44
  # Example usage
45
  # result, confidence = detect_image("path/to/image.jpg")
46
- # print(f"Result: {result} (Confidence: {confidence:.2f}%)")
47
- Classes
48
- The model classifies images into two categories:
49
-
50
- Real Image (0)
51
- AI Generated (1)
52
- Technical Details
53
- Model Architecture: Vision Transformer (ViT)
54
- Input: Images (RGB)
55
- Output: Binary classification with confidence score
56
- Max Image Size: 224x224 (automatically resized)
57
- Requirements
58
- transformers>=4.30.0
59
- torch>=2.0.0
60
- Pillow>=9.0.0
61
- Limitations
62
- Best performance with clear, high-quality images
63
- May have reduced accuracy with heavily edited photos
64
- Designed for general image detection
65
- Web Integration Example
66
- javascript
67
- CopyInsert
68
- async function detectImage(imageFile) {
69
- const formData = new FormData();
70
- formData.append('image', imageFile);
71
-
72
- const response = await fetch('YOUR_API_ENDPOINT', {
73
- method: 'POST',
74
- body: formData
75
- });
76
-
77
- return await response.json();
78
- }
79
- Developer
80
- Created by: yaya36095
81
- License: MIT
82
- Repository: https://huggingface.co/yaya36095/ai-image-detector
 
13
  This model is designed to detect whether an image is real or AI-generated. It uses Vision Transformer (VIT) architecture to provide accurate classification.
14
 
15
  ## Model Usage
16
+
17
  ```python
18
  from transformers import ViTImageProcessor, ViTForImageClassification
19
  from PIL import Image
 
44
 
45
  # Example usage
46
  # result, confidence = detect_image("path/to/image.jpg")
47
+ # print(f"Result: {result} (Confidence: {confidence:.2f}%)")