docs: added the docs
Browse files- docs/api_endpoints.md +72 -0
docs/api_endpoints.md
CHANGED
|
@@ -89,4 +89,76 @@ curl -X POST http://localhost:8000/verify-image/analyse \
|
|
| 89 |
```
|
| 90 |
|
| 91 |
|
|
|
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
```
|
| 90 |
|
| 91 |
|
| 92 |
+
### Image-Detector
|
| 93 |
|
| 94 |
+
| Endpoint | Method | Description |
|
| 95 |
+
| ---------------- | ------ | --------------- |
|
| 96 |
+
| `/detect/ela` | POST | Detect ELA |
|
| 97 |
+
| `/detect/fft` | POST | Detect FFT |
|
| 98 |
+
| `/detect/meta` | POST | Detect Metadata |
|
| 99 |
+
|
| 100 |
+
#### Example for ela
|
| 101 |
+
``````bash
|
| 102 |
+
curl -X POST http://localhost:8000/detect/ela \
|
| 103 |
+
-H "Authorization: Bearer <SECRET_TOKEN>" \
|
| 104 |
+
-F 'file=@test1.png'
|
| 105 |
+
```
|
| 106 |
+
Result
|
| 107 |
+
```bash
|
| 108 |
+
{
|
| 109 |
+
"is_edited": true,
|
| 110 |
+
"ela_score": true
|
| 111 |
+
}
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
#### Example for fft
|
| 115 |
+
``````bash
|
| 116 |
+
curl -X 'POST' \
|
| 117 |
+
'https://can-org-ai-checker.hf.space/detect/ela?quality=90' \
|
| 118 |
+
-H "Authorization: Bearer <SECRET_TOKEN>" \
|
| 119 |
+
-F 'file=@test1.png'
|
| 120 |
+
```
|
| 121 |
+
Result
|
| 122 |
+
```bash
|
| 123 |
+
{
|
| 124 |
+
"is_edited": true,
|
| 125 |
+
"ela_score": true
|
| 126 |
+
}
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
#### Example for ela
|
| 130 |
+
```bash
|
| 131 |
+
curl -X 'POST' \
|
| 132 |
+
'https://can-org-ai-checker.hf.space/detect/fft?threshold=0.95' \
|
| 133 |
+
-H 'accept: application/json' \
|
| 134 |
+
-H 'Authorization: Bearer <Token>' \
|
| 135 |
+
-H 'Content-Type: multipart/form-data' \
|
| 136 |
+
-F 'file=@test.png;type=image/png'```
|
| 137 |
+
```
|
| 138 |
+
Result
|
| 139 |
+
```bash
|
| 140 |
+
{
|
| 141 |
+
"edited": false
|
| 142 |
+
}
|
| 143 |
+
```
|
| 144 |
+
|
| 145 |
+
#### Example for meta
|
| 146 |
+
```bash
|
| 147 |
+
curl -X 'POST' \
|
| 148 |
+
'https://can-org-ai-checker.hf.space/detect/meta' \
|
| 149 |
+
-H 'accept: application/json' \
|
| 150 |
+
-H 'Authorization: Bearer <Token>' \
|
| 151 |
+
-H 'Content-Type: multipart/form-data' \
|
| 152 |
+
-F 'file=@testpng;type=image/png'
|
| 153 |
+
|
| 154 |
+
```
|
| 155 |
+
|
| 156 |
+
Result:
|
| 157 |
+
```bash
|
| 158 |
+
{
|
| 159 |
+
"source": "ai_generated"
|
| 160 |
+
}
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
> The implementation note is also provided in docs/detector/note-for-backend.md
|