-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_setup.py
More file actions
90 lines (77 loc) · 2.66 KB
/
verify_setup.py
File metadata and controls
90 lines (77 loc) · 2.66 KB
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
import os
import sys
import importlib.util
def check_module(module_name, package_name=None):
"""Vérifie si un module Python est installé"""
if package_name is None:
package_name = module_name
spec = importlib.util.find_spec(module_name)
if spec is not None:
print(f"{package_name}")
return True
else:
print(f" {package_name} - MANQUANT")
return False
def check_file(filepath):
"""Vérifie si un fichier existe"""
if os.path.exists(filepath):
print(f" {filepath}")
return True
else:
print(f" {filepath} - MANQUANT")
return False
def main():
print("=" * 60)
print("Vérification de l'environnement du projet Camera")
print("=" * 60)
all_ok = True
print("\n[1] Vérification des modules Python...")
modules = [
("cv2", "opencv-python"),
("mediapipe", "mediapipe"),
("numpy", "numpy"),
("sklearn", "scikit-learn"),
("joblib", "joblib"),
]
for module, package in modules:
if not check_module(module, package):
all_ok = False
print("\n[2] Vérification des fichiers modèles MediaPipe...")
models = [
"hand_landmarker.task",
"gesture_recognizer.task",
]
for model in models:
if not check_file(model):
all_ok = False
print("\n[3] Vérification des fichiers de données...")
if os.path.exists("data"):
npy_files = [f for f in os.listdir("data") if f.endswith(".npy")]
if npy_files:
print(f"Dossier 'data' avec {len(npy_files)} fichier(s)")
else:
print("Dossier 'data' vide - données d'entraînement manquantes")
else:
print("Dossier 'data' n'existe pas")
print("\n[4] Vérification du modèle ML...")
if check_file("lsf_model.pkl"):
pass
else:
print(" lsf_model.pkl - MANQUANT (À générer avec train.py)")
print("\n" + "=" * 60)
if all_ok:
print("Tous les éléments essentiels sont en place!")
print("\nVous pouvez maintenant lancer:")
print(" - python cam.py (détection mains + visages)")
print(" - python camera.py (détection mains uniquement)")
print(" - python signe.py (reconnaissance de gestes)")
print(" - python predict.py (prédiction LSF)")
return 0
else:
print("Certains éléments manquent!")
print("\nPour corriger, lancez:")
print(" 1. pip install -r requirements.txt")
print(" 2. python download_models.py")
return 1
if __name__ == "__main__":
sys.exit(main())