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édente | ||
| yolo_darknet_sur_un_portable_optimus [2019/03/24 11:41] – [Installation du driver Nvidia] serge | yolo_darknet_sur_un_portable_optimus [2020/12/27 15:09] (Version actuelle) – serge | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ======Yolo Darknet sur un portable Optimus====== | ======Yolo Darknet sur un portable Optimus====== | ||
| - | <WRAP center round box 80% centeralign> | + | <WRAP center round box 60% centeralign> |
| - | **{{tagpage> | + | **{{tagpage> |
| </ | </ | ||
| - | <WRAP center round box 80% centeralign> | + | <WRAP center round box 60% centeralign> |
| + | **[[les_pages_intelligence_artificielle_en_details|Les Pages Intelligence Artificielle en détails]]** | ||
| + | </ | ||
| + | |||
| + | <WRAP center round box 60% centeralign> | ||
| + | **{{tagpage> | ||
| + | </ | ||
| + | <WRAP center round box 60% centeralign> | ||
| + | C'est quoi un sémaphore ? | ||
| + | {{ youtube> | ||
| + | {{ media_05: | ||
| + | </ | ||
| + | \\ \\ | ||
| + | <WRAP center round box 60% centeralign> | ||
| // | // | ||
| + | //**Test avec des images du sémaphore**// | ||
| + | //**Valable aussi pour un Desktop avec une carte graphique Nvidia**// | ||
| </ | </ | ||
| - | =====Considération générales===== | ||
| - | * **Ubuntu Mate 18.04 CUDA 10.0 CUDNN 7.0 ** | ||
| - | * **Valable aussi pour un Desktop avec une carte graphique Nvidia** | ||
| - | * **Ubuntu est nécessaire pour avoir le driver Nvidia en permanence** | ||
| - | * CUDA 10.1 et CUDNN 7.5 a été un échec | ||
| - | skipping incompatible / | + | |
| - | signifierait qu'il y a une incompatibilité | + | |
| + | =====Considération générales===== | ||
| + | * **Xubuntu 18.04 CUDA 10.0 CUDNN 7.4.1.5 ** | ||
| + | * **Ne pas utiliser le bureau Mate**, | ||
| + | * **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 | |
| - | + | * [[https:// | |
| - | =====Installation de CUDA 10.0 sur Ubuntu | + | ====Installation du driver Nvidia==== |
| - | Darknet demande **CUDA dans / | + | Avec le Gestionnaire de pilotes supplémentaires |
| - | * https:// | + | ====Installation de cuda,cudnn, opencv-python==== |
| + | Le tout va télécharger 3 à 4 Go ! | ||
| < | < | ||
| - | # Add NVIDIA package repositories | ||
| wget https:// | wget https:// | ||
| + | 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 | + | sudo apt-key adv --fetch-keys |
| sudo apt-get update | sudo apt-get update | ||
| - | wget http:// | ||
| sudo apt install ./ | sudo apt install ./ | ||
| sudo apt-get update | sudo apt-get update | ||
| + | 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 cmake clang python3-pip libopencv-dev libopencv-core-dev libopencv-highgui-dev libopencv-flann-dev libopencv-photo-dev libopencv-video-dev | ||
| + | sudo pip3 install opencv-python==3.4.5.20 scikit-image | ||
| + | </ | ||
| - | # Install NVIDIA driver | + | Après installation, |
| - | sudo apt-get install --no-install-recommends nvidia-driver-410 | + | |
| - | # Reboot. Check that GPUs are visible using the command: nvidia-smi | + | |
| - | # Install development and runtime libraries (~4GB) | + | Pour faire les mises à jour, il faudrait d' |
| - | sudo apt-get install --no-install-recommends \ | + | |
| - | | + | |
| - | libcudnn7=7.4.1.5-1+cuda10.0 | + | |
| - | libcudnn7-dev=7.4.1.5-1+cuda10.0 | + | |
| + | ====Installation complémentaire pour mes projets==== | ||
| + | Installation de mon module personnel: [[: | ||
| - | # Install TensorRT. Requires that libcudnn7 is installed above. | + | |
| - | sudo apt-get update && \ | + | |
| - | sudo apt-get install nvinfer-runtime-trt-repo-ubuntu1804-5.0.2-ga-cuda10.0 \ | + | =====Installation de YOLO Darknet===== |
| - | && | + | Dans les [[https:// |
| - | && | + | |
| + | 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]] | ||
| + | ====Options de Makefile avec GPU avec CUDA avec OPENCV==== | ||
| + | < | ||
| + | GPU=1 | ||
| + | CUDNN=1 | ||
| + | CUDNN_HALF=0 | ||
| + | OPENCV=1 | ||
| + | AVX=0 | ||
| + | OPENMP=0 | ||
| + | LIBSO=1 | ||
| + | ZED_CAMERA=0 | ||
| </ | </ | ||
| - | =====Installation de CUDNN 7.0===== | + | ====Compil==== |
| - | * https://developer.nvidia.com/cudnn | + | < |
| - | * https://developer.nvidia.com/rdp/cudnn-archive | + | export PATH=/ |
| - | * | + | # Vérification du bon fonctionnement de CUDA |
| - | Darknet demande cuDNN v5-v7 et cuDNN dans /usr/local/cudnn | + | nvidia-smi |
| + | nvcc -V | ||
| + | # Pour 8 coeurs | ||
| + | make -j8 | ||
| + | </ | ||
| + | L' | ||
| + | |||
| + | Le fichier libdarknet.so de 1060GTX: {{ media_07: | ||
| + | =====Préparation===== | ||
| + | Voir la page **[[yolo_avec_mes_propres_images|Yolo avec mes propres images]]** pour la construction de **60 000 images 640x640** et des fichiers *.txt correspondants. | ||
| + | |||
| + | Ici nous utilisons **[[https://github.com/ | ||
| + | |||
| + | 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 darknet | ||
| + | |||
| + | 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. | ||
| + | < | ||
| + | classes= 27 | ||
| + | train = axe/ | ||
| + | valid = axe/ | ||
| + | names = axe/ | ||
| + | backup = axe/ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <WRAP half column> | ||
| + | **Créer un fichier axe/ | ||
| + | < | ||
| + | a | ||
| + | space | ||
| + | b | ||
| + | c | ||
| + | d | ||
| + | etc ..... | ||
| + | x | ||
| + | y | ||
| + | z | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===train.txt et test.txt=== | ||
| + | Les créer en collant le script **[[https://github.com/ | ||
| + | * 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 | ||
| + | * vérifier avec le readme de Alexei | ||
| + | |||
| + | =====Training===== | ||
| + | ./darknet detector train axe/ | ||
| + | |||
| + | {{ media_01: | ||
| + | |||
| + | ===Message final=== | ||
| + | < | ||
| + | | ||
| + | 6000 | ||
| + | | ||
| + | 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 = 10, name = j, ap = 100.00% | ||
| + | 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 % | ||
| + | | ||
| + | </ | ||
| + | |||
| + | =====Testing===== | ||
| + | ====Test sur une image==== | ||
| + | ./darknet detector test axe/ | ||
| + | |||
| + | Le résultat est dans l' | ||
| + | <WRAP group> | ||
| + | <WRAP half column> | ||
| + | {{media_01: | ||
| + | </WRAP> | ||
| + | <WRAP half column> | ||
| + | {{media_01: | ||
| + | shot_36_space.jpg: | ||
| + | space: 40% | ||
| + | </WRAP> | ||
| + | </WRAP> | ||
| + | |||
| + | ====Test sur une video et enregistrement du résultat==== | ||
| + | ./darknet detector demo axe/ | ||
| + | |||
| + | {{ vimeo> | ||
| + | ====Test avec webcam et enregistrement du résultat==== | ||
| + | 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 yolo_darknet }} | ||
| - | Il faut avoir un compte sur Nvidia et se loguer pour pouvoir télécharger.\\ | ||
| - | Décompresser, | ||
| - | sudo cp -P / | ||
| - | sudo cp / | ||
| - | sudo chmod a+r / | ||
| - | {{tag> ia sb semaphore }} | ||
yolo_darknet_sur_un_portable_optimus.1553427661.txt.gz · Dernière modification : de serge
