Beispiel #1
0
 def draw_all(self):
     """
     Method that draws every cell in every layer in the stack and returns the complete map object
     """
     base = Drawer(self.layers.stack[0]).draw_full_layer()
     for i, layer in enumerate(self.layers.stack):
         if isinstance(layer, Layer):
             draw = Drawer(layer)
             layer_image = draw.draw_full_layer()
             base = Image.alpha_composite(base, layer_image)
             self.layer_cache[i] = layer_image
         else:
             layer_image = layer.image
             base = Image.alpha_composite(base, layer_image)
             self.layer_cache[i] = layer_image
     return base
Beispiel #2
0
 def restoreGUI(self):
     """
     * restores already drawn hanging tree from saved game
     * and restores already pressed buttons from saved game
     """
     missed = len(self.__hp.missed)
     if missed > 0:
         drawer = Drawer(self.turtle_screen, self.raw_turtle)
         for i in range(1, missed + 1):
             step_to_draw = {
                 1: drawer.basement,
                 2: drawer.main_bar,
                 3: drawer.upper_bar,
                 4: drawer.rope,
                 5: drawer.head,
                 6: drawer.body,
                 7: drawer.left_foot,
                 8: drawer.right_foot,
                 9: drawer.left_arm,
                 10: drawer.right_arm
             }
             step_to_draw[i]()
     if missed > 0 or len(self.__hp.corrects) > 0:
         for button in self.Buttons.buttons:
             letter = button['text'].lower()
             if letter in self.__hp.missed or letter in self.__hp.corrects:
                 button.config(state='disabled')
Beispiel #3
0
    def processFrame(self, currentTime, frameNumber, ball, players, image,
                     goal, heatmap, touch):
        output = Drawer(image, self.filename)
        output.draw_model(ball)

        for player in players:
            output.draw_model(player)

        if np.any(goal):
            self._log_goal(goal, currentTime)

        if self.shooter_index is not None:
            output.draw_circle(players[self.shooter_index].get_position(), 20)

        self.score = np.add(self.score, goal)

        if touch is not None:
            output.draw_circle(touch.get_position(), 40, (0, 255, 255), 5)
            self.eventLogger.addTouch(currentTime, touch)
            self.touchBuffer.insert(0, touch)
            if len(self.touchBuffer) > self.options['Touch']['BufferSize']:
                self.touchBuffer.pop()

        height, width, channels = image.shape
        self._draw(output, height, currentTime, frameNumber)
        output.show()  #TODO show
Beispiel #4
0
    def __init__(self, world, window = None, do_draw = False, use_simple_physics = False,
                 fps = 60, dt_eps = 0.005, max_dt = 0.25):

        # Constants:
        self.fps = fps
        self.fixed_dt = 1.0 / float(fps)
        self.dt_eps   = dt_eps
        self.max_dt   = max_dt
        # TODO: Copy bitmap so we can reset walls later?
        # self.initial_wall_bitmap = list(world.initial_wall_bitmap) # const copy

        # Variables:

        self.ps = PhysicsState(world)
        # TODO: if use_simple_physics: self.ps = SimplePhysicsState(...)
        self.unused_dt = None

        self.window = window
        if do_draw:
            assert(window is not None)
            self.drawer = Drawer(window)
            # if use_simple_physics:
            #   ...
            # else:
            #   self.ps_to_draw = PhysicsState(None) # Scratch memory
        else:
            self.ps_to_draw = None
            self.drawer     = None

        self.is_paused = True
        self.last_toggle_time = None
Beispiel #5
0
 def run(self, pos1, vel1, pos2, vel2):
     self.screen = pygame.display.set_mode(self.size)
     self.coord_converter = CoordConverter((-10, 10), (-10, 10),
                                           (0, self.screen.get_size()[0]),
                                           (0, self.screen.get_size()[1]))
     pygame.display.set_caption('Relativistic')
     self.engine = Engine(pos1, vel1, pos2, vel2)
     self.time_multiplier = 1.0
     self._drawer = Drawer(self.screen, self.coord_converter)
     self._grapher = Grapher(self.screen, self.coord_converter)
     #self.drawer = Drawer(self.screen, self.coord_converter)
     self.drawer = self._drawer
     self.clock = pygame.time.Clock()
     self.clock.tick(60)
     self.running = True
     while self.running:
         for event in pygame.event.get():
             if event.type == pygame.QUIT:
                 self.running = False
             else:
                 self.interface.handle_event(event)
         self.clock.tick(60)
         if self.drawer is self._drawer:
             self.engine.adjust_bodies()
         self.engine.update(self.clock.get_time() / 1000 *
                            self.time_multiplier)
         self.draw()
