File size: 1,551 Bytes
7ee9458
 
 
 
 
 
 
 
 
 
 
 
3b62419
7364060
779723a
3b62419
 
 
 
 
 
7364060
779723a
d2009f5
 
4e5e0e7
 
d2009f5
 
7364060
 
 
4e5e0e7
7364060
 
d2009f5
4e5e0e7
779723a
4e5e0e7
779723a
077a679
 
 
 
4e5e0e7
 
 
 
 
 
 
 
 
 
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
53
54
---
title: Segmentation
emoji: πŸ“‰
colorFrom: indigo
colorTo: red
sdk: gradio
sdk_version: 5.19.0
app_file: app.py
pinned: false
---

Check out the configuration reference at https://huggingface.co./docs/hub/spaces-config-reference

# Sending image file to api 
curl -X POST "https://alexgenovese-segmentation.hf.space/segment" \
  -F "data=[{\"type\": \"image\", \"value\": null}]" \
  -F "data=@woman_with_bag.jpeg" \
  -H "Content-Type: multipart/form-data" \
  -o response.json


# Sending image file to api 
curl -X POST "https://alexgenovese-segmentation.hf.space/segment" \
  -H "accept: application/json" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@woman_with_bag.jpeg" \
  -o response.json


# Sending image in base 64 to api
1. base64 woman_with_bag.jpeg > image.b64

2. curl -X POST "https://alexgenovese-segmentation.hf.space/segment" \
-H "Content-Type: application/json" \
-d "{\"image_base64\": \"$(cat image.b64)\"}" 

or

curl -X POST "https://alexgenovese-segmentation.hf.space/segment" \
-H "Content-Type: application/json" \
-d "{\"image_base64\": \"$(base64 woman_with_bag.jpeg)\"}"


# Output 
{"mask":"data:image/png;base64...","annotations":{"mask":[[]]"label":"fashion"}} 

# Segmetn-url endpoint 

curl -X POST "https://alexgenovese-segmentation.hf.space/segment-url" \
-H "Content-Type: application/json" \
-d '{
    "url": "https://plus.unsplash.com/premium_photo-1673210886161-bfcc40f54d1f?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cGVyc29uJTIwc3RhbmRpbmd8ZW58MHx8MHx8&w=1000&q=80"
}' \
-o response.json