File size: 3,377 Bytes
23412ab
ef8abbe
 
 
23412ab
 
e92f603
23412ab
84afa24
23412ab
ef8abbe
23412ab
 
ef8abbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: "AngleForge: Robotic-Arm Multi-Angle Image Dataset Creator"
emoji: πŸ“
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 6.19.0
app_file: app.py
suggested_hardware: zero-a10g
pinned: false
license: cc-by-4.0
---

# πŸ“ AngleForge
### Robotic-Arm Multi-Angle Image Dataset Creator

Turn real-world photos into **multi-viewpoint image datasets** for
**Hugging Face Datasets** and **Edge Impulse**, using **Qwen Image Edit** to
re-render each object from new camera angles (top-down/overhead, bird's-eye,
worm's-eye, 45Β°/90Β° rotations, close-up, wide-angle, dolly moves).

A **simulated robotic arm** can call the **`grab_viewpoints` API** to pull a
series of angle images per object into a dataset β€” bootstrapping perception and
inspection models from real captures.

## Backends (automatic selection)

- πŸ–₯️ **Local Qwen Image Edit** β€” free, runs on a CUDA GPU / ZeroGPU
  (`Qwen/Qwen-Image-Edit-2509` + `linoyts/Qwen-Image-Edit-Rapid-AIO`
  transformer + `dx8152/Qwen-Edit-2509-Multiple-angles` LoRA).
- ☁️ **HF Inference Providers** β€” serverless fallback, needs a Hugging Face
  token (no local GPU required).

## Robotic-arm API

The Space exposes `grab_viewpoints` for programmatic use. A robot-arm client
requests a series of viewpoints from one image:

```python
from gradio_client import Client, handle_file

client = Client("eoinedge/angleforge")  # add hf_token=... for a private Space
views = client.predict(
    handle_file("part.jpg"),
    ["top_down", "birds_eye", "rotate_left_45", "close_up"],
    1234,   # seed
    512,    # image size
    "",     # HF token (serverless backend)
    api_name="/grab_viewpoints",
)
# `views` is a list of generated viewpoint images the arm can save into a dataset.
```

## Using the Space UI

1. **Grab viewpoints** tab β€” upload one image, pick angles, preview the series.
2. **Build dataset** tab β€” add labelled classes (label + source images), pick
   angles and augmentations, then build.
3. *(Optional)* Push the dataset to a Hugging Face repo and/or upload directly
   to your Edge Impulse project.
4. Download the resulting zip.

### Space secrets (optional)

| Secret | Purpose |
|---|---|
| `HF_TOKEN` | HF token (serverless backend + pushing datasets) |
| `EDGE_IMPULSE_API_KEY` | Edge Impulse project API key |

## Command line

```bash
pip install -r requirements.txt

# input/<label>/*.jpg  ->  multi-angle dataset
python generate.py --input input --out output --hf-out hf_dataset \
  --angles top_down birds_eye rotate_left_45 close_up

# push to HF (private) + upload to Edge Impulse
python generate.py --input input \
  --push-hf-repo "username/industrial-angles" --hf-token "$HF_TOKEN" --hf-private \
  --edge-impulse-api-key "$EDGE_IMPULSE_API_KEY"
```

## Output layout

```text
output/
  edge_impulse_upload/
    training/  good_part.<id>.jpg ...
    testing/   good_part.<id>.jpg ...
  hf_imagefolder/
    train/<label>/ ...
    test/<label>/ ...
  metadata.csv
  dataset_summary.json

hf_dataset/
  train/<label>/ ...
  test/<label>/ ...
  metadata.csv
  README.md            # dataset card
```

## Notes & limitations

Synthetic multi-view images are a great **bootstrap** for robotic-arm
perception, but validate with real captures from the arm's own camera before
deployment. Verify your use of the Qwen models complies with their licenses.

## License

CC BY 4.0.