Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Real-World Evaluation Images for Articulated Objects Interaction Generation
|
2 |
+
|
3 |
+
This dataset contains the real-world images used in evaluating [DragAPart](https://dragapart.github.io/), a conditional image generator that models interaction with articulated objects.
|
4 |
+
|
5 |
+
## 📦 How to Use It?
|
6 |
+
|
7 |
+
Each sample consists of:
|
8 |
+
- `original_image_XXX.png`: The base image showing an articulated object.
|
9 |
+
- `arrow_locations_XXX.npy`: A NumPy file containing the arrow coordinates for interaction.
|
10 |
+
|
11 |
+
The `.npy` file stores one arrow as:
|
12 |
+
|
13 |
+
```python
|
14 |
+
[x0, y0, x1, y1] # Normalized coordinates in [0, 1]
|
15 |
+
```
|
16 |
+
|
17 |
+
Where:
|
18 |
+
- `(x0, y0)` is the **starting point** of the interaction (e.g., where the user clicks),
|
19 |
+
- `(x1, y1)` is the **end point** indicating the direction or extent of the manipulation.
|
20 |
+
|
21 |
+
These coordinates are normalized relative to the image size.
|
22 |
+
|
23 |
+
---
|
24 |
+
|
25 |
+
## 🖼️ Visualization
|
26 |
+
|
27 |
+
You can visualize the interaction using the following Python script:
|
28 |
+
|
29 |
+
```python
|
30 |
+
import numpy as np
|
31 |
+
from PIL import Image
|
32 |
+
import matplotlib.pyplot as plt
|
33 |
+
|
34 |
+
# Load image and arrow data
|
35 |
+
image_path = "original_image_000.png"
|
36 |
+
arrow_path = "arrow_locations_000.npy"
|
37 |
+
|
38 |
+
image = Image.open(image_path)
|
39 |
+
arrow = np.load(arrow_path)[0] # [x0, y0, x1, y1]
|
40 |
+
|
41 |
+
# Convert normalized coordinates to pixel values
|
42 |
+
width, height = image.size
|
43 |
+
x0, y0 = int(arrow[0] * width), int(arrow[1] * height)
|
44 |
+
x1, y1 = int(arrow[2] * width), int(arrow[3] * height)
|
45 |
+
|
46 |
+
# Plot the image and overlay the interaction arrow
|
47 |
+
plt.figure(figsize=(6, 6))
|
48 |
+
plt.imshow(image)
|
49 |
+
plt.arrow(x0, y0, x1 - x0, y1 - y0,
|
50 |
+
color='red', width=2, head_width=10, length_includes_head=True)
|
51 |
+
plt.axis('off')
|
52 |
+
plt.title("Interactive Manipulation Arrow")
|
53 |
+
plt.show()
|
54 |
+
```
|
55 |
+
|
56 |
+
This will display the original image with a red arrow showing the suggested user interaction as below:
|
57 |
+
|
58 |
+
|
59 |
+

|
60 |
+
|
61 |
+

|