<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Running Yolov8 on I.mx 93 in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Running-Yolov8-on-I-mx-93/m-p/1837306#M23865</link>
    <description>&lt;P class=""&gt;Thank you Brian, it seems like almost all of the model is not convertible. Do you know if there is anyway to get around this? I attached my output below. This is the script I ran to obtain the quantised yolov8 tflite model:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;model&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;YOLO&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'best.pt'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;model&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;export&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'tflite'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;int8&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 28 Mar 2024 13:11:06 GMT</pubDate>
    <dc:creator>JesseW</dc:creator>
    <dc:date>2024-03-28T13:11:06Z</dc:date>
    <item>
      <title>Running Yolov8 on I.mx 93</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Running-Yolov8-on-I-mx-93/m-p/1834085#M23860</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am trying to run a Yolov8 model for detection and segmentation on the NPU of the &lt;/SPAN&gt;&lt;A href="http://i.mx/" target="_blank" rel="noopener"&gt;I.mx&lt;/A&gt;&lt;SPAN&gt; 93. I have converted the Torch yolov8 model to an 8 int tflite model and then ran the following code: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;import tflite_runtime.interpreter as tflite&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;import cv2&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;import numpy as np&lt;BR /&gt;&lt;BR /&gt;ext_delegate = tflite.load_delegate('/usr/lib/libethosu_delegate.so')&lt;BR /&gt;interpreter = tflite.Interpreter(model_path='yolov8_int8.tflite', experimental_delegates=[ext_delegate]) interpreter.allocate_tensors()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;input_details = interpreter.get_input_details()&lt;BR /&gt;output_details = interpreter.get_output_details()&lt;BR /&gt;image = cv2.imread('example_image.JPG')&lt;BR /&gt;image = cv2.resize(image, (input_details[0]['shape'][2], input_details[0]['shape'][1]))&lt;BR /&gt;image = np.expand_dims(image, axis=0) image = image.astype(np.float32)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;interpreter.set_tensor(input_details[0]['index'], image)&lt;BR /&gt;interpreter.invoke()&lt;BR /&gt;&lt;BR /&gt;This is my output:&lt;BR /&gt;&lt;BR /&gt;sh-5.2$ sudo python3 &lt;/SPAN&gt;&lt;A href="http://minimum.py/" target="_blank" rel="noopener"&gt;minimum.py&lt;/A&gt;&lt;SPAN&gt; INFO: Ethosu delegate: device_name set to /dev/ethosu0. INFO: Ethosu delegate: cache_file_path set to . INFO: Ethosu delegate: timeout set to 60000000000. INFO: Ethosu delegate: enable_cycle_counter set to 0. INFO: Ethosu delegate: enable_profiling set to 0. INFO: Ethosu delegate: profiling_buffer_size set to 2048. INFO: Ethosu delegate: pmu_event0 set to 0. INFO: Ethosu delegate: pmu_event1 set to 0. INFO: Ethosu delegate: pmu_event2 set to 0. INFO: Ethosu delegate: pmu_event3 set to 0. INFO: EthosuDelegate: 0 nodes delegated out of 292 nodes with 0 partitions. INFO: Created TensorFlow Lite XNNPACK delegate for CPU. sh-5.2$&lt;BR /&gt;&lt;BR /&gt;The python version used was Python 3.11.5. None of the nodes are delegated to the NPU. Does anyone have any information why this might be the case?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2024 22:08:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Running-Yolov8-on-I-mx-93/m-p/1834085#M23860</guid>
      <dc:creator>JesseW</dc:creator>
      <dc:date>2024-03-24T22:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Running Yolov8 on I.mx 93</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Running-Yolov8-on-I-mx-93/m-p/1836649#M23864</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/231341"&gt;@JesseW&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for contacting NXP Support.&lt;/P&gt;
&lt;P&gt;Please have a look to the i.MX Machine Learning User's Guide section 7.2.2 Ethos-U software architecture. It seems that you are not converting your model to execute properly in the i.MX93 NPU.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/user-guide/IMX-MACHINE-LEARNING-UG.pdf" target="_blank"&gt;i.MX Machine Learning User's Guide (nxp.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope this information will be helpful.&lt;/P&gt;
&lt;P&gt;Have a great day!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 18:23:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Running-Yolov8-on-I-mx-93/m-p/1836649#M23864</guid>
      <dc:creator>brian14</dc:creator>
      <dc:date>2024-03-27T18:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Running Yolov8 on I.mx 93</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Running-Yolov8-on-I-mx-93/m-p/1837306#M23865</link>
      <description>&lt;P class=""&gt;Thank you Brian, it seems like almost all of the model is not convertible. Do you know if there is anyway to get around this? I attached my output below. This is the script I ran to obtain the quantised yolov8 tflite model:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;model&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;YOLO&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'best.pt'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;model&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;export&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'tflite'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;int8&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 Mar 2024 13:11:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Running-Yolov8-on-I-mx-93/m-p/1837306#M23865</guid>
      <dc:creator>JesseW</dc:creator>
      <dc:date>2024-03-28T13:11:06Z</dc:date>
    </item>
  </channel>
</rss>

