From 77cf4c88edc15b82ff0b5aa2b36b839b51766279 Mon Sep 17 00:00:00 2001 From: Weibo Gao <929817104@qq.com> Date: Fri, 7 Jul 2023 01:38:10 +0800 Subject: [PATCH] fix the ZeroDivisionError occured in int(image_width / aspect_ratio) when aspect_ratio equals zero (#2177) fix the ZeroDivisionError occured in int(image_width / aspect_ratio) Co-authored-by: Web --- nerfstudio/viewer/server/render_state_machine.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nerfstudio/viewer/server/render_state_machine.py b/nerfstudio/viewer/server/render_state_machine.py index 540a8378b..390390d48 100644 --- a/nerfstudio/viewer/server/render_state_machine.py +++ b/nerfstudio/viewer/server/render_state_machine.py @@ -243,6 +243,8 @@ class RenderStateMachine(threading.Thread): image_height: the maximum image height that can be rendered in the time budget image_width: the maximum image width that can be rendered in the time budget """ + if aspect_ratio == 0: + aspect_ratio = 0.001 max_res = self.viewer.control_panel.max_res if self.state == "high": # high res is always static