You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed the unrealcv and tried to run the demos.
First, I started the RealisticRendering game with ./playground. Then I ran the following code:
from unrealcv import client
client.connect() # Connect to the game
if not client.isconnected(): # Check if the connection is successfully established
print('UnrealCV server is not running. Run the game from http://unrealcv.github.io first.')
else:
print('Connected.')
filename = client.request('vget /camera/0/lit')
This simple demo can run successfully. As a result, a png figure of the game scene is saved to 'RealisticRendering/LinuxNoEditor/RealisticRendering/Binaries/Linux'. So, it seems that the environment in which I'm running the demo is correct.
However, I don't want to save the image to the hard disk. Instead, I'd like to transfer the image from the server to my algrithm directly. I read your Command List and noticed that the command
vget /camera/0/lit
which I used just now will store the image to the disk. But the command
vget /camera/0/lit png
can return the binary date through socket instead of saving it.
Moreover, I also noticed that in your faster_rcnn.py demo the above mentioned command is use in
res = client.request('vget /camera/0/lit png')
I just want to test this command, so I replaced the faster rcnn part with a function which takes in a image and return it immediately:
def faster_rcnn_detect(ax, frame):
return frame
Except for this modification, the complete code is mainly copied from the communication part of the faster_rcnn.py:
def faster_rcnn_detect(ax, frame):
return frame
def main(img_processor):
def capture_frame(func=None):
res = client.request('vget /camera/0/lit png')
im = read_png(res)
return im
def updatefig(*args):
frame = capture_frame(img_processor)
img_processor(ax, frame)
fig.canvas.draw()
return ax,
fig = plt.figure()
client.connect()
ani = animation.FuncAnimation(fig, updatefig, interval=50, blit=True)
fig, ax = plt.subplots()
plt.axis('off')
plt.tight_layout()
plt.show()
if name == 'main':
main(faster_rcnn_detect)
It is supposed to show the image of the current game scene when I clicked mouse in the game window.
However, the program crashed when I clicked in the game.
I printed the messages between server and client. Before clicking mouse, the client keeps sending messages like:
and receiving long messages seem like binary data.
But once clicked, the received message is:
clicked
It is strange because it does not match the [message_id:message_body] structure. This message can not be parsed so the demo crashed.
Why can't I receive correct message when clicked the mouse?
The text was updated successfully, but these errors were encountered:
I installed the unrealcv and tried to run the demos.
First, I started the RealisticRendering game with ./playground. Then I ran the following code:
This simple demo can run successfully. As a result, a png figure of the game scene is saved to 'RealisticRendering/LinuxNoEditor/RealisticRendering/Binaries/Linux'. So, it seems that the environment in which I'm running the demo is correct.
However, I don't want to save the image to the hard disk. Instead, I'd like to transfer the image from the server to my algrithm directly. I read your Command List and noticed that the command
which I used just now will store the image to the disk. But the command
can return the binary date through socket instead of saving it.
Moreover, I also noticed that in your faster_rcnn.py demo the above mentioned command is use in
I just want to test this command, so I replaced the faster rcnn part with a function which takes in a image and return it immediately:
Except for this modification, the complete code is mainly copied from the communication part of the faster_rcnn.py:
It is supposed to show the image of the current game scene when I clicked mouse in the game window.
However, the program crashed when I clicked in the game.
I printed the messages between server and client. Before clicking mouse, the client keeps sending messages like:
and receiving long messages seem like binary data.
But once clicked, the received message is:
It is strange because it does not match the [message_id:message_body] structure. This message can not be parsed so the demo crashed.
Why can't I receive correct message when clicked the mouse?
The text was updated successfully, but these errors were encountered: