fix: live et grage (random pick)
This commit is contained in:
parent
bf92ebfed7
commit
0150e3cf20
BIN
models/live.jpg
BIN
models/live.jpg
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
@ -27,15 +27,15 @@ SECONDARY_COLOR_SLIDER = (380, 380 + TEAM_OFFSET)
|
||||||
ITEM_X = (200, 450, 700)
|
ITEM_X = (200, 450, 700)
|
||||||
ITEM_Y = (300, 580, 860)
|
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_WHEELS = 23
|
||||||
NB_HATS = 23
|
NB_HATS = 23
|
||||||
NB_TEAMS = 2
|
NB_TEAMS = 2
|
||||||
|
|
||||||
DELAY = 0.1
|
DELAY = 0.1
|
||||||
|
|
||||||
NB_PRIMARY_COLORS = 3
|
NB_PRIMARY_COLORS = 10
|
||||||
NB_SECONDARY_COLORS = 1
|
NB_SECONDARY_COLORS = 10
|
||||||
|
|
||||||
old_model = None
|
old_model = None
|
||||||
old_sticker = None
|
old_sticker = None
|
||||||
|
@ -235,8 +235,21 @@ def generate_loadouts():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
startup()
|
startup(need_focus=False)
|
||||||
loadouts, _ = generate_loadouts()
|
|
||||||
for (wheel, (model, sticker), hat, team, primary_color, secondary_color) in loadouts:
|
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)}")
|
print(f"next loadout: {(wheel, (model, sticker), hat, team, primary_color, secondary_color)}")
|
||||||
newCar(model, sticker, wheel, hat, team, primary_color, secondary_color)
|
newCar(model, sticker, wheel, hat, team, primary_color, secondary_color)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ X = np.zeros((1, RESIZED_SIZE[1], RESIZED_SIZE[0], RESIZED_SIZE[2]))
|
||||||
while running:
|
while running:
|
||||||
utils.screenshot(filename="live", folder=MODELS_PATH)
|
utils.screenshot(filename="live", folder=MODELS_PATH)
|
||||||
|
|
||||||
time.sleep(1)
|
# time.sleep(1)
|
||||||
|
|
||||||
# Lecture de l'image
|
# Lecture de l'image
|
||||||
img = PIL.Image.open(MODELS_PATH + "/live.jpg")
|
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))
|
index = int(np.dot(Y, np.array([0, 1, 2, 3]).T))
|
||||||
|
|
||||||
print()
|
os.system("clear")
|
||||||
print()
|
|
||||||
print(f"Model detected : {LABELS[index]}")
|
print(f"Model detected : {LABELS[index]}")
|
||||||
for i in range(len(LABELS)):
|
for i in range(len(LABELS)):
|
||||||
print(f"\t- {LABELS[i]} {Y[0,i]:.03f}")
|
print(f"\t- {LABELS[i]} {Y[0,i]:.03f}")
|
||||||
|
|
Loading…
Reference in a new issue