Spaces:
Sleeping

File size: 968 Bytes
2143bab
31b39ba
2143bab
 
8ac0238
2143bab
 
 
 
6699d91
2143bab
6699d91
 
 
 
 
 
 
 
2143bab
 
6699d91
 
2143bab
 
6699d91
 
 
2143bab
 
6699d91
 
 
 
 
 
 
 
2143bab
6699d91
 
 
 
 
 
2143bab
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
title: rd
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
---


## 📱 API Integration (Mobile Apps)

The API is deployed on Hugging Face Spaces.

### Request Format
- **Method:** `POST`
- **Body:** `multipart/form-data`
- **Key:** `data` (file)

### Example Code (React Native/JS)

```javascript
const API_URL = "https://prayag80-dr-api.hf.space/api/predict";

const formData = new FormData();
formData.append('data', {
    uri: imageUri,         // Local file path
    type: 'image/jpeg',    // Mime type
    name: 'retinal.jpg'    // Filename
});

try {
    const response = await fetch(API_URL, {
        method: 'POST',
        body: formData,
        headers: {
            'Content-Type': 'multipart/form-data',
        },
    });

    const result = await response.json();
    console.log(result);
    // Output: { data: [{ label: "No_DR", confidences: [...] }] }
} catch (error) {
    console.error("API Error:", error);
}
```


## License

MIT