Ejemplo n.º 1
0
def get_conf():
    # Chemin courrant
    abs_path = MyTools().get_absolute_path(__file__)
    print("Chemin courrant", abs_path)

    # Nom du script
    name = os.path.basename(abs_path)
    print("Nom de ce script:", name)

    # Abs path de semaphore sans / à la fin
    parts = abs_path.split("mon_semaphore")
    print("parts", parts)
    gl.root = os.path.join(parts[0], "mon_semaphore")
    print("Path de semaphore:", gl.root)
Ejemplo n.º 2
0
def get_conf():
    """Récupère la configuration depuis le fichier *.ini."""

    # Chemin courrant
    abs_path = MyTools().get_absolute_path(__file__)
    print("Chemin courrant", abs_path)

    # Nom du script
    name = os.path.basename(abs_path)
    print("Nom de ce script:", name)

    # Abs path de semaphore sans / à la fin
    parts = abs_path.split("semaphore")
    gl.root = os.path.join(parts[0], "semaphore")
    print("Path de semaphore:", gl.root)

    # Dossier *.ini
    ini_file = os.path.join(gl.root, "global.ini")
    gl.ma_conf = MyConfig(ini_file)
    gl.conf = gl.ma_conf.conf

    print("\nConfiguration du jeu semaphore:")
    print(gl.conf, "\n")
Ejemplo n.º 3
0
            i += 1

            # Save
            new_shot = self.get_new_name(shot)
            print(new_shot)
            cv2.imwrite(new_shot, img_out)


if __name__ == "__main__":

    SIZE = 40

    # Chemin courrant
    abs_path = MyTools().get_absolute_path(__file__)
    print("Chemin courrant", abs_path)

    # Nom du script
    name = os.path.basename(abs_path)
    print("Nom de ce script:", name)

    # Abs path de semaphore sans / à la fin
    parts = abs_path.split("semaphore")
    root = os.path.join(parts[0], "semaphore")
    print("Path de semaphore:", root)

    print("\nResize de toutes les images de  training_shot")

    rts = ResizeTrainingShot(root, SIZE)
    rts.batch()
    print("Done")