Skip to content

Commit

Permalink
fix run server
Browse files Browse the repository at this point in the history
  • Loading branch information
Koldim2001 committed Sep 16, 2024
1 parent 4a99f62 commit 1aa8b2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions main_optimized.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def proc_show_node(queue_in: Queue, config: dict):
video_saver_node = VideoSaverNode(config["video_saver_node"])
if show_in_web:
video_server_node = VideoServer(config)
video_server_node.run()
while True:
ts0 = time()
frame_element = queue_in.get()
Expand All @@ -84,7 +83,6 @@ def proc_show_node(queue_in: Queue, config: dict):
video_saver_node.process(frame_element)
if show_in_web:
if isinstance(frame_element, VideoEndBreakElement):
video_server_node.stop_server()
break
video_server_node.update_image(frame_element.frame_result)
ts2 = time()
Expand All @@ -96,7 +94,7 @@ def proc_show_node(queue_in: Queue, config: dict):
+ f"put {(time()-ts2) * 1000:.0f}"
)
if isinstance(frame_element, VideoEndBreakElement):
break
break


@hydra.main(version_base=None, config_path="configs", config_name="app_config")
Expand Down
2 changes: 2 additions & 0 deletions nodes/FlaskServerVideoNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def __init__(self, config):
self.host_ip = config_server["host_ip"]
self.port = config_server["port"]
self.index_page = config_server["index_page"]

self._frame = np.zeros(shape=(640, 480), dtype=np.uint8)
self.run()

def _index(self) -> str:
return render_template(self.index_page)
Expand Down
1 change: 1 addition & 0 deletions nodes/SendInfoDBNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(self, config: dict) -> None:
try:
self.cursor.execute(drop_table_query)
self.connection.commit()
logger.info(f"The table has been deleted")
except (Exception, psycopg2.Error) as error:
logger.error(f"Error while dropping table:: {error}")

Expand Down

0 comments on commit 1aa8b2e

Please sign in to comment.