diff --git a/models/live.jpg b/models/live.jpg index 255f0fb..9501e56 100644 Binary files a/models/live.jpg and b/models/live.jpg differ diff --git a/src/garage.py b/src/garage.py index 5a39da3..0421e5e 100644 --- a/src/garage.py +++ b/src/garage.py @@ -27,15 +27,15 @@ SECONDARY_COLOR_SLIDER = (380, 380 + TEAM_OFFSET) ITEM_X = (200, 450, 700) ITEM_Y = (300, 580, 860) -NB_STICKERS = (0, 0, 2, 4) +NB_STICKERS = (3, 3, 8, 0, 3, 3, 0, 3) NB_WHEELS = 23 NB_HATS = 23 NB_TEAMS = 2 DELAY = 0.1 -NB_PRIMARY_COLORS = 3 -NB_SECONDARY_COLORS = 1 +NB_PRIMARY_COLORS = 10 +NB_SECONDARY_COLORS = 10 old_model = None old_sticker = None @@ -235,8 +235,21 @@ def generate_loadouts(): if __name__ == "__main__": - startup() - loadouts, _ = generate_loadouts() - for (wheel, (model, sticker), hat, team, primary_color, secondary_color) in loadouts: + startup(need_focus=False) + + running = True + + while running: + + loadouts, nb_loadouts = generate_loadouts() + + # skip some cars + skip = np.random.randint(0, nb_loadouts) + for _ in range(skip): + next(loadouts) + + input("Press Enter to continue...") + + (wheel, (model, sticker), hat, team, primary_color, secondary_color) = next(loadouts) print(f"next loadout: {(wheel, (model, sticker), hat, team, primary_color, secondary_color)}") newCar(model, sticker, wheel, hat, team, primary_color, secondary_color) diff --git a/src/live.py b/src/live.py index 623092d..b1e8fca 100644 --- a/src/live.py +++ b/src/live.py @@ -1,3 +1,4 @@ +import os import subprocess import time @@ -29,7 +30,7 @@ X = np.zeros((1, RESIZED_SIZE[1], RESIZED_SIZE[0], RESIZED_SIZE[2])) while running: utils.screenshot(filename="live", folder=MODELS_PATH) - time.sleep(1) + # time.sleep(1) # Lecture de l'image img = PIL.Image.open(MODELS_PATH + "/live.jpg") @@ -43,8 +44,7 @@ while running: index = int(np.dot(Y, np.array([0, 1, 2, 3]).T)) - print() - print() + os.system("clear") print(f"Model detected : {LABELS[index]}") for i in range(len(LABELS)): print(f"\t- {LABELS[i]} {Y[0,i]:.03f}")