Skip to content

Commit

Permalink
easyvolcap: working jpeg based socket viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
dendenxu committed Apr 6, 2024
1 parent 5670d2a commit 34b90cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion easyvolcap/runners/websocket_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def __init__(self,
# Socket related initialization
self.host = host
self.port = port
self.recv_port = recv_port

# Initialize server-side camera in case there's lag
self.camera_cfg = camera_cfg
Expand Down
10 changes: 6 additions & 4 deletions scripts/websocket/websocket_client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import cv2
import zlib
import torch
import asyncio
Expand Down Expand Up @@ -121,10 +122,11 @@ def render(self):
global image
event.wait()
event.clear()
image = image.permute(1, 2, 0)
image = torch.cat([image, torch.ones_like(image[..., :1])], dim=-1)
self.quad.copy_to_texture(image)
self.quad.draw()
if image.shape[1] == self.H and image.shape[2] == self.W:
buffer = image.permute(1, 2, 0)
buffer = torch.cat([buffer, torch.ones_like(buffer[..., :1])], dim=-1)
self.quad.copy_to_texture(buffer)
self.quad.draw()
return None, None

def draw_banner_gui(self, batch: dotdict = dotdict(), output: dotdict = dotdict()):
Expand Down

0 comments on commit 34b90cc

Please sign in to comment.