Spaces:
Running
Running
File size: 2,882 Bytes
defb38a |
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# MLSE Player 3D API Curl Commands
These curl commands can be used to interact with the MLSE Player 3D API for generating 3D player models.
## Upload an Image
Upload the matthews.jpg file to generate a 3D model:
```bash
curl -X POST "https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/api/upload" \
-F "file=@/Users/[email protected]/Downloads/matthews.jpg" \
-F "player_name=matthews" \
-F "use_keypoints=true" \
-F "use_mask=true"
```
## Check Job Status
Check the status of a processing job (replace JOB_ID with the actual job ID from the upload response):
```bash
curl -X POST "https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/api/status" \
-H "Content-Type: application/json" \
-d '{
"job_id": "JOB_ID"
}'
```
Example with a specific job ID:
```bash
curl -X POST "https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/api/status" \
-H "Content-Type: application/json" \
-d '{
"job_id": "f7285376-585b-46c6-80d1-94eba9af5bc8"
}'
```
## List All Jobs
List all processing jobs:
```bash
curl -X GET "https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/api/jobs"
```
## Get 3D Model File
Download the generated 3D model file (replace JOB_ID with the actual job ID):
```bash
curl -X GET "https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/api/model/JOB_ID" --output matthews_3d.glb
```
Example with a specific job ID:
```bash
curl -X GET "https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/api/model/f7285376-585b-46c6-80d1-94eba9af5bc8" --output matthews_3d.glb
```
## View Preview Image
Open this URL in your browser to view the preview image:
```
https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/outputs/JOB_ID/matthews_preview.jpg
```
Example with a specific job ID:
```
https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/outputs/f7285376-585b-46c6-80d1-94eba9af5bc8/matthews_preview.jpg
```
## Process Base64-Encoded Image
If you need to process a base64-encoded image instead of uploading a file:
```bash
curl -X POST "https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/api/process" \
-H "Content-Type: application/json" \
-d '{
"image_data": "BASE64_ENCODED_IMAGE_DATA",
"player_name": "matthews",
"options": {
"use_keypoints": true,
"use_mask": true
}
}'
```
## Workflow Example
1. Upload image and get job ID:
```bash
curl -X POST "https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/api/upload" \
-F "file=@/Users/[email protected]/Downloads/matthews.jpg" \
-F "player_name=matthews" \
-F "use_keypoints=true" \
-F "use_mask=true"
```
2. Check job status until completed:
```bash
curl -X POST "https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/api/status" \
-H "Content-Type: application/json" \
-d '{
"job_id": "YOUR_JOB_ID"
}'
```
3. Download 3D model when ready:
```bash
curl -X GET "https://huggingface.co/proxy/jakereardon-mlse-player-3d.hf.space/api/model/YOUR_JOB_ID" --output matthews_3d.glb
``` |