zhang-ziang commited on
Commit
0f72f6a
Β·
1 Parent(s): 719de34

axis label

Browse files
Files changed (1) hide show
  1. app.py +17 -3
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
- draw_axis(ax, origin, rot_y, 'g')
173
- draw_axis(ax, origin, rot_z, 'b')
174
- draw_axis(ax, origin, rot_x, 'r')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()