yolo_darknet_sur_un_portable_optimus
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes | ||
yolo_darknet_sur_un_portable_optimus [2019/03/25 11:49] – [Avec GPU avec CUDA avec OPENCV] serge | yolo_darknet_sur_un_portable_optimus [2020/02/04 16:25] – ↷ Liens modifiés en raison d'un déplacement. serge | ||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
**{{tagpage> | **{{tagpage> | ||
</ | </ | ||
+ | <WRAP center round box 60% centeralign> | ||
+ | C'est quoi un sémaphore ? | ||
+ | {{ youtube> | ||
+ | {{ : | ||
+ | </ | ||
+ | \\ \\ | ||
<WRAP center round box 80% centeralign> | <WRAP center round box 80% centeralign> | ||
// | // | ||
+ | //**Test avec des images du sémaphore**// | ||
+ | //**Valable aussi pour un Desktop avec une carte graphique Nvidia**// | ||
</ | </ | ||
+ | |||
+ | |||
+ | |||
=====Considération générales===== | =====Considération générales===== | ||
- | * **Xubuntu 18.04 CUDA 10.0 CUDNN 7.4.1.5 ** Ne pas utiliser | + | * **Xubuntu 18.04 CUDA 10.0 CUDNN 7.4.1.5 |
- | * **Valable aussi pour un Desktop avec une carte graphique Nvidia** | + | * **Ne pas utiliser |
- | * **Ubuntu est nécessaire pour avoir le driver Nvidia en permanence** | + | * **Sur Ubuntu, l' |
+ | * **Ce tuto a été écrit avec des tests réalisés sur un portable avec une carte 765GTX et sur une tour avec une carte 1060GTX** | ||
=====Ressources et documentation de YOLO Darknet===== | =====Ressources et documentation de YOLO Darknet===== | ||
===Darknet=== | ===Darknet=== | ||
- | * **[[https:// | + | * **[[https:// |
- | * **[[https:// | + | |
- | * **[[https:// | + | |
- | * **[[https:// | + | |
- | ===Portable Optimus=== | + | |
- | * https:// | + | |
- | * https:// | + | |
- | * https:// | + | |
- | * [[https:// | + | |
- | * https:// | + | |
=====Installation de CUDA 10.0 sur Xubuntu 18.04===== | =====Installation de CUDA 10.0 sur Xubuntu 18.04===== | ||
- | * https:// | + | * [[https:// |
====Installation du driver Nvidia==== | ====Installation du driver Nvidia==== | ||
Avec le Gestionnaire de pilotes supplémentaires | Avec le Gestionnaire de pilotes supplémentaires | ||
- | ====Installation==== | + | ====Installation |
+ | Le tout va télécharger 3 à 4 Go ! | ||
< | < | ||
wget https:// | wget https:// | ||
wget http:// | wget http:// | ||
- | </ | ||
- | < | ||
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb | sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb | ||
sudo apt-key adv --fetch-keys http:// | sudo apt-key adv --fetch-keys http:// | ||
Ligne 40: | Ligne 43: | ||
sudo apt-get install --no-install-recommends cuda-10-0 | sudo apt-get install --no-install-recommends cuda-10-0 | ||
sudo apt-get install --no-install-recommends libcudnn7=7.4.1.5-1+cuda10.0 | sudo apt-get install --no-install-recommends libcudnn7=7.4.1.5-1+cuda10.0 | ||
- | sudo apt-get install cmake | + | sudo apt-get install cmake clang python3-pip libopencv-dev libopencv-core-dev libopencv-highgui-dev libopencv-flann-dev libopencv-photo-dev libopencv-video-dev |
- | sudo apt-get | + | sudo pip3 install |
</ | </ | ||
- | ====Premier test sans GPU sans CUDA sans OPENCV==== | + | |
- | Commencer avec une copie des sources originale | + | Après installation, |
- | ===Options de Makefile=== | + | |
- | < | + | Pour faire les mises à jour, il faudrait d' |
- | GPU=0 | + | |
- | CUDNN=0 | + | ====Installation complémentaire pour mes projets==== |
- | CUDNN_HALF=0 | + | Installation de mon module personnel: [[: |
- | OPENCV=0 | + | |
- | AVX=0 | + | |
- | OPENMP=0 | + | |
- | LIBSO=0 | + | =====Installation de YOLO Darknet===== |
- | ZED_CAMERA=0 | + | Dans les [[https://github.com/AlexeyAB/ |
- | </ | + | |
- | ===Compil=== | + | Pour ajouter la libération de la RAM GPU entre 2 détections dans un script python, |
- | < | + | [[Darknet Letters unload GPU RAM in python script|Darknet Letters unload GPU RAM in python script]] |
- | export PATH=/usr/local/ | + | ====Options de Makefile avec GPU avec CUDA avec OPENCV==== |
- | nvcc -V | + | |
- | make | + | |
- | </ | + | |
- | ====Avec GPU avec CUDA sans OPENCV==== | + | |
- | Recommencer avec une copie des sources originale de darknet | + | |
- | ===Options de Makefile=== | + | |
< | < | ||
GPU=1 | GPU=1 | ||
CUDNN=1 | CUDNN=1 | ||
CUDNN_HALF=0 | CUDNN_HALF=0 | ||
- | OPENCV=0 | + | OPENCV=1 |
AVX=0 | AVX=0 | ||
OPENMP=0 | OPENMP=0 | ||
- | LIBSO=0 | + | LIBSO=1 |
ZED_CAMERA=0 | ZED_CAMERA=0 | ||
</ | </ | ||
- | ===Compil=== | + | ====Compil==== |
< | < | ||
export PATH=/ | export PATH=/ | ||
+ | # Vérification du bon fonctionnement de CUDA | ||
+ | nvidia-smi | ||
nvcc -V | nvcc -V | ||
+ | # Pour 8 coeurs | ||
make -j8 | make -j8 | ||
</ | </ | ||
- | ====Avec GPU avec CUDA avec OPENCV==== | + | L' |
- | Recommencer | + | |
- | ===Installation supplémentaire=== | + | Le fichier libdarknet.so de 1060GTX: {{ : |
+ | =====Préparation===== | ||
+ | Voir la page **[[yolo_avec_mes_propres_images|Yolo | ||
+ | |||
+ | Ici nous utilisons **[[https:// | ||
+ | |||
+ | Les axes blanc sont probablement important pour la reconnaissance. | ||
+ | |||
+ | {{media_01: | ||
+ | {{media_01: | ||
+ | {{media_01: | ||
+ | {{media_01: | ||
+ | {{media_01: | ||
+ | |||
+ | **darknet53.conv.74** | ||
+ | wget https:// | ||
+ | Coller le fichier dans le dossier | ||
+ | |||
+ | Créer un dossier axe où nous allons ranger les éléments de notre projet. Pourquoi " | ||
+ | <WRAP group> | ||
+ | <WRAP half column> | ||
+ | **axe/ | ||
+ | Ce fichier définit les chemins vers les fichiers de configuration. | ||
< | < | ||
- | sudo apt-get install python3-pip libopencv-dev libopencv-core-dev libopencv-highgui-dev libopencv-flann-dev libopencv-photo-dev libopencv-video-dev libopencv-dev | + | classes= 27 |
- | sudo pip3 install opencv-python==3.4.5.20 | + | train |
+ | valid | ||
+ | names = axe/obj.names | ||
+ | backup = axe/backup | ||
</ | </ | ||
- | ===Options de Makefile=== | + | </ |
+ | |||
+ | <WRAP half column> | ||
+ | **Créer un fichier axe/ | ||
< | < | ||
- | GPU=1 | + | a |
- | CUDNN=1 | + | space |
- | CUDNN_HALF=0 | + | b |
- | OPENCV=1 | + | c |
- | AVX=0 | + | d |
- | OPENMP=0 | + | etc ..... |
- | LIBSO=0 | + | x |
- | ZED_CAMERA=0 | + | y |
+ | z | ||
</ | </ | ||
- | ===Compil=== | + | </ |
+ | </ | ||
+ | |||
+ | ===train.txt et test.txt=== | ||
+ | Les créer en collant le script **[[https:// | ||
+ | * installer [[: | ||
+ | * adapter le chemin vers le dossier root des images dans le script | ||
+ | python3 create_train_test_txt.py | ||
+ | Les fichiers train.txt et test.txt sont dans le dossier axe. | ||
+ | |||
+ | ===Le fichier *cfg=== | ||
+ | * **[[https:// | ||
+ | Pour avoir Yolo v3 avec: | ||
+ | * Des objets main droite différent des objets main gauche | ||
+ | * Des petits et des grands objets | ||
+ | * vérifier avec le readme de Alexei | ||
+ | |||
+ | =====Training===== | ||
+ | ./darknet detector train axe/ | ||
+ | |||
+ | {{ media_01: | ||
+ | |||
+ | ===Message final=== | ||
< | < | ||
- | export PATH=/ | + | |
- | nvcc -V | + | 6000 |
- | make -j8 | + | |
+ | class_id = 0, name = a, ap = 100.00% | ||
+ | class_id = 1, name = space, ap = 98.59% | ||
+ | class_id = 2, name = b, ap = 100.00% | ||
+ | class_id = 3, name = c, ap = 99.99% | ||
+ | class_id = 4, name = d, ap = 100.00% | ||
+ | class_id = 5, name = e, ap = 86.90% | ||
+ | class_id = 6, name = f, ap = 100.00% | ||
+ | class_id = 7, name = g, ap = 100.00% | ||
+ | class_id = 8, name = h, ap = 100.00% | ||
+ | class_id = 9, name = i, ap = 98.82% | ||
+ | class_id | ||
+ | class_id = 11, name = k, ap = 100.00% | ||
+ | class_id = 12, name = l, ap = 100.00% | ||
+ | class_id = 13, name = m, ap = 100.00% | ||
+ | class_id = 14, name = n, ap = 93.93% | ||
+ | class_id = 15, name = o, ap = 100.00% | ||
+ | class_id = 16, name = p, ap = 100.00% | ||
+ | class_id = 17, name = q, ap = 100.00% | ||
+ | class_id = 18, name = r, ap = 99.52% | ||
+ | class_id = 19, name = s, ap = 100.00% | ||
+ | class_id = 20, name = t, ap = 99.98% | ||
+ | class_id = 21, name = u, ap = 100.00% | ||
+ | class_id = 22, name = v, ap = 74.66% | ||
+ | class_id = 23, name = w, ap = 100.00% | ||
+ | class_id = 24, name = x, ap = 100.00% | ||
+ | class_id = 25, name = y, ap = 100.00% | ||
+ | class_id = 26, name = z, ap = 100.00% | ||
+ | |||
+ | for thresh = 0.25, precision = 0.97, recall = 0.95, F1-score = 0.96 | ||
+ | for thresh = 0.25, TP = 5699, FP = 188, FN = 301, average IoU = 87.69 % | ||
+ | IoU threshold = 50 %, used Area-Under-Curve for each unique Recall | ||
+ | mean average precision (mAP@0.50) = 0.982366, or 98.24 % | ||
+ | | ||
</ | </ | ||
- | =====Contexte===== | + | =====Testing===== |
- | ==== Laptop | + | ====Test sur une image==== |
- | | + | |
- | * Memory Device | + | |
- | * Total Width: 64 bits | + | Le résultat est dans l' |
- | * Size: 8192 MB | + | <WRAP group> |
- | * Type: DDR3 | + | <WRAP half column> |
- | * Speed: 1600 MHz | + | {{media_01:predictions_b_h.jpg? |
- | * Configured Clock Speed: 1600 MHz | + | </ |
- | | + | <WRAP half column> |
- | | + | {{media_01:predictions_space.jpg? |
- | * Ram 7,7 Gio | + | shot_36_space.jpg: Predicted in 58.519000 milli-seconds: |
+ | space: 40% | ||
+ | </ | ||
+ | </ | ||
+ | | ||
+ | ====Test sur une video et enregistrement | ||
+ | | ||
+ | |||
+ | {{ vimeo> | ||
+ | ====Test avec webcam et enregistrement | ||
+ | Pour webcam=0 | ||
+ | ./darknet detector demo axe/ | ||
+ | {{ vimeo> | ||
+ | |||
+ | =====Avec un vrai sémaphore===== | ||
+ | * **[[yolo_darknet_avec_un_vrai_semaphore|Yolo Darknet avec un vrai sémaphore]]** | ||
+ | * **[[https:// | ||
+ | |||
+ | {{tag> ia sb semaphore | ||
- | ====GPU==== | ||
- | * NVIDIA Corporation GK106M [[https:// | ||
- | * Core | ||
- | * Architecture: | ||
- | * CUDA Cores 768 | ||
- | * Clock Freq (MHz) 850 + Boost | ||
- | * Memory | ||
- | * Memory Clock (MHz) 2000 | ||
- | * Standard Memory Configuration GDDR5 | ||
- | * Memory Interface Width 128 bit | ||
- | * Memory Bandwidth (GB/ | ||
- | * Date de présentation: | ||
- | {{tag> ia sb semaphore }} |
yolo_darknet_sur_un_portable_optimus.txt · Dernière modification : 2020/12/27 15:09 de serge