Beispiel #6
0
 def __init__(self, sequences, plotter_args=None, drawer_args=None):
     self.sequences = [
         Sequence.from_fasta_file(sequences.file1),
         Sequence.from_fasta_file(sequences.file2)
     ]
     self.plotter = Plotter(plotter_args)
     self.drawer = Drawer(drawer_args)
Beispiel #7
0
    def __init__(self, size, bombs_proportion, no_cursor=False, no_drawing=False):
        random.seed(time.time())
        self.__no_cursor = no_cursor
        self.__no_drawing = no_drawing

        self.__size = size
        if self.__size < MIN_SIZE:
            self.__size = MIN_SIZE
        if self.__size > MAX_SIZE:
            self.__size = MAX_SIZE

        if bombs_proportion < MIN_BOMBS:
            bombs_proportion = MIN_BOMBS
        if bombs_proportion > MAX_BOMBS:
            bombs_proportion = MAX_BOMBS
        self.__bombs_count = int(bombs_proportion * self.__size**2)
        self.__hidden_count = self.__size**2 - self.__bombs_count
        
        self.__grid = [[0 for _ in range(self.__size)] for _ in range(self.__size)]
        self.__grid_mask = [[0 for _ in range(self.__size)] for _ in range(self.__size)]
        self.__bombs_placed = False
        
        self.__cursor = {'x': 0, 'y': 0}
        self.__status = 'in_game'

        self.__drawer = Drawer(self.__size, self.__bombs_count)
        self.__drawer.draw(self.__grid, self.__grid_mask, self.__cursor)
Beispiel #8
0
    def _trackbar_change(self, val):
        hOrSOrV = cv2.getTrackbarPos('H/S/V', 'hsv_trackbars')

        h, s, v = cv2.split(self.hsv)

        low = cv2.getTrackbarPos("LOW", 'hsv_trackbars')
        high = cv2.getTrackbarPos("HIGH", 'hsv_trackbars')

        if hOrSOrV == 0:
            what = h
            self.color_lower[0] = low
            self.color_upper[0] = high
        elif hOrSOrV == 1:
            what = s
            self.color_lower[1] = low
            self.color_upper[1] = high
        else:
            what = v
            self.color_lower[2] = low
            self.color_upper[2] = high

        cv2.imshow("h", what)
        # cv2.imshow("h", whatMask)

        mask = self._get_threshold_mask(self.hsv, self.color_lower,
                                        self.color_upper)

        vis = Drawer(mask, "whatMask", cv2.COLOR_GRAY2RGB)
        vis.draw_text(str(self.color_lower) + "|" + str(self.color_upper))
        vis.show()
Beispiel #9
0
    def g_display(self):
        self.name = 'timeline ' + QString(self.node.name())
        if not self.node.hasChildren():
            self.setStateInfo(self.node.absolute() +
                              ' doesn\'t have any children.')
        else:
            self.vfs = vfs.vfs()

            self.vlayout = QVBoxLayout()
            self.vlayout.setMargin(0)
            self.vlayout.setSpacing(0)

            self.hsplitter = QSplitter()
            self.ploter = PaintArea(self)
            self.options = OptionsLayout(self)

            self.hsplitter.addWidget(self.ploter)
            self.hsplitter.addWidget(self.options)
            self.vlayout.addWidget(self.hsplitter)
            self.setLayout(self.vlayout)
            self.draw = Drawer(self)

            # CountThread compute node amount
            self.countThread = CountThread(self, self.countThreadOver)
            self.populateThread = DataThread(self, self.dataThreadOver)
            self.maxOccThread = MaxOccThread(self, self.maxOccThreadOver)
            self.workerThread = WorkerThread(self)

            #comment it to avoid redraw everytime painter is resized
            self.connect(self.workerThread, SIGNAL('refresh'), self.reDraw)
