mlse-player-3d / curl_commands.md
Jake Reardon
Add curl commands documentation
defb38a
# 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
```