Skip to content

Commit

Permalink
evc: defaults to slim logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dendenxu committed Apr 6, 2024
1 parent 5709559 commit 19e1a58
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions easyvolcap/runners/volumetric_video_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1463,14 +1463,14 @@ def init_glfw(self):
# Decide GL+GLSL versions
# GL 3.3 + GLSL 330
self.glsl_version = '#version 330'
glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 3)
glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 3)
glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_COMPAT_PROFILE) # // 3.2+ only
glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, 1) # 1 is gl.GL_TRUE
# glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 3)
# glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 3)
# glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_COMPAT_PROFILE) # // 3.2+ only
# glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, 1) # 1 is gl.GL_TRUE

# Create a windowed mode window and its OpenGL context
window = glfw.create_window(self.W, self.H, self.window_title, None, None)
if window is None:
if not window:
glfw.terminate()
log(red('Could not initialize window'))
raise RuntimeError('Failed to initialize window in glfw')
Expand Down
12 changes: 6 additions & 6 deletions easyvolcap/runners/websocket_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def render_loop(self): # this is the main thread
fps = frame_cnt / pass_time
frame_cnt = 0
prev_time = curr_time
log(f'Render FPS: {fps}')
log(self.camera.H, self.camera.W)
log(self.image.sum())
log('Renderer FPS:', fps)
log('Renderer camera shape:', self.camera.H, self.camera.W)
log('Renderer image sum:', self.image.sum())

async def server_loop(self, websocket: websockets.WebSocket, path: str):
frame_cnt = 0
Expand All @@ -147,9 +147,9 @@ async def server_loop(self, websocket: websockets.WebSocket, path: str):
fps = frame_cnt / pass_time
frame_cnt = 0
prev_time = curr_time
log(f'Send FPS: {fps}')
log(self.camera.H, self.camera.W)
log(self.image.sum())
log('Server FPS:', fps)
log('Server camera shape:', self.camera.H, self.camera.W)
log('Server image sum:', self.image.sum())

def render(self, batch: dotdict):
batch = to_cuda(add_iter(add_batch(batch), 0, 1)) # int -> tensor -> add batch -> cuda, smalle operations are much faster on cpu
Expand Down
10 changes: 5 additions & 5 deletions easyvolcap/utils/console_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def dumps(self, obj: Union[dict, dotdict]):

slim_width = 140
verbose_width = None
slim_log_time = False
slim_log_path = False
slim_log_time = True
slim_log_path = True
slim_time_format = '%H:%M:%S'
# slim_time_format = ''
verbose_time_format = '%Y-%m-%d %H:%M:%S.%f'
Expand Down Expand Up @@ -143,7 +143,7 @@ def stop_live():

def start_live():
global live
if live is not None:
if live is not None:
live.start()
return
live = Live(console=console, refresh_per_second=1)
Expand Down Expand Up @@ -206,7 +206,7 @@ def enable_progress():
progress_disabled = False


verbose_log = True
verbose_log = False


def disable_verbose_log():
Expand All @@ -227,7 +227,7 @@ def enable_verbose_log():
console._log_render.time_format = verbose_time_format


enable_verbose_log()
disable_verbose_log()


def set_trace(*args, **kwargs):
Expand Down

0 comments on commit 19e1a58

Please sign in to comment.