{"id":674,"date":"2021-01-27T13:06:22","date_gmt":"2021-01-27T13:06:22","guid":{"rendered":"https:\/\/blog.comixify.ai\/?p=674"},"modified":"2021-05-17T10:20:37","modified_gmt":"2021-05-17T10:20:37","slug":"comixify-testing-opencv-ai-kit","status":"publish","type":"post","link":"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/","title":{"rendered":"Comixify Testing – OpenCV AI Kit"},"content":{"rendered":"Read-o-Meter<\/span> 4<\/span> minutes<\/span><\/span>\n
\"\"<\/figure><\/div>\n\n\n\n

by Maciej P\u0119\u015bko<\/a><\/p>\n\n\n\n

Embedded Computer Vision – OpenCV AI Kit + DepthAI<\/strong><\/h5>\n\n\n\n

We have recently got a small Computer Vision toy to play with, namely OpenCV AI Kit. It is a portable, complex device equipped with a camera along with quite considerable computing power to run simple AI models, which gives us a wide range of possibilities to use it in a fairly easy manner. For instance, we can simply create a parking monitoring device for cars and their license plate by using only this one device. The fact that we can easily use it with a library like DepthAI that comes with a quite big number of pre-trained models ready to use on such embedded devices makes it even easier to use and really cool.<\/p>\n\n\n\n

\"\"
Fig. 1 OAK-D and OAK-1.<\/figcaption><\/figure><\/div>\n\n\n\n\n\n\n\n
Hardware – OpenCV AI Kit <\/strong><\/h5>\n\n\n\n

There are two different options for AI Kit:<\/p>\n\n\n\n

– OAK-1 with standard 4056x3040px camera with max 60FPS framerate
– OAK-D with two 1280x800px stereo cameras with max 120FPS framerats<\/p>\n\n\n\n

Camera parameters look really good for common use cases for such devices, especially for its price, but now let\u2019s look into the details of the computing power included in it. According to the product kickstarter page<\/a> each device is equipped with a visual processing unit by Intel. It is Intel Movidius Myriad X featuring 16 programmable shave cores and two dedicated neural compute engines for hardware acceleration of deep neural networks. Sounds promising but we couldn\u2019t help to check it ourselves! If you are interested in more hardware details then full specification can be found in the graphics below or here<\/a>. <\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n
\"\"<\/figure>\n\n\n\n
\"\"
Fig. 2. Devices specifications. Source:<\/em> https:\/\/www.kickstarter.com\/projects\/opencv\/opencv-ai-kit<\/a><\/em>.<\/figcaption><\/figure>\n\n\n\n
Software – DepthAI pretrained models<\/strong><\/h5>\n\n\n\n

The setup of the OpenCV AI Kit is fairly easy. We can use DepthAI library that comes with plenty of pretrained and optimised Machine Learning models including face and landmarks detection, vehicle detection, pedestrian detection, pose estimation, text detection, semantic segmentation, emotions recognition and a few more. It is fairly well documented here<\/a>. At first glance it seems awesome, so many models in such a small device, but let\u2019s check how fast and accurate they can be on the OpenCV AI Kit. We tested a standard OAK-1 device with several of the included pretrained models and the results are posted below. We presented FPS that the models achieve along with our subjective accuracy opinion based on some example usage we performed.<\/p>\n\n\n\n

Tab. 1. Depth AI pretrained models benchmark.<\/span><\/em><\/p>\n\n\n\n

\n
\n
Pretrained model<\/strong><\/th>Model FPS<\/strong><\/th>Subjective quality opinion<\/strong><\/th><\/tr><\/thead>
Face detection<\/td>30<\/td>Good for basic usage, performs really well on front face images that are not too far away from the camera. Sometimes gets lost with rotated faces or faces in profile.<\/td><\/tr>
Pedestrian detection<\/td>13<\/td>Satisfactory accuracy but the model tends to detect quite a lot false positives (chair, lamp). Perhaps it can be somehow solved by setting a bigger threshold (default is 0.5).<\/td><\/tr>
Emotions recognition<\/td>30<\/td>It seems to differ only two emotions: \u201csurprised\u201d and \u201chappy\u201d. Sometimes it also detects \u201canger\u201d, but it doesn\u2019t work well. To get satisfactory results, the face must be right in front of the camera and fulfils ~80% of the screen.<\/td><\/tr>
Vehicle detection<\/td>14<\/td>Good accuracy for standard cars, slightly worse for motorbikes and extraordinary cars.<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n<\/div>\n\n\n\n

We can see that the quality and speed differs a bit. Taking into consideration the device size and price, some models get really good performance. Particularly face and vehicle detection looks really usable in real cases. Also the speed makes an impression, because models work in real or near-real time.<\/p>\n\n\n\n

Software – our own Style Transfer models<\/strong><\/h5>\n\n\n\n

However, the review seems to be incomplete by giving only a general view and intuition how useful the AI Kit can be. Nevertheless, as we are very inquisitive by our nature, we were curious how fast this device can be in comparison with different GPUs and CPUs configurations on the same deep learning model. For our luck, with the DepthAI library and the OpenCV AI Kit it is totally possible. We decided to use one of our Style Transfer models, convert it to a proper format (AI Kit requires models to be in a specific OpenVINO format, the detail can be found here<\/a>) and compare the time performance. The whole process of conversion was a bit complicated and we encountered a few minor and major obstacles. However, we finally got a working model. The results can be seens in the figure below.<\/p>\n\n\n\n

Tab. 2. Time [s] comparison with different GPUs and CPUs configurations.<\/span><\/em><\/p>\n\n\n\n

Hardware<\/th>480×854<\/strong><\/th>720×1280<\/strong><\/th>1080×1920<\/strong><\/th><\/tr><\/thead>
OpenCV AI KIT OAK-1, <\/strong>OpenVINO 2020.1, FP16<\/strong><\/td>0.992 s<\/strong><\/td>2.650 s<\/strong><\/td>5.618 s<\/strong><\/td><\/tr>
Tesla V100 (CUDA 10.1, CUDNN 7),tensorflow 2.3.1, FP32<\/td>0.023 s<\/td>0.042 s<\/td>0.097 s<\/td><\/tr>
GeForce RTX 3070 (CUDA 11, CUDNN 8),tensorflow 2.3.1, FP32<\/td>0.046 s<\/td>0.072 s<\/td>0.204 s<\/td><\/tr>
GeForce GTX 1650 (CUDA 10.1, CUDNN 7),tensorflow 2.3.1, FP32<\/td>0.079 s<\/td>0.182 s<\/td>0.395 s<\/td><\/tr>
Intel Core i7-8750H 2,2 GHz 6-Core + Radeon Pro 555X Coreml 4.0, FP16<\/td>0.149 s<\/td>0.297 s<\/td>0.639 s<\/td><\/tr>
Ryzen 5 3600 4.2 GHz 6-Core,tensorflow 2.3.1, FP32<\/td>0.499 s<\/td>1.217 s<\/td>2.658 s<\/td><\/tr>
Intel Xeon E5-2686 v4, 2.3GHz, 8 out of 18 cores,tensorflow 2.3.1, FP32<\/td>0.724 s<\/td>1.647 s<\/td>3.949 s<\/td><\/tr>
Intel Core i7-8750H 2,2 GHz 6-Core,tensorflow 2.3.1, FP32<\/td>0.735 s<\/td>1.620 s<\/td>3.572 s<\/td><\/tr>
Intel Core i7-8750H 2,2 GHz 6-Core,Coreml 4.0, FP32<\/td>0.783 s<\/td>1.723 s<\/td>4.316 s<\/td><\/tr>
Intel Core i5-5200U 2.2 GHz 4-Core,tensorflow 2.3.1, FP32<\/td>1.789 s<\/td>3.759 s<\/td>8.830 s<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

We tested the same Style Transfer model on different hardwares including several CPUs and GPUs that we had access to. Tested resolutions were 480×854, 720×1280 and 1080×1920. All results are given in seconds. As we can see, OpenCV AI KIT is comparable to benchmarked CPUs. It is slightly slower than Intel Core i7 (On both tensorflow and coreml model versions), twice slower than Ryzen 5 and twice faster than Intel Core i5. It is also much slower (around 5-6 times) than the coreml version run on both CPU (Intel Core i7) and GPU (Radeon Pro 555X 4 GB) on MacOS. All benchmarked GPUs were an order of magnitude faster than OpenCV AI KIT which obviously was the expected result.<\/p>\n\n\n\n

Low price, many applications<\/strong><\/h5>\n\n\n\n

All in all, the product is fairly cheap and works really well in simple cases like face\/pedestrian detection. It certainly can be used in some applications like automatic license plates reading or counting people in some areas. On the other hand, the time performance in more complicated cases like our stylization models is not enough to ensure satisfactory framerate on larger resolutions like 720p or 1080p. Perhaps after spending some time on optimization it could work faster.<\/p>\n","protected":false},"excerpt":{"rendered":"

Read-o-Meter<\/span> 4<\/span> minutes<\/span><\/span> by Maciej P\u0119\u015bko Embedded Computer Vision – OpenCV AI Kit + DepthAI We have recently got a small Computer Vision toy to play with, namely OpenCV AI Kit. It is a portable, complex device equipped with a camera along with quite considerable computing power to run simple AI models, which gives us a wide range of Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":[],"categories":[1],"tags":[36,35,37],"yoast_head":"\nComixify Testing - OpenCV AI Kit<\/title>\n<meta name=\"description\" content=\"OpenCV AI Kit - portable, complex device equipped with a camera along with quite considerable computing power to run simple AI models.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Comixify Testing - OpenCV AI Kit\" \/>\n<meta property=\"og:description\" content=\"OpenCV AI Kit - portable, complex device equipped with a camera along with quite considerable computing power to run simple AI models.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/\" \/>\n<meta property=\"og:site_name\" content=\"Comixify develops an AI-powered technology for creating visual effects.\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-27T13:06:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-17T10:20:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.comixify.ai\/wp-content\/uploads\/2021\/01\/e86981779bd9a7d069c012e74c74954e_original.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"680\" \/>\n\t<meta property=\"og:image:height\" content=\"383\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Comixify.ai blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.comixify.ai\/#website\",\"url\":\"https:\/\/blog.comixify.ai\/\",\"name\":\"Comixify develops an AI-powered technology for creating visual effects.\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.comixify.ai\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/blog.comixify.ai\/wp-content\/uploads\/2021\/01\/e86981779bd9a7d069c012e74c74954e_original.jpg\",\"contentUrl\":\"https:\/\/blog.comixify.ai\/wp-content\/uploads\/2021\/01\/e86981779bd9a7d069c012e74c74954e_original.jpg\",\"width\":680,\"height\":383},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/#webpage\",\"url\":\"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/\",\"name\":\"Comixify Testing - OpenCV AI Kit\",\"isPartOf\":{\"@id\":\"https:\/\/blog.comixify.ai\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/#primaryimage\"},\"datePublished\":\"2021-01-27T13:06:22+00:00\",\"dateModified\":\"2021-05-17T10:20:37+00:00\",\"author\":{\"@id\":\"https:\/\/blog.comixify.ai\/#\/schema\/person\/2976f4a6ea03929b30548bdbac60f405\"},\"description\":\"OpenCV AI Kit - portable, complex device equipped with a camera along with quite considerable computing power to run simple AI models.\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.comixify.ai\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Comixify Testing – OpenCV AI Kit\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.comixify.ai\/#\/schema\/person\/2976f4a6ea03929b30548bdbac60f405\",\"name\":\"Comixify.ai blog\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/blog.comixify.ai\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ca892e3ba0df1ab1add89a1079c00925?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ca892e3ba0df1ab1add89a1079c00925?s=96&d=mm&r=g\",\"caption\":\"Comixify.ai blog\"},\"url\":\"https:\/\/blog.comixify.ai\/index.php\/author\/bmi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Comixify Testing - OpenCV AI Kit","description":"OpenCV AI Kit - portable, complex device equipped with a camera along with quite considerable computing power to run simple AI models.","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:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/","og_locale":"en_US","og_type":"article","og_title":"Comixify Testing - OpenCV AI Kit","og_description":"OpenCV AI Kit - portable, complex device equipped with a camera along with quite considerable computing power to run simple AI models.","og_url":"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/","og_site_name":"Comixify develops an AI-powered technology for creating visual effects.","article_published_time":"2021-01-27T13:06:22+00:00","article_modified_time":"2021-05-17T10:20:37+00:00","og_image":[{"width":680,"height":383,"url":"https:\/\/blog.comixify.ai\/wp-content\/uploads\/2021\/01\/e86981779bd9a7d069c012e74c74954e_original.jpg","path":"\/var\/www\/html\/wp-content\/uploads\/2021\/01\/e86981779bd9a7d069c012e74c74954e_original.jpg","size":"full","id":"676","alt":"","pixels":260440,"type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Comixify.ai blog","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/blog.comixify.ai\/#website","url":"https:\/\/blog.comixify.ai\/","name":"Comixify develops an AI-powered technology for creating visual effects.","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.comixify.ai\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/#primaryimage","inLanguage":"en-US","url":"https:\/\/blog.comixify.ai\/wp-content\/uploads\/2021\/01\/e86981779bd9a7d069c012e74c74954e_original.jpg","contentUrl":"https:\/\/blog.comixify.ai\/wp-content\/uploads\/2021\/01\/e86981779bd9a7d069c012e74c74954e_original.jpg","width":680,"height":383},{"@type":"WebPage","@id":"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/#webpage","url":"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/","name":"Comixify Testing - OpenCV AI Kit","isPartOf":{"@id":"https:\/\/blog.comixify.ai\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/#primaryimage"},"datePublished":"2021-01-27T13:06:22+00:00","dateModified":"2021-05-17T10:20:37+00:00","author":{"@id":"https:\/\/blog.comixify.ai\/#\/schema\/person\/2976f4a6ea03929b30548bdbac60f405"},"description":"OpenCV AI Kit - portable, complex device equipped with a camera along with quite considerable computing power to run simple AI models.","breadcrumb":{"@id":"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.comixify.ai\/index.php\/2021\/01\/27\/comixify-testing-opencv-ai-kit\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.comixify.ai\/"},{"@type":"ListItem","position":2,"name":"Comixify Testing – OpenCV AI Kit"}]},{"@type":"Person","@id":"https:\/\/blog.comixify.ai\/#\/schema\/person\/2976f4a6ea03929b30548bdbac60f405","name":"Comixify.ai blog","image":{"@type":"ImageObject","@id":"https:\/\/blog.comixify.ai\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/ca892e3ba0df1ab1add89a1079c00925?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ca892e3ba0df1ab1add89a1079c00925?s=96&d=mm&r=g","caption":"Comixify.ai blog"},"url":"https:\/\/blog.comixify.ai\/index.php\/author\/bmi\/"}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/blog.comixify.ai\/index.php\/wp-json\/wp\/v2\/posts\/674"}],"collection":[{"href":"https:\/\/blog.comixify.ai\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.comixify.ai\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.comixify.ai\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.comixify.ai\/index.php\/wp-json\/wp\/v2\/comments?post=674"}],"version-history":[{"count":6,"href":"https:\/\/blog.comixify.ai\/index.php\/wp-json\/wp\/v2\/posts\/674\/revisions"}],"predecessor-version":[{"id":690,"href":"https:\/\/blog.comixify.ai\/index.php\/wp-json\/wp\/v2\/posts\/674\/revisions\/690"}],"wp:attachment":[{"href":"https:\/\/blog.comixify.ai\/index.php\/wp-json\/wp\/v2\/media?parent=674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.comixify.ai\/index.php\/wp-json\/wp\/v2\/categories?post=674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.comixify.ai\/index.php\/wp-json\/wp\/v2\/tags?post=674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}