-
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.
Merge pull request #9 from Unimakers/dev
add: ML Pipeline - Robovision
- Loading branch information
Showing
110 changed files
with
248 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,6 @@ | |
.vscode/ipch | ||
.vscode | ||
.cache | ||
docs/site | ||
docs/site | ||
|
||
__pycache__ |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
File renamed without changes
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import dearpygui.dearpygui as dpg | ||
|
||
|
||
class LeftPane: | ||
height: int | None | ||
width: int | ||
|
||
def __init__(self): | ||
self.height = dpg.get_item_height("table") | ||
if self.height is None: | ||
self.height = 720 | ||
|
||
def register(self): | ||
with dpg.texture_registry(show=False): | ||
width, height, _, data = dpg.load_image("assets/logo.png") | ||
dpg.add_static_texture( | ||
width=width, | ||
height=height, | ||
default_value=data, | ||
tag="logo_texture", | ||
) | ||
with dpg.window( | ||
label="RoboVision 0.0.1", | ||
no_close=True, | ||
pos=[0, 0], | ||
width=200, | ||
height=self.height, | ||
no_collapse=True, | ||
no_move=True, | ||
): | ||
dpg.add_image( | ||
"logo_texture", | ||
width=185, | ||
height=32, | ||
tag="logo_img", | ||
) | ||
dpg.add_text(source="mouse_pos") |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import dearpygui.dearpygui as dpg | ||
|
||
TABLE_WIDTH = 3000 | ||
TABLE_HEIGHT = 2000 | ||
TABLE_RATIO = 0.3 | ||
TABLE_VIEW_WIDTH = (int)(TABLE_WIDTH * TABLE_RATIO) | ||
TABLE_VIEW_HEIGHT = (int)(TABLE_HEIGHT * TABLE_RATIO) | ||
TABLE_REAL_RATIO = TABLE_WIDTH / TABLE_VIEW_WIDTH | ||
MARGIN_OFFSET = 30 | ||
robot_pos = [0, 0] | ||
robot_size = [450 * TABLE_RATIO, 450 * TABLE_RATIO] | ||
|
||
|
||
class Table2D: | ||
def register(self): | ||
width, height, _, data = dpg.load_image("assets/table.png") | ||
with dpg.texture_registry(show=False): | ||
dpg.add_static_texture( | ||
width=width, | ||
height=height, | ||
default_value=data, | ||
tag="table_texture", | ||
) | ||
with dpg.window( | ||
label="Table 2D", | ||
tag="table", | ||
pos=[205, 0], | ||
height=640, | ||
no_close=True, | ||
no_move=True, | ||
no_resize=True, | ||
no_collapse=True, | ||
): | ||
dpg.add_image( | ||
"table_texture", | ||
width=TABLE_VIEW_WIDTH, | ||
height=TABLE_VIEW_HEIGHT, | ||
tag="table_img", | ||
) |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from math import floor | ||
import dearpygui.dearpygui as dpg | ||
from components.table import Table2D | ||
from components.leftpane import LeftPane | ||
|
||
|
||
TABLE_WIDTH = 3000 | ||
TABLE_HEIGHT = 2000 | ||
TABLE_RATIO = 0.3 | ||
TABLE_VIEW_WIDTH = (int)(TABLE_WIDTH * TABLE_RATIO) | ||
TABLE_VIEW_HEIGHT = (int)(TABLE_HEIGHT * TABLE_RATIO) | ||
TABLE_REAL_RATIO = TABLE_WIDTH / TABLE_VIEW_WIDTH | ||
MARGIN_OFFSET = 30 | ||
robot_pos = [0, 0] | ||
robot_size = [450 * TABLE_RATIO, 450 * TABLE_RATIO] | ||
|
||
|
||
def main(): | ||
dpg.create_context() | ||
dpg.create_viewport(title="RoboVision") | ||
dpg.setup_dearpygui() | ||
dpg.set_viewport_vsync(True) | ||
dpg.toggle_viewport_fullscreen() | ||
register_values() | ||
register_handlers() | ||
|
||
table = Table2D() | ||
table.register() | ||
leftpane = LeftPane() | ||
leftpane.register() | ||
|
||
dpg.show_viewport() | ||
|
||
dpg.start_dearpygui() | ||
dpg.destroy_context() | ||
|
||
|
||
def handle_mouse_click(sender, data): | ||
if dpg.is_item_hovered("table") and dpg.is_item_focused("table"): | ||
pos = dpg.get_mouse_pos() | ||
x = floor(pos[0] * TABLE_REAL_RATIO) - MARGIN_OFFSET | ||
y = floor(pos[1] * TABLE_REAL_RATIO) - MARGIN_OFFSET | ||
dpg.set_value("mouse_pos", f"MOUSE:{pos}") | ||
|
||
|
||
def register_handlers(): | ||
with dpg.handler_registry(): | ||
dpg.add_mouse_move_handler(callback=handle_mouse_click) | ||
|
||
|
||
def register_values(): | ||
with dpg.value_registry(): | ||
dpg.add_string_value(tag="mouse_pos", default_value="MOUSE:[0.0,0.0]") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.