Beispiel #10
0
    def __init__(self, controller):
        """
        Initializes pygame window,
        including the drawing space and control panel
        """
        self.controller = controller

        pygame.init()
        pygame.display.set_caption("Desktop CNC Miller")
        #create the screen
        self.max_x = 1200
        self.max_y = 600
        self.window = pygame.display.set_mode((self.max_x, self.max_y))
        #set background
        #self.window.fill( (30, 30, 255) )
        self.window.fill((0, 0, 0))

        midpnt = int(self.max_x * 0.6)
        self.drawer_bounds = pygame.Rect(0, 0, midpnt, self.max_y)
        self.control_panel_bounds = pygame.Rect(midpnt, 0, self.max_x - midpnt,
                                                self.max_y)

        self.control_panel = ControlPanel(self.window,
                                          self.control_panel_bounds,
                                          self.controller)
        self.drawer = Drawer(self.window)

        self.control_panel.draw()
Beispiel #11
0
 def init_agent(self):
     self.drawer = Drawer(self)
     self.goal = 0
     self.goal_integral = 0
     self.foods_eaten = 0
     self.food_pos = [random.uniform(0, 1) for _ in range(2)]
     self.agent_pos = [random.uniform(0, 1) for _ in range(2)]
     self.agent_vel = [random.uniform(0, 1) for _ in range(2)]
Beispiel #12
0
def mainLoop(clock, window, sprites, audio):
    run = True
    status = Status.inMenu
    tick = 0

    drawer = Drawer(window)

    hitBoxe = HitBoxe(audio.hitSound, audio.dieSound, audio.pointSound)

    base = Base(sprites.base)
    bird = Bird(sprites.bird, audio.wingSound, hitBoxe)
    pipes = Pipes(sprites.pipe, hitBoxe)
    score = Score(sprites.numbers)

    while run:
        clock.tick(FPS)

        for event in pygame.event.get():
            if event.type == pygame.QUIT or (event.type == pygame.KEYDOWN
                                             and event.key == pygame.K_ESCAPE):
                run = False
            if status == Status.inMenu and event.type == pygame.KEYUP and (
                    event.key == pygame.K_SPACE or event.key == pygame.K_UP):
                status = Status.inGame
            if status == Status.inGame and event.type == pygame.KEYDOWN and (
                    event.key == pygame.K_SPACE or event.key == pygame.K_UP):
                bird.jump()
            if status == Status.inGameOver and event.type == pygame.KEYUP and (
                    event.key == pygame.K_SPACE or event.key == pygame.K_UP):
                status = Status.inMenu
                tick = 0
                base = Base(sprites.base)
                bird = Bird(sprites.bird, audio.wingSound, hitBoxe)
                pipes = Pipes(sprites.pipe, hitBoxe)
                score = Score(sprites.numbers)

        if status == Status.inGame:
            hitBase = hitBoxe.birdHitBase(bird, base)
            hitPipe = hitBoxe.birdHitPipes(bird, pipes)
            hitBoxe.birdPassPipe(bird, pipes.pipes, score)
            if hitBase or hitPipe:
                status = Status.inGameOver
                bird.die()

        if status == Status.inMenu:
            drawer.drawInMenu(sprites.background, sprites.message, base, bird,
                              tick)
        elif status == Status.inGame:
            drawer.drawInGame(sprites.background, base, bird, pipes, score,
                              tick)
        else:
            drawer.drawInGameOver(sprites.background, sprites.gameOver, base,
                                  bird, pipes, score, tick)

        if tick < FPS:
            tick += 1
        else:
            tick = 0
Beispiel #13
0
 def __init__(self, attack_team, defense_team):
     self.player_histograms = []
     self.buckets_per_color = 200
     self.teams_set = False
     self.attacking_idx = 0
     self.teams = []
     self.drawer = Drawer()
     self.attack_team = attack_team
     self.defense_team = defense_team
Beispiel #14
0
 def draw_cache(self):
     """
     Method that draws cached layer images sequentially.
     :return: The cached map image
     """
     cache_base = Drawer(self.layers.stack[0]).draw_full_layer()
     for i in self.layer_cache:
         cache_base = Image.alpha_composite(cache_base, self.layer_cache[i])
     return cache_base
