-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea5864c
commit 77e0cce
Showing
66 changed files
with
4,448 additions
and
2,832 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,44 @@ | ||
import shutil | ||
import os | ||
import threading | ||
import time | ||
from supervisely import Application | ||
|
||
from src.ui.ui import layout | ||
from src.ui.tabs.configure import update_metas, update_nodes | ||
from src.ui.tabs.json_preview import load_json | ||
import src.globals as g | ||
|
||
shutil.rmtree(g.STATIC_DIR, ignore_errors=True) | ||
os.mkdir(g.STATIC_DIR) | ||
app = Application(layout=layout, static_dir=g.STATIC_DIR) | ||
|
||
|
||
def _update_f(): | ||
while True: | ||
updates = [] | ||
while not g.update_queue.empty(): | ||
updates.append(g.update_queue.get()) | ||
if len(updates) == 0: | ||
time.sleep(0.1) | ||
continue | ||
try: | ||
if "load_json" in updates: | ||
load_json() | ||
elif "nodes" in updates: | ||
update_nodes() | ||
else: | ||
update_metas() | ||
finally: | ||
for _ in range(len(updates)): | ||
g.update_queue.task_done() | ||
time.sleep(0.1) | ||
|
||
|
||
update_loop = threading.Thread( | ||
target=_update_f, | ||
name="App update loop", | ||
daemon=True, | ||
) | ||
|
||
update_loop.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.