Spaces:
Running
Running
zhang-ziang
commited on
Commit
Β·
0f72f6a
1
Parent(s):
719de34
axis label
Browse files
app.py
CHANGED
|
@@ -169,9 +169,23 @@ def infer_func(img, do_rm_bkg):
|
|
| 169 |
# ζ转εηει
|
| 170 |
rot_x, rot_y, rot_z = get_proj2D_XYZ(phi, theta, gamma)
|
| 171 |
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
# ε
³ιεζ 轴εη½ζ Ό
|
| 177 |
ax.set_axis_off()
|
|
|
|
| 169 |
# ζ转εηει
|
| 170 |
rot_x, rot_y, rot_z = get_proj2D_XYZ(phi, theta, gamma)
|
| 171 |
|
| 172 |
+
# draw arrow
|
| 173 |
+
arrow_attr = [{'point':rot_x, 'color':'r', 'label':'front'},
|
| 174 |
+
{'point':rot_y, 'color':'g', 'label':'right'},
|
| 175 |
+
{'point':rot_z, 'color':'b', 'label':'top'}]
|
| 176 |
+
|
| 177 |
+
if phi> 45 and phi<=225:
|
| 178 |
+
order = [0,1,2]
|
| 179 |
+
elif phi > 225 and phi < 315:
|
| 180 |
+
order = [2,0,1]
|
| 181 |
+
else:
|
| 182 |
+
order = [2,1,0]
|
| 183 |
+
|
| 184 |
+
for i in range(3):
|
| 185 |
+
draw_axis(ax, origin, arrow_attr[order[i]]['point'], arrow_attr[order[i]]['color'], arrow_attr[order[i]]['label'])
|
| 186 |
+
# draw_axis(ax, origin, rot_y, 'g', label='right')
|
| 187 |
+
# draw_axis(ax, origin, rot_z, 'b', label='top')
|
| 188 |
+
# draw_axis(ax, origin, rot_x, 'r', label='front')
|
| 189 |
|
| 190 |
# ε
³ιεζ 轴εη½ζ Ό
|
| 191 |
ax.set_axis_off()
|