Beispiel #15
0
def main():
    drawer = Drawer()

    # 2nd task - discrete fourier transform
    original_signal_values = [TEST_SIGNAL(i, N) for i in range(N)]
    spectrum = fourier_spectrum(original_signal_values)
    restored_signal_values = [restore_signal(i, spectrum) for i in range(N)]
    harmonic_signals_values = [original_signal_values, restored_signal_values]

    drawer.draw_signal_comparison(harmonic_signals_values, [spectrum], LABELS)

    # 3rd task - discrete fourier transform of polyharmonic
    test_polyharmonic_signal = lambda signal_index, N: polyharmonic_signal(
        signal_index, N, len(TEST_SPECTRUM), TEST_SPECTRUM)

    original_poly_signal_values = [
        test_polyharmonic_signal(i, N) for i in range(N)
    ]
    poly_spectrum = fourier_spectrum(original_poly_signal_values)
    restored_poly_signal_values = [
        restore_signal(i, poly_spectrum) for i in range(N)
    ]
    polyharmonic_signals_values = [
        original_poly_signal_values, restored_poly_signal_values
    ]

    drawer.draw_signal_comparison(polyharmonic_signals_values, [poly_spectrum],
                                  LABELS)

    # 4th task - fast fourier transform of polyharmonic
    fft_spectrum = get_fft_spectrum(original_poly_signal_values)
    restored_fft_poly_signal_values = [
        restore_signal(i, fft_spectrum) for i in range(N)
    ]
    fft_signals_values = [
        original_poly_signal_values, restored_fft_poly_signal_values
    ]

    drawer.draw_signal_comparison(fft_signals_values, [fft_spectrum], LABELS)

    # filter
    original = [test_polyharmonic_signal(i, N) for i in range(N)]
    spectrum = fourier_spectrum(original)
    spectrum_high_filtered = filter_signal(spectrum, lambda x: x < 15)
    high_filtered_signal = [
        restore_signal(i, spectrum_high_filtered) for i in range(N)
    ]
    spectrum_low_filtered = filter_signal(spectrum, lambda x: x > 15)
    low_filtered_signal = [
        restore_signal(i, spectrum_low_filtered) for i in range(N)
    ]
    drawer.draw_filtered((original, spectrum),
                         (high_filtered_signal, spectrum_high_filtered),
                         (low_filtered_signal, spectrum_low_filtered))

    drawer.show()
Beispiel #16
0
 def draw_subsection(self, layer, target):
     """
     :param layer: the index of the layer to draw
     :param target: a dict of co-ordinate and tile target key-value pairs
     :return: an image with only the targeted selection of the targeted layer updated.
     """
     draw = Drawer(self.layers.get_layer(layer))
     self.layer_cache[layer] = draw.draw_sub_section(
         self.layer_cache[layer], target)
     return self.draw_cache()
Beispiel #17
0
    def __init__(self):
        self.game_size = 50
        self.ticks_per_second = 120

        screen_size_x = 800
        screen_size_y = 800

        self.land = Land(self.game_size)
        self.drawer = Drawer(screen_size_x, screen_size_y, self.land)
        self.controller = Controller(self.land, self.drawer)
Beispiel #18
0
def main():
    # tk = Track('tracks/simple_straight/simple_straight.tk')
    # rl = Racingline('tracks/simple_straight/rl01.rl')
    # tk = Track('tracks/simple_90/simple_90.tk')
    # rl = Racingline('tracks/simple_90/rl01.rl')
    tk = Track('tracks/simple_90_narrow/simple_90_narrow.tk')
    rl = Racingline('tracks/simple_90_narrow/rl01.rl')

    # d = Drawer(tk, [rl])
    # d.draw()

    rls = [rl]
    evolution_generation_cnt = 1200
    for generation in range(evolution_generation_cnt):
        rls = Evolutioner.evolution(rls)
        results = []
        for rl in rls:
            res = RacingResult(tk, rl)
            res.race()
            if not res.finished:
                continue
            else:
                results.append(res)
        results.sort(key=lambda x: x.time)
        j = 1
        while True:
            if j >= len(results):
                break
            elif results[j] == results[j - 1]:
                del results[j]
            else:
                j += 1
        if generation < 500:
            max_len = 1
        elif generation < 800:
            max_len = 2
        elif generation < 1000:
            max_len = 5
        elif generation < 1100:
            max_len = 10
        elif generation < 1150:
            max_len = 20
        else:
            max_len = 50
        if len(results) > max_len:
            results = results[:max_len]
        rls.clear()
        for res in results:
            rls.append(res.racingline)

        print('generation: %4d, best time: %7.3f' %
              (generation, results[0].time))

    d = Drawer(tk, rls[:1])
    d.draw()
