Skip to content

Commit

Permalink
Minor update to tutorials.
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuwch committed Jun 14, 2017
1 parent 470cef0 commit e2ebd21
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 33 deletions.
4 changes: 2 additions & 2 deletions docs/tutorials/generate_images_tutorial.ipynb
Git LFS file not shown
7 changes: 4 additions & 3 deletions docs/tutorials/generate_images_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def read_npy(res):
client.connect()
if not client.isconnected():
print('UnrealCV server is not running. Run the game downloaded from http://unrealcv.github.io first.')
sys.exit(-1)

###############################
# Make sure the connection works well
Expand Down Expand Up @@ -172,9 +173,9 @@ def match_color(object_mask, target_color, tolerance=3):
# for obj_id in ids:
obj_id = ids[0]
color = id2color[obj_id]
# print('%s : %s' % (obj_id, str(color)))
color_block = np.zeros((100,100, 3)) + np.array([color.R, color.G, color.B]) / 255.0
plt.figure(); plt.imshow(color_block); plt.title(obj_id)
print('%s : %s' % (obj_id, str(color)))
# color_block = np.zeros((100,100, 3)) + np.array([color.R, color.G, color.B]) / 255.0
# plt.figure(); plt.imshow(color_block); plt.title(obj_id)

##############################
# Plot only one object
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/generate_images_tutorial.py.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d5b6a2accafee8521c38e2ce14bae805
f701c796cd064515f97e42e17a68f9f2
27 changes: 15 additions & 12 deletions docs/tutorials/generate_images_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ground truth from a virtual environment.

Out::

The last update of this file: 2017-06-14 01:31:07
The last update of this file: 2017-06-14 01:53:46


Load some python libraries
Expand Down Expand Up @@ -73,6 +73,7 @@ Load unrealcv python client, do :code:`pip install unrealcv` first.
client.connect()
if not client.isconnected():
print('UnrealCV server is not running. Run the game downloaded from http://unrealcv.github.io first.')
sys.exit(-1)
Expand Down Expand Up @@ -327,7 +328,7 @@ Load information of this scene

Out::

Number of objects in this image: 119
Number of objects in this image: 118
Category name : Object name
Shelving : ['SM_Shelving_7', 'SM_Shelving_6', 'SM_Shelving_9', 'SM_Shelving_8']
Bowl : ['SM_Bowl_29']
Expand All @@ -340,7 +341,7 @@ Load information of this scene
Trim_Floor : ['S_Trim_Floor_10']
Vase : ['SM_Vase_22', 'SM_Vase_21', 'SM_Vase_20', 'SM_Vase_18', 'SM_Vase_16', 'SM_Vase_17']
Carpet : ['Carpet_5', 'Carpet_7']
Room : ['SM_Room_OuterShell_14', 'SM_Room_7']
Room : ['SM_Room_7']
FloorLamp : ['SM_FloorLamp_7']
Switch : ['Switch_7']
EditorPlane : ['EditorPlane_27']
Expand All @@ -361,17 +362,19 @@ Show the annotation color of some objects
# for obj_id in ids:
obj_id = ids[0]
color = id2color[obj_id]
# print('%s : %s' % (obj_id, str(color)))
color_block = np.zeros((100,100, 3)) + np.array([color.R, color.G, color.B]) / 255.0
plt.figure(); plt.imshow(color_block); plt.title(obj_id)
print('%s : %s' % (obj_id, str(color)))
# color_block = np.zeros((100,100, 3)) + np.array([color.R, color.G, color.B]) / 255.0
# plt.figure(); plt.imshow(color_block); plt.title(obj_id)
.. image:: /tutorials/images/sphx_glr_generate_images_tutorial_005.png
:align: center
.. rst-class:: sphx-glr-script-out

Out::

SM_Couch_1seat_5 : (R=255,G=0,B=255,A=255)


Plot only one object
Expand All @@ -386,7 +389,7 @@ Plot only one object
.. image:: /tutorials/images/sphx_glr_generate_images_tutorial_006.png
.. image:: /tutorials/images/sphx_glr_generate_images_tutorial_005.png
:align: center


Expand All @@ -405,7 +408,7 @@ Show all sofas in this image
.. image:: /tutorials/images/sphx_glr_generate_images_tutorial_007.png
.. image:: /tutorials/images/sphx_glr_generate_images_tutorial_006.png
:align: center


Expand All @@ -427,7 +430,7 @@ You can use this to make objects you don't care the same color
.. image:: /tutorials/images/sphx_glr_generate_images_tutorial_008.png
.. image:: /tutorials/images/sphx_glr_generate_images_tutorial_007.png
:align: center


Expand All @@ -447,7 +450,7 @@ Clean up resources
**Total running time of the script:** ( 0 minutes 6.046 seconds)
**Total running time of the script:** ( 0 minutes 6.542 seconds)



Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/tutorials_source/generate_images_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ def match_color(object_mask, target_color, tolerance=3):
# for obj_id in ids:
obj_id = ids[0]
color = id2color[obj_id]
# print('%s : %s' % (obj_id, str(color)))
color_block = np.zeros((100,100, 3)) + np.array([color.R, color.G, color.B]) / 255.0
plt.figure(); plt.imshow(color_block); plt.title(obj_id)
print('%s : %s' % (obj_id, str(color)))
# color_block = np.zeros((100,100, 3)) + np.array([color.R, color.G, color.B]) / 255.0
# plt.figure(); plt.imshow(color_block); plt.title(obj_id)

##############################
# Plot only one object
Expand Down

0 comments on commit e2ebd21

Please sign in to comment.