Spaces:
Runtime error
Runtime error
| title: AutoLineDigitizer API | |
| emoji: ๐ | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: docker | |
| pinned: false | |
| license: mit | |
| # AutoLineDigitizer API | |
| Automatic chart line data extraction using deep learning (LineFormer + ChartDete + EasyOCR). | |
| Upload a chart image to extract line data that can be imported into [StarryDigitizer](https://digitizer.starrydata.org/). | |
| ## API Usage | |
| ### Endpoint | |
| ``` | |
| POST https://<your-space>.hf.space/api/predict | |
| ``` | |
| ### Python Example | |
| ```python | |
| from gradio_client import Client | |
| client = Client("https://<your-space>.hf.space/") | |
| result = client.predict( | |
| "chart.png", # image path | |
| True, # auto_axis_detection | |
| "arc_length", # downsample_mode | |
| 20, # max_points | |
| 10, # fixed_step | |
| "mean_y_desc", # sort_mode | |
| "starry_digitizer_json", # output_format | |
| api_name="/predict" | |
| ) | |
| ``` | |
| ### JavaScript (fetch) Example | |
| ```javascript | |
| const formData = new FormData(); | |
| formData.append('data', JSON.stringify([ | |
| null, // image placeholder | |
| true, // auto_axis_detection | |
| "arc_length", | |
| 20, | |
| 10, | |
| "mean_y_desc", | |
| "starry_digitizer_json" | |
| ])); | |
| formData.append('files', imageFile); | |
| const res = await fetch('https://<your-space>.hf.space/api/predict', { | |
| method: 'POST', | |
| body: formData | |
| }); | |
| ``` | |
| ## Output Formats | |
| - **starry_digitizer_json**: StarryDigitizer project.json (for API integration) | |
| - **starry_digitizer_zip**: ZIP file containing image.png + project.json | |
| - **json**: Raw extraction result with line points and axis calibration | |