def setup_enigmapol(stdscr):
    global drawer, screen, bash
    curses.start_color()
    curses.use_default_colors()
    for i in range(0, curses.COLORS):
        curses.init_pair(i + 1, i, -1)
    screen = stdscr
    enigmapol = EnigmaPol()
    bash = Bash()
    drawer = Drawer(screen)
    enigmapol.make_choice()
def main():
    seq = []
    images = glob.glob(path + '*.tif')
    for i in images:
        image = cv2.imread(i, cv2.IMREAD_GRAYSCALE)
        seq.append(image)

    preprocessor = Preprocessor(seq)
    detector = Detector(preprocessor)
    matcher = Matcher(detector)
    drawer = Drawer(matcher, preprocessor)

    masks = preprocessor.get_masks()

    print('Generating all frames and cell states...')
    drawer.load()
    print('Successfully loaded all images')

    # Save all generated images and their masks to disk
    counter = 1
    for g in drawer.get_gen_images():
        annotated = cv2.imwrite(path + f'gen/{counter}.tif', g)
        mask = cv2.imwrite(path + f'gen/{counter}_mask.tif',
                           masks[counter - 1])
        if not annotated or not mask:
            print(f'Failed to save')
        counter += 1
    print('Saved all images')

    # Now standby for user to issue commands for retrieval
    while True:
        string = input(
            'Input a frame and cell ID (optional) separated by a space...\n')
        if string:
            string = string.split(' ')
            frame = int(string[0])
            if len(string) > 1:
                try:
                    id = int(string[1])
                    display_image = drawer.serve(frame, id)
                except ValueError:
                    print(f'Not an integer')
                    display_image = drawer.serve(frame)
            else:
                display_image = drawer.serve(frame)
            # plt.imshow(display_image)
            # plt.axis('off')
            # plt.show()
            # cv2.imshow('image',display_image)
            # cv2.waitKey(0)
            # cv2.destroyAllWindows()

        else:
            break
Beispiel #21
0
 def initialize_agent(self):
     """
     Callback from BaseAgent.__init__()
     TODO does this nested class affect performance?
     """
     # TODO self.initialize_log()
     self.controller_state = SimpleControllerState()
     self.S = State(self.index)
     self.D = Drawer(self.renderer)
     self.P = PygameDrawer()
     self.strategy = None
Beispiel #22
0
    def on_drawing_area_draw(self, da, ctx):
        viewport = Viewport(self.xmin_spin.get_value(),
                            self.xmax_spin.get_value(),
                            self.ymin_spin.get_value(),
                            self.ymax_spin.get_value())
        ctx.set_line_width(1)

        drw = Drawer(viewport, da, ctx)
        drw.draw_axes()

        for poly in self.polys:
            drw.draw_polygon(poly)
            ctx.set_source_rgb(random(), random(), random())
def main():
    params = Params()

    if not os.path.isdir(params.dataset_root):
        raise Exception("Unable to load images from " + params.dataset_root +
                        ": not a directory")

    if not os.path.exists(params.output_dir):
        os.mkdir(params.output_dir)

    if not os.path.isdir(params.output_dir):
        raise Exception("Unable to save results to " + params.output_dir +
                        ": not a directory")

    if (params.dataset == "DIC-C2DH-HeLa"):
        path = params.dataset_root + "/" + str(
            list(params.images_idx.keys())[0])
    elif (params.dataset == "PhC-C2DL-PSC"
          and params.nn_method == "DeepWater"):
        path = params.dataset_root + "/" + str(
            list(params.images_idx.keys())[0])
    else:
        path = params.dataset_root
    # seq = []
    images = glob.glob(path + '/*.tif')
    #sort the order of images
    images = [(int(x[-7:-4]), x) for x in images]
    images.sort(key=lambda x: x[0])
    images = [x[1] for x in images]

    preprocessor = Preprocessor(images, params)
    detector = Detector(preprocessor)
    matcher = Matcher(detector)
    drawer = Drawer(matcher)

    masks = preprocessor.get_masks()

    counter = 1
    while True:
        inp = input('Serving next frame... type a Cell ID to inspect details')
        drawer.next()
        try:
            inp = int(inp)
            display_image = drawer.serve(inp)
        except:
            print(f'Not an integer')
            display_image = drawer.serve()

        plt.imsave(path + f'gen/{counter}.jpg', display_image)
        plt.imsave(path + f'gen/{counter}_mask.jpg', masks[counter])
        counter += 1
