forked from xuhaocuhk/TilinGNN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tiling-GUI.py
573 lines (464 loc) · 25.5 KB
/
Tiling-GUI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
import os
import tiling.tile_factory as factory
from tiling.brick_layout import BrickLayout
from shapely.geometry import Polygon, LineString
from solver.ml_solver.ml_solver import ML_Solver
from util.debugger import MyDebugger
from interfaces.qt_plot import Plotter
from interfaces.qt_plot import get_scale_translation_polygons
import numpy as np
import sys, math
from PyQt5.QtCore import Qt, QPoint, QSize
from PyQt5.QtGui import QCursor, QPainter, QPolygon, QPen, QColor, QKeyEvent, QPixmap, QBrush
from PyQt5.QtWidgets import QWidget, QLCDNumber, QSlider, \
QVBoxLayout, QApplication, QPushButton, QFileDialog, QInputDialog, QMainWindow
from util.data_util import write_brick_layout_data, load_bricklayout
from inputs import config
from interfaces import figure_config as fig_conf
from copy import deepcopy
from inputs.shape_factory import export_contour_as_text
import torch
import traceback
import itertools
import pickle
from shapely.affinity import translate, scale, rotate
SIMPLIFY_RATIO = 5e-3
scale_ratio = 0.02
rotation_angle_ratio = 3
translation_ratio = 0.05
solution_color = "figure_blue"
class DrawerWidgets(QMainWindow):
def __init__(self, graph, debugger : MyDebugger, plotter : Plotter, solver, app : QApplication):
super(QMainWindow, self).__init__()
self.setMinimumSize(QSize(800, 800))
self.complete_graph = graph
self.debugger = debugger
self.plotter = plotter
self.current_polygon_exterior = []
self.current_polygon_interiors = []
self.scale = None
self.translation = None
self.current_best_solution = None
self.initUI()
self.app = app
########################## PENS #############################
self.grid_pen = QPen(QColor(120, 120, 120, 255), 1)
self.external_contour_pen = QPen(QColor(220,20,60, 255), 3)
self.external_point_pen = QPen(QColor(220,20,60, 255), 8)
self.internal_contour_pen = QPen(QColor(34,139,34, 255), 3)
self.internal_point_pen = QPen(QColor(34,139,34, 255), 8)
self.selected_point_pen = QPen(QColor(0, 0, 255, 255), 8)
######################## MOUSE ##############################
self.mouse_mode = 'EDIT'
self.current_selected_tuple = None
######################## SOLVING ##############################
self.current_brick_layout = None
self.current_solution_layout = None
self.solver = solver
self.brick_layout_cnt = 0
self.solution_cnt = 0
self.window_width = None
self.window_height = None
self.pixmap = QPixmap(self.size())
self.pixmap.fill(Qt.transparent)
self.need_draw_grid = True
######################## RESULT PENS ##########################
self.types = ('lightgreen', 'green', 'lightblue', 'blue', "blue_trans",
'pink_red', 'purple', 'violet', 'green_blue', 'orange', 'yellow', 'light_gray',
'pink_blue', 'white', 'white_border', 'light_gray_border', 'figure_blue')
self.pens = {
type: QPen(QColor(*getattr(fig_conf, type)['edge'])) for type in self.types
}
self.brushes = {
type: QBrush(QColor(*getattr(fig_conf, type)['face'])) for type in self.types
}
for pen in self.pens.values():
pen.setWidth(fig_conf.edge_width)
###################### Scaling ###############################
self.polygon_scale = 1.0
self.polygon_rotation_angle = 0.0
self.polygon_translation_x_delta = 0.0
self.polygon_translation_y_delta = 0.0
self.graph_x_min, self.graph_x_max, self.graph_y_min, self.graph_y_max = factory.get_graph_bound(self.complete_graph)
def initUI(self):
self.setWindowTitle('Tiling Interface')
self.setWindowFlags(self.windowFlags())
self.show()
######################### MOUSE ########################################
def mousePressEvent(self, QMouseEvent):
if self.mouse_mode == 'DRAW':
self.add_Point(QMouseEvent.pos().x(), QMouseEvent.pos().y())
elif self.mouse_mode == 'EDIT':
self.current_selected_tuple = self.selectPoint(QMouseEvent.pos().x(), QMouseEvent.pos().y())
else:
print("Something go wrong in mouse click!")
def mouseMoveEvent(self, QMouseEvent):
if self.current_selected_tuple is not None:
self.updatePointPos(QMouseEvent.pos().x(), QMouseEvent.pos().y(), self.current_selected_tuple)
def mouseReleaseEvent(self, QMouseEvent):
self.current_selected_tuple = None
self.repaint()
######################### KEY PRESS ########################################
def keyPressEvent(self, event):
# print(event)
if type(event) == QKeyEvent:
# here accept the event and do something
if event.key() == ord('E'):
if self.current_polygon_exterior is not None:
self.compute_Brick_Layout()
elif event.key() == ord('S'):
if self.current_brick_layout is not None:
self.current_solution_layout = self.solve_Brick_Layout(self.current_brick_layout)
elif event.key() == ord('R'):
self.current_polygon_exterior.clear()
self.current_polygon_interiors.clear()
self.current_brick_layout = None
self.repaint()
elif event.key() == ord('O'):
self.open_silhouette_files()
elif event.key() == ord('L'):
self.load_brick_layout()
elif event.key() == ord('M'):
if self.mouse_mode == 'DRAW':
self.mouse_mode = 'EDIT'
elif self.mouse_mode == 'EDIT':
self.mouse_mode = 'DRAW'
elif event.key() == ord('Z'):
self.affline_transform(scale_rate = scale_ratio)
elif event.key() == ord('X'):
self.affline_transform(scale_rate = - scale_ratio)
elif event.key() == ord('='):
self.affline_transform(rotation_angle = rotation_angle_ratio)
elif event.key() == ord('-'):
self.affline_transform(rotation_angle = - rotation_angle_ratio)
elif event.key() == Qt.Key_Up:
self.affline_transform(translation_y_rate = - translation_ratio)
elif event.key() == Qt.Key_Down:
self.affline_transform(translation_y_rate = translation_ratio)
elif event.key() == Qt.Key_Left:
self.affline_transform(translation_x_rate = - translation_ratio)
elif event.key() == Qt.Key_Right:
self.affline_transform(translation_x_rate = translation_ratio)
event.accept()
else:
event.ignore()
def affline_transform(self, scale_rate = None, translation_x_rate = None, translation_y_rate = None, rotation_angle = None):
scale_rate = 1.0 if scale_rate is None else 1 + scale_rate
translation_x_rate = 0.0 if translation_x_rate is None else translation_x_rate
translation_y_rate = 0.0 if translation_y_rate is None else translation_y_rate
rotation_angle = 0.0 if rotation_angle is None else rotation_angle
self.current_polygon_exterior = DrawerWidgets.transform_shape(self.current_polygon_exterior, scale_rate, rotation_angle, translation_x_rate, translation_y_rate)
self.current_polygon_interiors = [DrawerWidgets.transform_shape(interior, scale_rate, rotation_angle, translation_x_rate, translation_y_rate,
LineString(self.current_polygon_exterior).centroid) for interior in self.current_polygon_interiors]
self.repaint()
@staticmethod
def transform_shape(shape, scale_rate, rotation_rate, translation_rate_x, translation_rate_y, center_point = 'centroid'):
shape = LineString(shape)
print(f'before : {np.array(shape.coords)}')
shape = scale(shape, scale_rate, scale_rate, origin = center_point)
shape = rotate(shape, rotation_rate, origin = center_point)
shape = translate(shape, translation_rate_x, translation_rate_y)
print(f'after : {np.array(shape.coords)}')
output_coords = list(np.array(shape.coords))
return output_coords
######################### PAINT ########################################
def paintEvent(self, event):
painter = QPainter(self)
# complete graph ratio
scale, translation = self._get_scale_translation()
if self.need_draw_grid:
self.draw_grid(scale, translation)
painter.drawPixmap(QPoint(), self.pixmap)
############ EXTERIOR #################################
painter.setPen(self.external_contour_pen)
exterior_coords_on_screen = [QPoint(*tuple(p * scale + translation)) for p in self.current_polygon_exterior]
painter.drawPolyline(QPolygon(exterior_coords_on_screen))
############ INTERIOR #################################
painter.setPen(self.internal_contour_pen)
interior_coords_list = []
for current_polygon_interior in self.current_polygon_interiors:
interior_coords_on_screen = [QPoint(*tuple(p * scale + translation)) for p in current_polygon_interior]
painter.drawPolyline(QPolygon(interior_coords_on_screen))
interior_coords_list.append(interior_coords_on_screen)
####################### Points of each point ##########
# Draw selected Point in different color
if self.current_selected_tuple is not None and self.current_selected_tuple[0] == 'exterior':
exterior_coords_on_screen = self.draw_exterior_selected_point(exterior_coords_on_screen, painter)
if self.current_selected_tuple is not None and self.current_selected_tuple[0] == 'interior':
interior_coords_list = self.draw_interior_selected_point(interior_coords_list, painter)
painter.setPen(self.external_point_pen)
painter.drawPoints(QPolygon(exterior_coords_on_screen))
painter.setPen(self.internal_point_pen)
for interior_coord in interior_coords_list:
painter.drawPoints(QPolygon(interior_coord))
###################### Each tile in the solution ###############
if self.current_best_solution is not None:
self.draw_solution(painter)
def draw_grid(self, scale, translation):
grid_painter = QPainter(self.pixmap)
grid_painter.setRenderHint(QPainter.Antialiasing)
grid_painter.setRenderHint(QPainter.SmoothPixmapTransform)
############ Draw grids #############################
grid_painter.setPen(self.grid_pen)
polygons = [Plotter.create_polygon(np.array(t.tile_poly.exterior.coords) * scale + translation) for t in
self.complete_graph.tiles]
for p in polygons:
grid_painter.drawPolygon(p)
self.need_draw_grid = False
def draw_solution(self, painter :QPainter):
tiles = self.current_best_solution.get_selected_tiles()
painter.setPen(self.pens[solution_color])
painter.setBrush(self.brushes[solution_color])
scale, translation = self._get_scale_translation(False)
polygons = [Plotter.create_polygon(np.array(t.exterior.coords) * scale + translation) for t in
tiles]
for p in polygons:
painter.drawPolygon(p)
def draw_exterior_selected_point(self, exterior_coords_on_screen, painter):
selected_index = self.current_selected_tuple[1]
### draw the end point in selected color if neccessary
painter.setPen(self.selected_point_pen)
if selected_index == 0 or selected_index == len(self.current_polygon_exterior) - 1:
selected_point = exterior_coords_on_screen.pop(len(self.current_polygon_exterior) - 1)
painter.drawPoint(selected_point)
selected_point = exterior_coords_on_screen.pop(0)
painter.drawPoint(selected_point)
else:
selected_point = exterior_coords_on_screen.pop(selected_index)
painter.drawPoint(selected_point)
return exterior_coords_on_screen
def resizeEvent(self, event):
pixmap = QPixmap(self.size())
pixmap.fill(Qt.transparent)
self.pixmap = pixmap
self.need_draw_grid = True
p = QPainter(pixmap)
p.drawPixmap(QPoint(), self.pixmap)
QMainWindow.resizeEvent(self, event)
self.scale, self.translation = self._get_scale_translation(True)
def draw_interior_selected_point(self, interior_coords_list, painter):
interior_index, point_index = self.current_selected_tuple[1]
### draw the end point in selected color if neccessary
painter.setPen(self.selected_point_pen)
total_len = len(interior_coords_list[interior_index])
if point_index == 0 or point_index == total_len - 1:
selected_point = interior_coords_list[interior_index].pop(total_len - 1)
painter.drawPoint(selected_point)
selected_point = interior_coords_list[interior_index].pop(0)
painter.drawPoint(selected_point)
else:
selected_point = interior_coords_list[interior_index].pop(point_index)
painter.drawPoint(selected_point)
return interior_coords_list
######################### OTHERS ########################################
def open_silhouette_files(self, margin_padding_ratio = None, rotate_angle = None, x_delta = None, y_delta = None):
filename, filetype = QFileDialog.getOpenFileName(self, 'Open File', '/home/edwardhui/data/silhouette/selected_v2')
if margin_padding_ratio is None:
margin_padding_ratio ,ok = QInputDialog.getDouble(self,"Enter a padding ratio","Enter a padding ratio", decimals = 2)
if rotate_angle is None:
rotate_angle, ok = QInputDialog.getDouble(self, "Enter a rotation angle", "Enter a angle")
if x_delta is None:
x_delta, ok = QInputDialog.getDouble(self, "Enter a x axis delta", "Enter a delta")
if y_delta is None:
y_delta, ok = QInputDialog.getDouble(self, "Enter a y axis delta", "Enter a delta")
if margin_padding_ratio is not None and \
rotate_angle is not None and \
x_delta is not None and \
y_delta is not None:
ok = True
tile_bound = self.complete_graph.tiles[0].tile_poly.bounds
tile_delta = min((tile_bound[2] - tile_bound[0]), (tile_bound[3] - tile_bound[1]))
x_delta = x_delta * tile_delta
y_delta = y_delta * tile_delta
if os.path.exists(filename) and ok:
exterior_contour, interior_contours = factory.load_polygons(filename = filename)
base_diameter, target_polygon = factory.shape_transform(self.complete_graph, exterior_contour, interior_contours,
margin_padding_ratio, rotate_angle, x_delta,
y_delta)
# simplify the output
target_polygon = target_polygon.simplify(base_diameter * SIMPLIFY_RATIO)
self.current_polygon_exterior = list(np.array(target_polygon.exterior.coords))
self.current_polygon_interiors = list(map(lambda interior : list(np.array(interior.coords)), target_polygon.interiors))
self.repaint()
else:
print(f"{filename} is not silhouette file.")
def _get_scale_translation(self, need_recaluate = False):
if self.scale is None or self.translation is None or need_recaluate:
scale, translation = get_scale_translation_polygons(
[np.array(t.tile_poly.exterior.coords) for t in self.complete_graph.tiles],
self
)
translation = np.array(translation)
self.scale, self.translation = scale, translation
return scale, translation
else:
return self.scale, self.translation
def selectPoint(self, mouseX, mouseY):
output_index = None
mouse_world_pos = self.getMousePosWorld(mouseX, mouseY)
### EXTERIORS
exterior_point_min_index = None
distance_for_exterior = []
if len(self.current_polygon_exterior) > 0:
distance_for_exterior = list(map(lambda point : np.linalg.norm(mouse_world_pos-point), self.current_polygon_exterior))
exterior_point_min_index = int(np.argmin(distance_for_exterior))
### INTERIORS
interior_point_minimum = None
distance_for_all_interiors = []
if len(self.current_polygon_interiors) > 0:
for idx, interior_coords in enumerate(self.current_polygon_interiors):
distance_for_interior = list(map(lambda point : np.linalg.norm(mouse_world_pos-point), interior_coords))
interior_point_min_index = int(np.argmin(distance_for_interior))
distance_for_all_interiors.append((distance_for_interior[interior_point_min_index], idx, interior_point_min_index))
interior_point_minimum = sorted(distance_for_all_interiors, key = lambda tup: tup[0])[0]
### check whether internal or external
if exterior_point_min_index is not None:
assert len(distance_for_exterior) > 0
## return exterior
if interior_point_minimum is not None:
if distance_for_exterior[exterior_point_min_index] < interior_point_minimum[0]:
output_index = ('exterior', exterior_point_min_index)
else:
output_index = ('interior', (interior_point_minimum[1], interior_point_minimum[2]))
else:
output_index = ('exterior', exterior_point_min_index)
return output_index
def getMousePosWorld(self, mouseX, mouseY):
scale, translation = self._get_scale_translation()
mouse_pos = np.array([mouseX, mouseY])
mouse_world_pos = (mouse_pos - translation) / scale
return mouse_world_pos
def updatePointPos(self, mouseX, mouseY, update_tuple):
mouse_world_pos = self.getMousePosWorld(mouseX, mouseY)
update_type, update_index = update_tuple
if update_type == 'exterior':
self.current_polygon_exterior[update_index] = mouse_world_pos
## update the index for head and end as well
if update_index == 0 or update_index == len(self.current_polygon_exterior) - 1:
self.current_polygon_exterior[len(self.current_polygon_exterior) - 1 - update_index] = mouse_world_pos
elif update_type == 'interior':
total_len = len(self.current_polygon_interiors[update_index[0]])
self.current_polygon_interiors[update_index[0]][update_index[1]] = mouse_world_pos
## update the index for head and end as well
if update_index[1] == 0 or update_index[1] == total_len - 1:
self.current_polygon_interiors[update_index[0]][total_len - 1 - update_index[1]] = mouse_world_pos
else:
print("Something goes wrong!")
# redraw
self.repaint()
def add_Point(self, x, y):
mouse_pos = np.array([x , y])
# add the points in world space
scale, translation = self._get_scale_translation()
### Remove last element if needed
if len(self.current_polygon_exterior) >= 3:
self.current_polygon_exterior.pop()
self.current_polygon_exterior.append((mouse_pos - translation) / scale)
### add the first point necessary
if len(self.current_polygon_exterior) >= 3:
self.current_polygon_exterior.append(self.current_polygon_exterior[0])
self.repaint()
def compute_Brick_Layout(self):
target_polygon = Polygon(self.current_polygon_exterior, holes=self.current_polygon_interiors)
file_prefix = f'target_shpape_{self.brick_layout_cnt}'
try:
node_feature, collide_edge_index, collide_edge_features, align_edge_index, align_edge_features, re_index = \
factory.create_brick_layout_from_polygon(self.complete_graph, target_polygon)
except:
print(traceback.format_exc())
return
#### Saving contour
export_contour_as_text(self.debugger.file_path(f'contour_{self.brick_layout_cnt}.txt'), (self.current_polygon_exterior, self.current_polygon_interiors))
self.current_brick_layout = BrickLayout(self.complete_graph, node_feature, collide_edge_index,
collide_edge_features,
align_edge_index, align_edge_features, re_index, target_polygon = target_polygon)
factory.save_all_layout_info(file_prefix, self.current_brick_layout, self.debugger.file_path('./'), with_features = False)
# visual_brick_layout_graph(brick_layout = self.current_brick_layout, save_path = self.debugger.file_path('./graph.png'))
self.brick_layout_cnt += 1
self.solution_cnt = 0
self.current_brick_layout.show_candidate_tiles(self.plotter, self.debugger,
f'{self.brick_layout_cnt}_super_graph.png',
style="blue_trans")
self.plotter.draw_contours(self.debugger.file_path(
f'generated_shape_{self.brick_layout_cnt}.png'),
[('green', np.array(target_polygon.exterior.coords))])
def solve_Brick_Layout(self, brick_layout, trial_times = None):
if trial_times is None:
trial_times, ok = QInputDialog.getInt(self, "Enter number of trial time", "Enter number of trial time")
else:
ok = True
if ok:
current_max_score = 0.0
for i in range(trial_times):
# all dirs
save_path = debugger.file_path('./')
self.solution_cnt += 1
result_brick_layout, score = self.solver.solve(brick_layout)
if score != 0:
if current_max_score < score:
current_max_score = score
self.current_best_solution = deepcopy(result_brick_layout)
self.repaint()
self.app.processEvents()
print(f"current_max_score : {current_max_score}")
result_brick_layout.show_predict(plotter, self.debugger, os.path.join(save_path,
f'{score}_{self.brick_layout_cnt}_{self.solution_cnt}_predict.png'))
result_brick_layout.show_super_contour(plotter, self.debugger, os.path.join(save_path,
f'{score}_{self.brick_layout_cnt}_{self.solution_cnt}_super_contour.png'))
result_brick_layout.show_candidate_tiles(plotter, self.debugger, os.path.join(save_path,
f'{score}_{self.brick_layout_cnt}_{self.solution_cnt}_super_graph.png'))
file_prefix = f'{score}_{self.brick_layout_cnt}_{self.solution_cnt}'
factory.save_all_layout_info(file_prefix = file_prefix, result_brick_layout = result_brick_layout, save_path = save_path, with_features = False)
return result_brick_layout
else:
return None
def load_brick_layout(self):
filename, filetype = QFileDialog.getOpenFileName(self, 'Open File')
if os.path.exists(filename):
self.current_brick_layout = load_bricklayout(filename, self.complete_graph)
polygon = self.current_brick_layout.get_super_contour_poly()
self.current_polygon_exterior = list(np.array(polygon.exterior.coords))
self.current_polygon_interiors = list(map(lambda interior : list(np.array(interior)), polygon.interiors))
self.repaint()
print(f"{filename} loaded!")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
'''
Instructions here
Keys:
E : cropping the superset according to current shape
S : solve the tiling problem by TilinGNN
R : clear the draw shape and solution
O : open a shape file in txt format
L : load a precomputed layout file
M : change mode (Edit mode <-> Draw mode)
Z/X : scale up/ down
-/= : rotate clockwise/anti-clockwise
UP/DOWN/LEFT/RIGHT : translate up/down/left/right
Mouse:
Edit mode:
right click : add a new point to the location
Draw mode:
right drag an existing point : change the location of that point
Procedure for solving drawing shapes:
1. Change to drawing mode by Key M
2. Draw the shape that you like
3. Transform by the shapes (Z/X, -/=, UP/DOWN/LEFT/RIGHT) or edit the shapes in Edit mode
4. Crop superset by Key E
5. Solve the problem by Key S (with number of trials)
Procedure for solving silhouette shapes:
1. Load the txt file in the ./silhouette folder by Key O
2. Transform by the shapes (Z/X, -/=, UP/DOWN/LEFT/RIGHT) or edit the shapes in Edit mode
3. Crop superset by Key E
4. Solve the problem by Key S (with number of trials)
'''
if __name__ == "__main__":
MyDebugger.pre_fix = os.path.join(MyDebugger.pre_fix, "debug")
debugger = MyDebugger("UI_interface", fix_rand_seed=0, save_print_to_file = False)
plotter = Plotter()
data_env = config.environment
data_env.load_complete_graph(config.complete_graph_size)
solver = ML_Solver(debugger, device, data_env.complete_graph, None, num_prob_maps = 1)
solver.load_saved_network(config.network_path)
app = QApplication(sys.argv)
draw = DrawerWidgets(data_env.complete_graph, debugger, plotter, solver, app)
sys.exit(app.exec_())