{"id":849,"date":"2020-04-27T02:54:42","date_gmt":"2020-04-26T19:54:42","guid":{"rendered":"http:\/\/miai.vn\/?p=849"},"modified":"2020-04-27T02:54:42","modified_gmt":"2020-04-26T19:54:42","slug":"nhan-dien-deo-khau-trang-face-mask-detection-bang-yolo","status":"publish","type":"post","link":"https:\/\/miai.vn\/?p=849","title":{"rendered":"Re-implement nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO"},"content":{"rendered":"\n<p>Xin ch\u00e0o tu\u1ea7n m\u1edbi c\u00e1c member M\u00ec AI, ch\u1eafc h\u1eb3n g\u1ea7n \u0111\u00e2y anh em c\u00f3 nghe n\u00f3i v\u1ec1 github <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/AIZOOTech\/FaceMaskDetection\" target=\"_blank\">FaceMaskDetection<\/a> c\u1ee7a m\u1ea5y anh China v\u1ec1 nh\u1eadn di\u1ec7n m\u1eb7t \u0111eo kh\u1ea9u trang kh\u00e1 \u0111\u1ec9nh. H\u00f4m nay ch\u00fang ta s\u1ebd c\u00f9ng tri\u1ec3n khai l\u1ea1i Face Mask Detection b\u1eb1ng YOLO nh\u00e9.<\/p>\n\n\n\n<p>M\u00ecnh \u0111\u00e3 c\u00f3 1 b\u00e0i v\u1ec1 nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang\/Face Mask Detection b\u1eb1ng OpenCV \u0111\u01a1n gi\u1ea3n h\u01a1n <strong><a rel=\"noreferrer noopener\" href=\"https:\/\/miai.vn\/2020\/03\/11\/chung-tay-chong-covid-19-lam-thu-he-thong-nhac-deo-khau-trang-bang-opencv\/\" target=\"_blank\">t\u1ea1i \u0111\u00e2y<\/a><\/strong>. C\u00e1c b\u1ea1n c\u00f3 th\u1ec3 tham kh\u1ea3o!<\/p>\n\n\n\n<p>M\u00ecnh xin nh\u1eafc l\u1ea1i l\u00e0 c\u00e1i github tr\u00ean m\u00ecnh th\u1ea5y kha hay tuy nhi\u00ean v\u1edbi tr\u00ecnh \u0111\u1ed9 M\u00ec c\u1ee7a m\u00ecnh th\u00ec sau khi nghi\u00ean c\u1ee9u th\u00ec th\u1ea5y <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>M\u00f4 h\u00ecnh kh\u00e1 ph\u1ee9c t\u1ea1p, <\/li><li>Vi\u1ebft b\u1eb1ng Pytorch n\u00ean anh em kh\u00e1 o\u1ea3i khi nghi\u00ean c\u1ee9u v\u00e0 tri\u1ec3n khai.<\/li><li>Kh\u00f4ng c\u00f3 source ph\u1ea7n training m\u00e0 chi c\u00f3 source \u0111\u1ec3 s\u1eed d\u1ee5ng pretrain \u0111\u1ec3 infer n\u00ean anh em c\u0169ng ch\u1ea3 hi\u1ec3u n\u00f3 l\u00e0m nh\u01b0 n\u00e0o ra \u0111\u01b0\u1ee3c th\u1ebf<\/li><\/ul>\n\n\n\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-5095883280136027\"\n     data-ad-slot=\"7735063137\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>Do \u0111\u00f3, m\u00ecnh quy\u1ebft \u0111\u1ecbnh h\u00ec h\u1ee5i chuy\u1ec3n sang YOLO \u0111\u1ec3 anh em l\u00e0m cho d\u1ec5 v\u00e0 c\u0169ng t\u1eadp train cho vui v\u1ebb. Ngo\u00e0i ra b\u00e0i n\u00e0y m\u00ecnh c\u0169ng s\u1ebd \u0111i s\u00e2u h\u01a1n v\u1ec1 YOLO, v\u1ec1 m\u1ea1ng, v\u1ec1 output v\u1ec1 c\u00e1c tham s\u1ed1&#8230;.. Hi v\u1ecdng s\u1ebd mang l\u1ea1i nhi\u1ec1u th\u00f4ng tin b\u1ed5 \u00edch cho c\u00e1c b\u1ea1n.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ph\u1ea7n 1 &#8211; N\u00f3i qua v\u1ec1 model structure c\u1ee7a FaceMaskDetection<\/h2>\n\n\n\n<p>Ph\u1ea7n n\u00e0y m\u00ecnh n\u00f3i kh\u00e1i qu\u00e1t theo hi\u1ec3u bi\u1ebft c\u1ee7a m\u00ecnh \u0111\u1ec3 c\u00e1c b\u1ea1n tham kh\u1ea3o th\u00f4i nh\u00e9. M\u00ecnh \u0111\u00e3 \u0111\u1ecdc qua v\u00e0 c\u00f3 m\u1ea5y note nh\u01b0 sau:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>H\u1ecd d\u00f9ng backbone l\u00e0 SSD Lite v\u1edbi s\u1ed1 tham s\u1ed1 ch\u1ec9 h\u01a1n 1M, v\u1edbi m\u1ee5c \u0111\u00edch l\u00e0 \u0111\u1ec3 ch\u1ea1y nhanh tr\u00ean tr\u00ecnh duy\u1ec7t.<\/li><li>\u0110\u1ea7u vao \u1ea3nh 260&#215;260, v\u1edbi 8 l\u1edbp Convolution v\u00e0 \u0111\u1ea7u ra g\u1ed3m 2 th\u00f4ng tin: class id v\u00e0 boundbox c\u1ee7a khu\u00f4n m\u1eb7t.<\/li><li>H\u1ecd s\u1eed d\u1ee5ng 5 c\u1ee5m output v\u1edbi anchor size kh\u00e1c nhau.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/AIZOOTech\/FaceMaskDetection\/master\/img\/face_mask_detection.caffemodel.png\" alt=\"face mask detection\"\/><figcaption>C\u1ea5u tr\u00fac model. Ngu\u1ed3n: <a href=\"https:\/\/raw.githubusercontent.com\/AIZOOTech\/FaceMaskDetection\/master\/img\/face_mask_detection.caffemodel.png\" target=\"_blank\" rel=\"noreferrer noopener\">T\u1ea1i \u0111\u00e2y<\/a><\/figcaption><\/figure>\n\n\n\n<p>R\u1ea5t may l\u00e0 d\u00f9 h\u1ecd kh\u00f4ng c\u00f3 source train, nh\u01b0ng h\u1ecd l\u1ea1i c\u00f3 public dataset v\u00e0 th\u1ebf l\u00e0 anh em l\u1ea1i c\u00f3 tr\u00f2 ch\u01a1i r\u1ed3i. V\u00e0 c\u00f9ng YOLO th\u00f4i!<\/p>\n\n\n\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-5095883280136027\"\n     data-ad-slot=\"7735063137\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Ph\u1ea7n 2 &#8211; N\u00f3i qua m\u1ed9t ch\u00fat v\u1ec1 YOLO<\/h2>\n\n\n\n<p>Nh\u01b0 ch\u00fang ta \u0111\u00e3 bi\u1ebft, YOLO l\u00e0 m\u1ed9t m\u1ea1ng kh\u00e1 ph\u1ed5 bi\u1ebfn hi\u1ec7n nay v\u1edbi c\u1ea5u tr\u00fac nh\u01b0 sau:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/lilianweng.github.io\/lil-log\/assets\/images\/yolo-network-architecture.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>Ph\u1ea7n \u0111\u1ea7u s\u1ebd l\u00e0 c\u00e1c l\u1edbp tr\u00edch xu\u1ea5t \u0111\u1eb7c tr\u01b0ng \u1ea3nh v\u00e0 di sau l\u00e0 c\u00e1c l\u1edbp Fully Connected l\u00e0m c\u00f4ng t\u00e1c predict ra v\u1ecb tr\u00ed v\u1eadt th\u1ec3 v\u00e0 c\u00e1c class c\u1ee7a c\u00e1c v\u1eadt th\u1ec3 \u0111\u00f3.<\/p>\n\n\n\n<p><strong>\u0110\u1ec3 c\u00e1c b\u1ea1n d\u1ec5 hi\u1ec3u, m\u00ecnh xin ph\u00e9p \u0111\u01b0\u1ee3c n\u00f3i theo ki\u1ec3u n\u00f4m na, d\u00e2n d\u00e3 l\u00e0m sao anh em hi\u1ec3u \u0111\u01b0\u1ee3c v\u00e0 l\u00e0m d\u01b0\u1ee3c. Xin l\u1ed7i c\u00e1c nh\u00e0 khoa h\u1ecdc n\u1ebfu c\u00f3 \u0111i qua \u0111\u00e2y ah.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0110\u1ea7u ti\u00ean l\u00e0 v\u1ec1 s\u1ed1 feature map<\/h4>\n\n\n\n<p>Sau khi \u1ea3nh \u0111\u1ea7u v\u00e0o \u0111\u01b0a v\u00e0o ph\u1ea7n tr\u00edch xu\u1ea5t \u0111\u1eb7c tr\u01b0ng th\u00ec th\u00f4ng th\u01b0\u1eddng ch\u00fang ta s\u1ebd thu \u0111\u01b0\u1ee3c 1 feature map v\u1edbi k\u00edch th\u01b0\u1edbc nh\u1ecf h\u01a1n r\u1ea5t nhi\u1ec1u \u1ea3nh ban \u0111\u1ea7u nh\u01b0ng l\u1ea1i c\u00f3 &#8220;chi\u1ec1u s\u00e2u&#8221; l\u1edbn h\u01a1n r\u1ea5t nhi\u1ec1u v\u00e0 s\u1ebd d\u00f9ng features map (FM) \u0111\u00f3 \u0111\u1ec3 ti\u1ebfn h\u00e0nh predict ti\u1ebfp theo. V\u1edbi YOLO th\u00ec kh\u00f4ng ch\u1ec9 c\u00f3 1 FM m\u00e0 s\u1ebd l\u00e0 3 FM kh\u00e1c nhau t\u00f9y v\u00e0o size input \u0111\u1ea7u v\u00e0o.<\/p>\n\n\n\n<p>V\u00ed d\u1ee5, input l\u00e0 416&#215;416 th\u00ec feature map c\u00f3 c\u00e1c k\u00edch th\u01b0\u1edbc l\u00e0 13&#215;13, 26&#215;26 v\u00e0 52&#215;52 c\u00f2n v\u1edbi input l\u00e0 608&#215;608 th\u00ec feature map s\u1ebd l\u00e0 19&#215;19, 38&#215;38 v\u00e0  72&#215;72. YOLO h\u1ed7 tr\u1ee3 c\u1ea3 2 size input n\u00e0y.<\/p>\n\n\n\n<p>\u0110\u00e1i kh\u00e1i 1 \u1ea3nh nh\u00e9t v\u00e0o darknet s\u1ebd ra 3 c\u00e1i \u1ea3nh nh\u1ecf h\u01a1n, g\u1ecdi l\u00e0 feature maps. C\u00f2n l\u00e0m g\u00ec v\u1edbi \u0111\u1ed1ng \u0111\u00f3 th\u00ec sang ph\u1ea7n ti\u1ebfp theo.<\/p>\n\n\n\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-5095883280136027\"\n     data-ad-slot=\"7735063137\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h4 class=\"wp-block-heading\">\u0110\u1ecbnh ngh\u0129a anchor box<\/h4>\n\n\n\n<p>YOLO \u0111\u1ecbnh ngh\u0129a 3 anchor box s\u1eb5n, \u0111\u1ec3 t\u1eeb \u0111\u00f3 d\u1ef1 do\u00e1n v\u1eadt th\u1ec3 cho t\u1eebng cell trong FM. Hi\u1ec3u \u0111\u01a1n gi\u1ea3n l\u00e0 c\u1ea7m s\u1eb5n c\u00e1c khung \u1ea3nh c\u00f3 k\u00edch th\u01b0\u1edbc kh\u00e1c nhau, \u00e1p v\u00e0o t\u1eebng cell c\u1ee7a FM \u0111\u1ec3 t\u1ea1o ra 1 khung nh\u00ecn kh\u00e1c nhau v\u00e0 d\u1ef1 \u0111o\u00e1n v\u1eadt th\u1ec3.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.dlology.com\/static\/media\/uploads\/yolo\/car-person.jpg\" alt=\"yolo v3\"\/><\/figure><\/div>\n\n\n\n<p>Nh\u01b0 h\u00ecnh tr\u00ean ch\u1eb3ng h\u1ea1n, l\u00e0 2 c\u00e1i khung \u1ea3nh, 1 c\u00e1i d\u00e0i, 1 c\u00e1i ngang \u1ed1p v\u00e0o \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n ng\u01b0\u1eddi.<\/p>\n\n\n\n<p>Khi train YOLO anh em \u0111\u1ec3 \u00fd s\u1ebd c\u00f3 c\u00e1c Region \u0111\u00f3, gi\u1edd anh em \u0111\u00e3 hi\u1ec3u n\u00f3 l\u00e0 g\u00ec \u0111\u00fang ko?<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">D\u1ef1 \u0111o\u00e1n tr\u00ean c\u00e1c feature maps<\/h4>\n\n\n\n<p>R\u1ed3i v\u1edbi m\u1ed7i c\u00e1i FM c\u00f3 \u0111\u01b0\u1ee3c t\u1eeb b\u01b0\u1edbc tr\u00ean, ta s\u1ebd x\u1eed l\u00fd ti\u1ebfp \u0111\u1ec3 \u0111o\u00e1n ra c\u00e1c v\u1eadt th\u1ec3 trong \u0111\u00f3. Ch\u00fang ta t\u1ea1m th\u1eddi x\u00e9t v\u1edbi 1 FM  13&#215;13 th\u00f4i, c\u00e1c FM kh\u00e1c t\u01b0\u01a1ng t\u1ef1.<\/p>\n\n\n\n<p>Ch\u00fang ta gi\u1ea3 s\u1eed b\u00e0i to\u00e1n l\u00e0  train m\u1ed9t model nh\u1eadn di\u1ec7n ch\u00f3 v\u00e0 m\u00e8o trong \u1ea3nh (v\u1edbi ch\u00f3 c\u00f3 class id l\u00e0 0 v\u00e0 m\u00e8o c\u00f3 class id l\u00e0 1). Nh\u01b0 v\u1eady s\u1ed1 class = 2 (ch\u1ec9 c\u00f3 ch\u00f3 v\u1edbi m\u00e8o)<\/p>\n\n\n\n<p>V\u1eady b\u00e2y gi\u1edd l\u00e0m g\u00ec v\u1edbi FM? Ch\u00fang ta s\u1ebd d\u00f2 t\u1eebng cell trong FM theo h\u01b0\u1edbng t\u1eeb tr\u00ean xu\u1ed1ng d\u01b0\u1edbi, t\u1eeb tr\u00e1i sang ph\u1ea3i v\u00e0 \u1ed1p c\u00e1c anchor box v\u00e0o \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n t\u1eebng \u00f4 m\u1ed9t c\u00f3 CH\u1ee8A T\u00c2M C\u1ee6A v\u1eadt th\u1ec3 kh\u00f4ng? t\u1ecda \u0111\u1ed9 c\u1ee7a v\u1eadt th\u1ec3 l\u00e0 g\u00ec? M\u00e0 c\u00e1i v\u1eadt th\u1ec3 d\u00f3 l\u00e0 c\u00e1i gi\u1ed1ng g\u00ec (class = bao nhi\u00eau \u1ea5y m\u00e0).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/max\/1200\/0*3A8U0Hm5IKmRa6hu.png\" alt=\"yolo face mask detection\"\/><\/figure>\n\n\n\n<p>T\u1eeb \u0111\u00f3 ta th\u1ea5y v\u1edbi 1 cell s\u1ebd g\u1ed3m c\u00e1c th\u00f4ng s\u1ed1 output l\u00e0:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>po: L\u00e0 c\u00f3 v\u1eadt th\u1ec3 hay ko? Hay l\u00e0 n\u1ec1n?<\/li><li>tx, ty, tw, th: l\u00e0 v\u1ecb tr\u00ed v\u1eadt th\u1ec3. Trong \u0111\u00f3 tx v\u00e0 ty l\u00e0 t\u1ecda \u0111\u1ed9 t\u00e2m, tw v\u00e0 th l\u00e0 r\u1ed9ng v\u00e0o cao c\u1ee7a box.<\/li><li>p1&#8230;.pc : L\u00e0 probality d\u1ef1 \u0111o\u00e1n c\u1ee7a c\u00e1c class. V\u00ed d\u1ee5 v\u1edbi b\u00e0i to\u00e1n ch\u00fang ta l\u00e0 2 class th\u00ec ch\u1ec9 c\u00f3 p1 v\u00e0 p2 th\u00f4i nh\u00e9 \ud83d\ude09<\/li><\/ul>\n\n\n\n<p>V\u1eady 1 cell s\u1ebd c\u00f3 s\u1ed1 output l\u00e0 : (4  + 1 + 2) = 7 <\/p>\n\n\n\n<p>Tuy nhi\u00ean, YOLO ko \u00e1p 1 anchor box m\u00e0 l\u00e0 3 anchor box n\u00ean s\u1ed1 output s\u1ebd l\u00e0 7&#215;3 = 21.<\/p>\n\n\n\n<p>T\u1eeb \u0111\u00f3 th\u00ec c\u1ea3 FM (13&#215;13) s\u1ebd l\u00e0 (13&#215;13)x21  = 3,549.<\/p>\n\n\n\n<p>T\u00ednh to\u00e1n t\u01b0\u01a1ng t\u1ef1 v\u1edbi c\u00e1c FM c\u00f2n l\u1ea1i, ch\u00fang ta s\u1ebd th\u1ea5y s\u1ed1 tham s\u1ed1 output r\u1ea5t l\u1edbn v\u00e0 ph\u00e9p t\u00ednh to\u00e1n l\u00e0 c\u1ef1c l\u1edbn. \u0110\u00f3 l\u00e0 v\u00ec sao train YOLO c\u00e1c b\u1ea1n lu\u00f4n th\u1ea5y CPU, GPU l\u00ean cao 100%.<\/p>\n\n\n\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-5095883280136027\"\n     data-ad-slot=\"7735063137\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h4 class=\"wp-block-heading\">Ch\u1ed1t th\u00f4ng tin output t\u1ea1i m\u1ed7i cell c\u1ee7a FM<\/h4>\n\n\n\n<p>Cu\u1ed1i c\u00f9ng t\u1ea1i m\u1ed7i cell c\u1ee7a FM, ta ch\u1ecdn anchor box n\u00e0o c\u00f3 IOU l\u1edbn nh\u1ea5t. V\u1eady IOU l\u00e0 g\u00ec? \u0110\u00f3 l\u00e0 Intersection Over Union. N\u00f3i n\u00f4m na l\u00e0 t\u1ef7 l\u1ec7 ch\u00ednh x\u00e1c gi\u1eefa box d\u1ef1 \u0111o\u00e1n ra v\u00e0 box th\u1eadt c\u1ee7a v\u1eadt th\u1ec3. Gi\u00e1 tr\u1ecb c\u00e0ng cao c\u00e0ng t\u1ed1t.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/1.bp.blogspot.com\/-DupIqyrA9VY\/WfAPpjFI-bI\/AAAAAAAAAJs\/H_Kh8QXbZeMrzXC6LFUKU4k-3T8VzKsSgCLcBGAs\/s1600\/iou_examples.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>Khi train anh em \u0111\u1ec3 \u00fd s\u1ebd c\u00f3 tham s\u1ed1 IOU n\u00e0y xu\u1ea5t hi\u1ec7n v\u00e0 t\u0103ng d\u1ea7n.<\/p>\n\n\n\n<p>B\u01b0\u1edbc cu\u1ed1i c\u00f9ng l\u00e0 c\u00e1c cell g\u1ea7n nhau d\u1ec5 b\u1ecb d\u1ef1 \u0111o\u00e1n gi\u1ed1ng nhau, v\u00ed d\u1ee5 nh\u01b0 h\u00ecnh con ch\u00f3 b\u00ean d\u01b0\u1edbi:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2018\/05\/gentle_guide_nms.jpg\" alt=\"yolo face mask detection\"\/><\/figure>\n\n\n\n<p>Con ch\u00f3 kh\u00e1 to n\u00ean c\u00e1c \u0111i\u1ec3m g\u1ea7n nhau \u0111\u1ec1u thu\u1ed9c con ch\u00f3 n\u00ean \u0111\u1ec1u \u0111\u01b0\u1ee3c d\u1ef1 \u0111o\u00e1n ra h\u1ebft. Tuy nhi\u00ean m\u1ee5c \u0111\u00edch c\u1ee7a ch\u00fang ta ch\u1ec9 c\u1ea7n 1 khung h\u00ecnh ch\u00f3 m\u00e0 th\u00f4i. N\u00ean l\u00fac n\u00e0o YOLO \u00e1p d\u1ee5ng NMS  &#8211; Non-max suppression \u0111\u00ea remove b\u1edbt c\u00e1c khung h\u00ecnh v\u00e0 cho ra \u1ea3nh nh\u01b0 b\u00ean ph\u1ea3i.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u1eda th\u1ebf khi train YOLO m\u1ecdi ng\u01b0\u1eddi hay b\u1ea3o khi n\u00e0o Loss h\u1ed9i t\u1ee5 th\u00ec d\u1eebng l\u1ea1i? Loss l\u00e0  g\u00ec?<\/h4>\n\n\n\n<p>Loss s\u1ebd n\u00f4m na g\u1ed3m 2 ph\u1ea7n l\u00e0 Loss v\u1ec1 d\u1ef1 \u0111o\u00e1n class v\u00e0 Loss v\u1ec1 d\u1ef1 \u0111o\u00e1n bounding box cho v\u1eadt th\u1ec3. Khi train th\u00ec tham s\u1ed1 Loss \u0111\u1ee9ng ngay sau s\u1ed1 v\u00f2ng l\u1eb7p, m\u1ecdi ng\u01b0\u1eddi \u0111\u1ec3 \u00fd tham s\u1ed1 n\u00e0y \u0111\u1ec3 bi\u1ebft \u0111\u01b0\u1ee3c model c\u1ea7n d\u1eebng l\u1ea1i hay ch\u01b0a nh\u00e9. <\/p>\n\n\n\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-5095883280136027\"\n     data-ad-slot=\"7735063137\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Ph\u1ea7n 3 &#8211; Ti\u1ebfn h\u00e0nh train model Face Mask Detection<\/h2>\n\n\n\n<p>R\u1ed3i d\u00f4ng d\u00e0i \u0111\u1ee7 r\u1ed3i. B\u00e2y gi\u1edd train model Face Mask Detection th\u00f4i, ch\u1eafc anh em n\u00f3ng l\u00f2ng r\u1ed3i!<\/p>\n\n\n\n<p>V\u1edbi d\u1eef li\u1ec7u public b\u1edfi t\u00e1c gi\u1ea3, ch\u00fang ta kh\u00f4ng th\u1ec3 s\u1eed d\u1ee5ng ngay \u0111\u01b0\u1ee3c v\u00ec c\u00e1c l\u00fd do:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>M\u1ed9t n\u1eeda d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c g\u00e1n nh\u00e1n v\u1edbi format PASCAL VOC , m\u00ecnh ph\u00e1n \u0111o\u00e1n ph\u1ea7n d\u1eef li\u1ec7u n\u00e0y h\u1ecd l\u1ea5y t\u1ea1i <strong><a rel=\"noreferrer noopener\" href=\"http:\/\/shuoyang1213.me\/WIDERFACE\/\" target=\"_blank\">WIDERFACE<\/a><\/strong><\/li><li>M\u1ed9t n\u1eeda c\u00f2n l\u1ea1i th\u00ec l\u00e0 t\u1ea1i <strong><a rel=\"noreferrer noopener\" href=\"http:\/\/www.escience.cn\/people\/geshiming\/mafa.html\" target=\"_blank\">MAFA<\/a><\/strong> v\u00e0 g\u00e1n nh\u00e3n kh\u00f4ng theo \u0111\u00fang chu\u1ea9n PASCAL VOC<\/li><\/ul>\n\n\n\n<p>M\u00ecnh \u0111\u1ecbnh l\u1ea5y d\u1eef li\u1ec7u v\u1ec1 convert sang YOLO Labels b\u1eb1ng script chu\u1ea9n tr\u00ean m\u1ea1ng th\u00ec b\u1ecb l\u1ed7i n\u00ean \u0111\u00e0nh vi\u1ebft s\u1eeda l\u1ea1i script ri\u00eang cho n\u00f3. Script \u0111\u1ea1i kh\u1eafc ph\u1ee5c b\u1eb1ng c\u00e1ch n\u1ebfu nh\u01b0 nh\u00e3n \u0111\u1ea7u v\u00e0o kh\u00f4ng c\u00f3 tham s\u1ed1 w,h th\u00ec s\u1ebd \u0111\u1ecdc \u1ea3nh \u0111\u1ec3 t\u1ea1o ra v\u1eady.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import glob\nimport os\nimport pickle\nimport xml.etree.ElementTree as ET\nfrom os import listdir, getcwd\nfrom os.path import join\nimport cv2\n\ndirs = &#91;'train', 'val']\nclasses = &#91;'face', 'face_mask']\n\ndef getImagesInDir(dir_path):\n    image_list = &#91;]\n    for filename in glob.glob(dir_path + '\/*.jpg'):\n        image_list.append(filename)\n\n    return image_list\n\ndef convert(size, box):\n    dw = 1.\/(size&#91;0])\n    dh = 1.\/(size&#91;1])\n    x = (box&#91;0] + box&#91;1])\/2.0 - 1\n    y = (box&#91;2] + box&#91;3])\/2.0 - 1\n    w = box&#91;1] - box&#91;0]\n    h = box&#91;3] - box&#91;2]\n    x = x*dw\n    w = w*dw\n    y = y*dh\n    h = h*dh\n    return (x,y,w,h)\n\ndef convert_annotation(dir_path, output_path, image_path):\n    basename = os.path.basename(image_path)\n    basename_no_ext = os.path.splitext(basename)&#91;0]\n\n    in_file = open(dir_path + '\/' + basename_no_ext + '.xml')\n    out_file = open(output_path + basename_no_ext + '.txt', 'w')\n    tree = ET.parse(in_file)\n    root = tree.getroot()\n    size = root.find('size')\n    try:\n        w = int(size.find('width').text)\n        h = int(size.find('height').text)\n        # \u0110\u00e2y l\u00e0 \u0111o\u1ea1n check xem tham s\u1ed1 c\u00f3 kh\u00f4ng? N\u1ebfu kh\u00f4gn c\u00f3 th\u00ec read \u1ea3nh \u0111\u1ec3 l\u1ea5y \n        if (w==0) or (h==0):\n            image = cv2.imread(image_path)\n            w, h = image.shape&#91;1], image.shape&#91;0]\n            del image\n    except:\n        image = cv2.imread(image_path)\n        w,h = image.shape&#91;1],image.shape&#91;0]\n        del image\n\n\n    for obj in root.iter('object'):\n        difficult = obj.find('difficult').text\n        cls = obj.find('name').text\n        if cls not in classes or int(difficult)==1:\n            continue\n        cls_id = classes.index(cls)\n        xmlbox = obj.find('bndbox')\n        b = (float(xmlbox.find('xmin').text), float(xmlbox.find('xmax').text), float(xmlbox.find('ymin').text), float(xmlbox.find('ymax').text))\n        bb = convert((w,h), b)\n        out_file.write(str(cls_id) + \" \" + \" \".join(&#91;str(a) for a in bb]) + '\\n')\n\ncwd = getcwd()\n\nfor dir_path in dirs:\n    full_dir_path = cwd + '\/' + dir_path\n    output_path = full_dir_path +'\/yolo\/'\n\n    if not os.path.exists(output_path):\n        os.makedirs(output_path)\n\n    image_paths = getImagesInDir(full_dir_path)\n    list_file = open(full_dir_path + '.txt', 'w')\n\n    for image_path in image_paths:\n        print(image_path)\n        list_file.write(image_path + '\\n')\n        convert_annotation(full_dir_path, output_path, image_path)\n    list_file.close()\n\n    print(\"Finished processing: \" + dir_path)<\/code><\/pre>\n\n\n\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-5095883280136027\"\n     data-ad-slot=\"7735063137\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>Sau khi ch\u1ea1y 1 l\u00fac th\u00ec m\u00ecnh \u0111\u00e3 c\u00f3 d\u1eef li\u1ec7u \u1ea3nh v\u00e0 nh\u00e3n chu\u1ea9n yolo v\u00e0 b\u00e2y gi\u1edd th\u00ec \u0111\u01a1n gi\u1ea3n l\u00e0 th\u1ef1c hi\u1ec7n train theo c\u00e1c b\u00e0i guide c\u1ee7a m\u00ecnh tr\u00ean blog th\u00f4i. Anh em n\u00e0o ch\u01b0a \u0111\u1ecdc th\u00ec tham kh\u1ea3o <strong><a rel=\"noreferrer noopener\" href=\"https:\/\/www.google.com\/search?safe=active&amp;sxsrf=ALeKk0035tzmAWDqByC2C-RKx3hNMQ83Jg%3A1587955483161&amp;ei=G0emXsm1CYPSmAXM373QCQ&amp;q=miai.vn+yolo&amp;oq=miai.vn+yolo&amp;gs_lcp=CgZwc3ktYWIQAzoECCMQJ1DMRVitSGDrSWgAcAB4AIABlQGIAYMFkgEDMC41mAEAoAEBqgEHZ3dzLXdpeg&amp;sclient=psy-ab&amp;ved=0ahUKEwiJr_iTy4fpAhUDKaYKHcxvD5oQ4dUDCAw&amp;uact=5\" target=\"_blank\">t\u1ea1i \u0111\u00e2y<\/a><\/strong>. \u0110\u1ec3 anh em ti\u1ec7n train th\u00ec m\u00ecnh c\u0169ng chia s\u1ebb lu\u00f4n d\u1eef li\u1ec7u \u0111\u00e3 g\u00e1n nh\u00e3n chu\u1ea9n YOLO ch\u1ec9 vi\u1ec7c train t\u1ea1i th\u01b0 vi\u1ec7n M\u00ec AI ( <strong><a rel=\"noreferrer noopener\" href=\"https:\/\/miai.vn\/thu-vien-mi-ai\" target=\"_blank\">link<\/a><\/strong> \u0111\u00e2y, c\u00e1c b\u1ea1n nh\u1edb xem video \u0111\u1ec3 bi\u1ebft c\u00e1ch t\u1ea3i nh\u00e9)<\/p>\n\n\n\n<p>Sau khi m\u00ecnh train 6000 v\u00f2ng th\u00ec nh\u1eadn di\u1ec7n \u0111\u00e3 kh\u00e1 chu\u1ea9n, ch\u1ea5p c\u00e1c lo\u1ea1i kh\u1ea9u trang \ud83d\ude00<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/thangnch\/photos\/master\/Screen%20Shot%202020-04-27%20at%2009.49.03.png\" alt=\"face mask detection\"\/><\/figure>\n\n\n\n<p>Anh em n\u00e0o ng\u1ea1i c\u00f3 th\u1ec3 clone lu\u00f4n m\u00e3 ngu\u1ed3n Face Mask Detection\/nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang t\u1ea1i \u0111\u00e2y:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/thangnch\/MIAI_Face_Mask_YOLO<\/code><\/pre>\n\n\n\n<p>Ok nh\u01b0 v\u1eady b\u00e0i h\u00f4m nay m\u00ecnh \u0111\u00e3 guide c\u00e1c b\u1ea1n th\u00eam v\u00e0i th\u00f4ng tin s\u00e2u h\u01a1n v\u1ec1 YOLO c\u0169ng nh\u01b0 c\u00e1ch ti\u1ec1n x\u1eed l\u00fd d\u1eef li\u1ec7u \u0111\u1ea7u v\u00e0o khi d\u1eef li\u1ec7u kh\u00f4ng chu\u1ea9n. Ch\u00fang ta \u0111\u00e3 d\u01b0a v\u1ec1 \u0111\u01b0\u1ee3c label YOLO chu\u1ea9n v\u00e0 ch\u1ec9 vi\u1ec7c train th\u00f4i \ud83d\ude00<\/p>\n\n\n\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng!<\/p>\n\n\n\n<p><strong><em>H\u00e3y join c\u00f9ng c\u1ed9ng \u0111\u1ed3ng M\u00ec AI nh\u00e9!<\/em><\/strong><\/p>\n\n\n\n<p>Fanpage:&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/facebook.com\/miaiblog\" target=\"_blank\">http:\/\/facebook.com\/miaiblog<\/a><br>Group trao \u0111\u1ed5i, chia s\u1ebb:&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.facebook.com\/groups\/miaigroup\" target=\"_blank\">https:\/\/www.facebook.com\/groups\/miaigroup<\/a><br>Website:&nbsp;<a href=\"https:\/\/miai.vn\/\">https:\/\/miai.vn\/<\/a><br>Youtube:&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/bit.ly\/miaiyoutube\" target=\"_blank\">http:\/\/bit.ly\/miaiyoutube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Xin ch\u00e0o tu\u1ea7n m\u1edbi c\u00e1c member M\u00ec AI, ch\u1eafc h\u1eb3n g\u1ea7n \u0111\u00e2y anh em c\u00f3 nghe n\u00f3i v\u1ec1 github FaceMaskDetection c\u1ee7a m\u1ea5y anh China v\u1ec1 nh\u1eadn di\u1ec7n m\u1eb7t \u0111eo kh\u1ea9u trang kh\u00e1 \u0111\u1ec9nh. H\u00f4m nay ch\u00fang ta s\u1ebd c\u00f9ng tri\u1ec3n khai l\u1ea1i Face Mask Detection b\u1eb1ng YOLO nh\u00e9. M\u00ecnh \u0111\u00e3 c\u00f3 1 b\u00e0i v\u1ec1 nh\u1eadn [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[19,237,238,257,21,22,211,23,258,24,25,41,28,259,260,29],"class_list":["post-849","post","type-post","status-publish","format-standard","hentry","category-computer-vision","tag-ai","tag-cuda","tag-cudnn","tag-data-process","tag-deep-learning","tag-dl","tag-face-mask-detection","tag-machine-learning","tag-mafa","tag-mi-ai","tag-ml","tag-nhan-dang","tag-opencv","tag-pascal-voc","tag-wider-face","tag-yolo"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO - M\u00ec AI<\/title>\n<meta name=\"description\" content=\"Anh em c\u00f3 nghe n\u00f3i v\u1ec1 github FaceMaskDetection c\u1ee7a m\u1ea5y anh China kh\u00e1 \u0111\u1ec9nh. H\u00f4m nay ch\u00fang ta s\u1ebd c\u00f9ng tri\u1ec3n khai l\u1ea1i Face Mask Detection b\u1eb1ng YOLO nh\u00e9.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/miai.vn\/?p=849\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO - M\u00ec AI\" \/>\n<meta property=\"og:description\" content=\"Anh em c\u00f3 nghe n\u00f3i v\u1ec1 github FaceMaskDetection c\u1ee7a m\u1ea5y anh China kh\u00e1 \u0111\u1ec9nh. H\u00f4m nay ch\u00fang ta s\u1ebd c\u00f9ng tri\u1ec3n khai l\u1ea1i Face Mask Detection b\u1eb1ng YOLO nh\u00e9.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/miai.vn\/?p=849\" \/>\n<meta property=\"og:site_name\" content=\"M\u00ec AI\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-26T19:54:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/raw.githubusercontent.com\/AIZOOTech\/FaceMaskDetection\/master\/img\/face_mask_detection.caffemodel.png\" \/>\n<meta name=\"author\" content=\"Ch\u1ee7 ti\u1ec7m M\u00ec\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ch\u1ee7 ti\u1ec7m M\u00ec\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=849#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=849\"},\"author\":{\"name\":\"Ch\u1ee7 ti\u1ec7m M\u00ec\",\"@id\":\"https:\\\/\\\/miai.vn\\\/#\\\/schema\\\/person\\\/cc8bc24bb90bd3f596add82f3a59948c\"},\"headline\":\"Re-implement nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO\",\"datePublished\":\"2020-04-26T19:54:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=849\"},\"wordCount\":2125,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=849#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/raw.githubusercontent.com\\\/AIZOOTech\\\/FaceMaskDetection\\\/master\\\/img\\\/face_mask_detection.caffemodel.png\",\"keywords\":[\"ai\",\"cuda\",\"cudnn\",\"data process\",\"deep learning\",\"dl\",\"face mask detection\",\"machine learning\",\"MAFA\",\"m\u00ec ai\",\"ml\",\"nh\u1eadn d\u1ea1ng\",\"opencv\",\"pascal voc\",\"WIDER FACE\",\"Yolo\"],\"articleSection\":[\"Computer Vision\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/miai.vn\\\/?p=849#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=849\",\"url\":\"https:\\\/\\\/miai.vn\\\/?p=849\",\"name\":\"Nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO - M\u00ec AI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=849#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=849#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/raw.githubusercontent.com\\\/AIZOOTech\\\/FaceMaskDetection\\\/master\\\/img\\\/face_mask_detection.caffemodel.png\",\"datePublished\":\"2020-04-26T19:54:42+00:00\",\"description\":\"Anh em c\u00f3 nghe n\u00f3i v\u1ec1 github FaceMaskDetection c\u1ee7a m\u1ea5y anh China kh\u00e1 \u0111\u1ec9nh. H\u00f4m nay ch\u00fang ta s\u1ebd c\u00f9ng tri\u1ec3n khai l\u1ea1i Face Mask Detection b\u1eb1ng YOLO nh\u00e9.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=849#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/miai.vn\\\/?p=849\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=849#primaryimage\",\"url\":\"https:\\\/\\\/raw.githubusercontent.com\\\/AIZOOTech\\\/FaceMaskDetection\\\/master\\\/img\\\/face_mask_detection.caffemodel.png\",\"contentUrl\":\"https:\\\/\\\/raw.githubusercontent.com\\\/AIZOOTech\\\/FaceMaskDetection\\\/master\\\/img\\\/face_mask_detection.caffemodel.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=849#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/miai.vn\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Re-implement nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/miai.vn\\\/#website\",\"url\":\"https:\\\/\\\/miai.vn\\\/\",\"name\":\"M\u00ec AI\",\"description\":\"H\u1ecdc AI theo c\u00e1ch M\u00ec \u0103n li\u1ec1n!\",\"publisher\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/miai.vn\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/miai.vn\\\/#organization\",\"name\":\"M\u00ec AI\",\"url\":\"https:\\\/\\\/miai.vn\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/miai.vn\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/miai.vn\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/cropped-Logo_w_slogan.png\",\"contentUrl\":\"https:\\\/\\\/miai.vn\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/cropped-Logo_w_slogan.png\",\"width\":240,\"height\":193,\"caption\":\"M\u00ec AI\"},\"image\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/miai.vn\\\/#\\\/schema\\\/person\\\/cc8bc24bb90bd3f596add82f3a59948c\",\"name\":\"Ch\u1ee7 ti\u1ec7m M\u00ec\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g\",\"caption\":\"Ch\u1ee7 ti\u1ec7m M\u00ec\"},\"sameAs\":[\"https:\\\/\\\/miai.vn\"],\"url\":\"https:\\\/\\\/miai.vn\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO - M\u00ec AI","description":"Anh em c\u00f3 nghe n\u00f3i v\u1ec1 github FaceMaskDetection c\u1ee7a m\u1ea5y anh China kh\u00e1 \u0111\u1ec9nh. H\u00f4m nay ch\u00fang ta s\u1ebd c\u00f9ng tri\u1ec3n khai l\u1ea1i Face Mask Detection b\u1eb1ng YOLO nh\u00e9.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/miai.vn\/?p=849","og_locale":"en_US","og_type":"article","og_title":"Nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO - M\u00ec AI","og_description":"Anh em c\u00f3 nghe n\u00f3i v\u1ec1 github FaceMaskDetection c\u1ee7a m\u1ea5y anh China kh\u00e1 \u0111\u1ec9nh. H\u00f4m nay ch\u00fang ta s\u1ebd c\u00f9ng tri\u1ec3n khai l\u1ea1i Face Mask Detection b\u1eb1ng YOLO nh\u00e9.","og_url":"https:\/\/miai.vn\/?p=849","og_site_name":"M\u00ec AI","article_published_time":"2020-04-26T19:54:42+00:00","og_image":[{"url":"https:\/\/raw.githubusercontent.com\/AIZOOTech\/FaceMaskDetection\/master\/img\/face_mask_detection.caffemodel.png","type":"","width":"","height":""}],"author":"Ch\u1ee7 ti\u1ec7m M\u00ec","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ch\u1ee7 ti\u1ec7m M\u00ec","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/miai.vn\/?p=849#article","isPartOf":{"@id":"https:\/\/miai.vn\/?p=849"},"author":{"name":"Ch\u1ee7 ti\u1ec7m M\u00ec","@id":"https:\/\/miai.vn\/#\/schema\/person\/cc8bc24bb90bd3f596add82f3a59948c"},"headline":"Re-implement nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO","datePublished":"2020-04-26T19:54:42+00:00","mainEntityOfPage":{"@id":"https:\/\/miai.vn\/?p=849"},"wordCount":2125,"commentCount":4,"publisher":{"@id":"https:\/\/miai.vn\/#organization"},"image":{"@id":"https:\/\/miai.vn\/?p=849#primaryimage"},"thumbnailUrl":"https:\/\/raw.githubusercontent.com\/AIZOOTech\/FaceMaskDetection\/master\/img\/face_mask_detection.caffemodel.png","keywords":["ai","cuda","cudnn","data process","deep learning","dl","face mask detection","machine learning","MAFA","m\u00ec ai","ml","nh\u1eadn d\u1ea1ng","opencv","pascal voc","WIDER FACE","Yolo"],"articleSection":["Computer Vision"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/miai.vn\/?p=849#respond"]}]},{"@type":"WebPage","@id":"https:\/\/miai.vn\/?p=849","url":"https:\/\/miai.vn\/?p=849","name":"Nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO - M\u00ec AI","isPartOf":{"@id":"https:\/\/miai.vn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/miai.vn\/?p=849#primaryimage"},"image":{"@id":"https:\/\/miai.vn\/?p=849#primaryimage"},"thumbnailUrl":"https:\/\/raw.githubusercontent.com\/AIZOOTech\/FaceMaskDetection\/master\/img\/face_mask_detection.caffemodel.png","datePublished":"2020-04-26T19:54:42+00:00","description":"Anh em c\u00f3 nghe n\u00f3i v\u1ec1 github FaceMaskDetection c\u1ee7a m\u1ea5y anh China kh\u00e1 \u0111\u1ec9nh. H\u00f4m nay ch\u00fang ta s\u1ebd c\u00f9ng tri\u1ec3n khai l\u1ea1i Face Mask Detection b\u1eb1ng YOLO nh\u00e9.","breadcrumb":{"@id":"https:\/\/miai.vn\/?p=849#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/miai.vn\/?p=849"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/miai.vn\/?p=849#primaryimage","url":"https:\/\/raw.githubusercontent.com\/AIZOOTech\/FaceMaskDetection\/master\/img\/face_mask_detection.caffemodel.png","contentUrl":"https:\/\/raw.githubusercontent.com\/AIZOOTech\/FaceMaskDetection\/master\/img\/face_mask_detection.caffemodel.png"},{"@type":"BreadcrumbList","@id":"https:\/\/miai.vn\/?p=849#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/miai.vn\/"},{"@type":"ListItem","position":2,"name":"Re-implement nh\u1eadn di\u1ec7n \u0111eo kh\u1ea9u trang (Face Mask Detection) b\u1eb1ng YOLO"}]},{"@type":"WebSite","@id":"https:\/\/miai.vn\/#website","url":"https:\/\/miai.vn\/","name":"M\u00ec AI","description":"H\u1ecdc AI theo c\u00e1ch M\u00ec \u0103n li\u1ec1n!","publisher":{"@id":"https:\/\/miai.vn\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/miai.vn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/miai.vn\/#organization","name":"M\u00ec AI","url":"https:\/\/miai.vn\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/miai.vn\/#\/schema\/logo\/image\/","url":"https:\/\/miai.vn\/wp-content\/uploads\/2026\/05\/cropped-Logo_w_slogan.png","contentUrl":"https:\/\/miai.vn\/wp-content\/uploads\/2026\/05\/cropped-Logo_w_slogan.png","width":240,"height":193,"caption":"M\u00ec AI"},"image":{"@id":"https:\/\/miai.vn\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/miai.vn\/#\/schema\/person\/cc8bc24bb90bd3f596add82f3a59948c","name":"Ch\u1ee7 ti\u1ec7m M\u00ec","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g","caption":"Ch\u1ee7 ti\u1ec7m M\u00ec"},"sameAs":["https:\/\/miai.vn"],"url":"https:\/\/miai.vn\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/miai.vn\/index.php?rest_route=\/wp\/v2\/posts\/849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/miai.vn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/miai.vn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/miai.vn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/miai.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=849"}],"version-history":[{"count":0,"href":"https:\/\/miai.vn\/index.php?rest_route=\/wp\/v2\/posts\/849\/revisions"}],"wp:attachment":[{"href":"https:\/\/miai.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/miai.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/miai.vn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}