Beispiel #24
0
def Detect(img, overlay_text):
	# converting RGB image to grey scale
	grey_img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)

	# locate face and face landmarks
	face = face_recognition.face_locations(grey_img)
	landmarks = face_recognition.face_landmarks(grey_img)

	# calculate (reorder) x1, x2, y1, y2
	for top, right, bottom, left in face:
		x1, x2, y1, y2 = left, right, top, bottom

	# draw the results
	Drawer(img, landmarks, overlay_text, (x1, x2, y1, y2))
 def __init__(self, img1, img2, read, blur):
     if (not read):
         self.img1 = cv2.imread(img1)
         #print(self.img1.shape)
         self.img2 = cv2.imread(img2)
     else:
         self.img1 = img1
         self.img2 = img2
     if (blur):
         self.img1 = cv2.blur(self.img1, MagicConstants.gaussWin)
         self.img2 = cv2.blur(self.img2, MagicConstants.gaussWin)
     # initial points
     self.pts1 = []
     self.pts2 = []
     self.drw = Drawer(self.img1, self.img2)
Beispiel #26
0
    def write(self):
        output = json.dumps(
            output_schema.dump({
                'search_results': self.search_results
            }), indent=2, sort_keys=True
        )

        filename = (self.filename[:-5] if self.filename.endswith('.json') else self.filename) + '_output.json'
        with open(filename, 'w') as f:
            f.write(output)

        drawer = Drawer()
        drawer.write(self.map, self.search_results, self.filename)

        self.logger.info('Results saved!')
Beispiel #27
0
def main():
    points = generate_points()

    drawer = Drawer(WIDTH, HEIGHT, b"Mandelbrot")
    drawer.init_screen()

    count = 0
    for point in points:
        (r, g, b) = hsv_to_rgb(point['color'], 1, 1)
        drawer.draw_point(point['r'], point['i'], r, g, b)
        count += 1
        if count % 1000 == 0:
            print("{0} tys punktów".format(count / 1000))

    drawer.refresh()
    drawer.wait()
Beispiel #28
0
def main():
    # 設定書くと見づらいからプリセットを使う
    preset = Preset()

    # このコメント書いてる時は1~9のプリセット
    optimizer_list, graph = preset.preset_5()

    # 描画のためのセットアップ
    drawer = Drawer(optimizer_list, graph)

    # アニメーション作成
    drawer.animation()

    # 保存
    #drawer.save_animation("optimization.gif", "./")
    # 表示
    drawer.show()
Beispiel #29
0
    def on_drawing_area_draw(self, da, ctx):
        r = da.get_allocation()
        (xmin, xmax) = (self.xmin_spin.get_value(), self.xmax_spin.get_value())
        (ymin, ymax) = (xmin * r.height / r.width, xmax * r.height / r.width)

        viewport = Viewport(
            Camera(
                Vector(self.camx_spin.get_value(), self.camy_spin.get_value(),
                       self.camz_spin.get_value()),
                Vector(self.originx_spin.get_value(),
                       self.originy_spin.get_value(),
                       self.originz_spin.get_value()), self.d_spin.get_value(),
                Vector(0, 0, 1)), xmin, xmax, ymin, ymax)
        ctx.set_line_width(1)

        drw = Drawer(viewport, da, ctx)
        drw.draw_mesh()
        drw.draw_polyhedron(self.polyhedron)
Beispiel #30
0
    def evaluate_result(self):
        for cpd in self.model.get_cpds():
            print("CPD of {variable}:".format(variable=cpd.variable))
            print(cpd)
            accept_node = cpd.variables[0]

            ##3D-dimension
            if len(cpd.values.shape) > 3:
                pass
                # Drawer.draw_3D(cpd.values, x_label=cpd.variables[1],
                #                y_label=cpd.variables[2], z_label=cpd.variables[3])
            ##2D Dimension
            elif len(cpd.values.shape) == 2:
                title = cpd.variables[1] + '----->' + accept_node
                Drawer(title=title,
                       is_show=False,
                       is_save=False,
                       save_path='img/' + title + '.jpg').draw_matrix(
                           cpd.values)