# Application C/C++ on Ultra96v2 Part 2

<figure><img src="https://1856353139-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MClo3nC-1US0rbK8Qau%2Fuploads%2FfXIICkv8uD5MiOb4uc0X%2FgN5LdW8x.jpeg?alt=media&#x26;token=f6a34042-c089-420f-af11-6a46fa20516c" alt=""><figcaption></figcaption></figure>

## Things used in this project

### Hardware component

| Figure                                                                                                                                                                                                                                   | Name                                                                                     | Amount        |   |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------- | - |
| <img src="https://hackster.imgix.net/uploads/attachments/822865/avnet_ultra96v2-l_13qKH8wr06.jpg?auto=compress%2Cformat&#x26;w=48&#x26;h=48&#x26;fit=fill&#x26;bg=ffffff" alt="Ultra96-V2" data-size="original">                         | [Avnet Ultra96-V2](https://www.hackster.io/avnet/products/ultra96-v2?ref=project-5ebc3f) | 1             |   |
| <p><br></p>                                                                                                                                                                                                                              | DisplayPort monitor                                                                      | 1             |   |
| <p><img src="https://static.vecteezy.com/system/resources/thumbnails/008/476/519/small/modern-laptop-3d-illustration-png.png" alt="Laptop PNG Free Images with Transparent Background - (5,791 ..." data-size="original"></p><p><br></p> | Laptop                                                                                   | 1             |   |
| <p><img src="https://cdn-icons-png.flaticon.com/512/716/716420.png" alt="Sd card - Free computer icons" data-size="original"></p><p><br></p>                                                                                             | SDcard                                                                                   | 1             |   |
| <p>\<img src="<https://w7.pngwing.com/pngs/367/491/png-transparent-macbook-pro-memory-card-readers-usb-microsd-memory-card-reader-adapter-usb-flash-drive-electronic-device.png>" alt="Memory card reader png images                     | PNGWing" data-size="original"></p><p><br></p>                                            | SDcard reader | 1 |

### Software component&#x20;

| Name            | Link                                                                                                                                                                                                                                                                               |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| WSL2            | <p><br></p>                                                                                                                                                                                                                                                                        |
| Ubuntu 18.04    | <p><br></p>                                                                                                                                                                                                                                                                        |
| Vitis-AI 1.4    | [Xilinx/Vitis-AI: Vitis AI is Xilinx’s development stack for AI inference on Xilinx hardware platforms, including both edge devices and Alveo cards.](https://github.com/Xilinx/Vitis-AI)[ ](https://github.com/Xilinx/Vitis-AI)[(github.com)](https://github.com/Xilinx/Vitis-AI) |
| Ultra96v2 image | <http://avnet.me/avnet-u96v2_sbc_base-vitis-ai-1.4-image>                                                                                                                                                                                                                          |

## Story

### Introduction&#x20;

### *Overview Vitis-AI*

ตัวแรกเป็น Platform ที่สร้างขึ้นมาเพื่อทำงานเฉพาะกับ Xilinx FPGA ซึ่งภายในจะประกอบด้วย environment สำคัญที่ช่วยให้เราทำงานได้ง่ายขึ้น เพื่อให้ AI สามารถนำไปใช้งานบน Xilinx FPGA ได้ โดยจะมี library ที่ช่วยในการทำงานของ AI ในการเพิ่มประสิทธิภาพในการแสดงผลบน FPGA&#x20;

<figure><img src="https://1856353139-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MClo3nC-1US0rbK8Qau%2Fuploads%2F4XlvzGADJIZbdl1jQurA%2F89dqCreA.jpeg?alt=media&#x26;token=072dec27-11bb-4cf8-bc0d-54d41f4c04af" alt=""><figcaption></figcaption></figure>

จากรูปเป็นโครงสร้างการจัดการ Vitis-AI สำหรับคนที่เข้ามาใช้งาน โดยจะแบ้งเป็นแต่ละส่วนดังนี้

* Frameworks เป็นส่วนหลักในการทำการสร้างสรรค์ AI ซึ่งจะมีขั้นตอนที่แตกต่างกันตามแต่ละ Framework ซึ่งจะมีข้อดี ข้อเสียแตกต่างกัน แต่โดยรวมแล้ว มันคือ Framework ที่ช่วยในการผลิด AI ออกมาใช้งานนั่นเอง
* Vitis-AI model เป็นส่วนที่ให้ผู้ใช้ได้ทดลองใช้งาน หรือสร้าง AI โดยจะมีส่วนประกอบดังนี้
  * Model Zoo ส่วนที่เตรียมไว้สำหรับพร้อมใช้งานบน FPGA ในการ Programming หรือการใช้งานกับ AI Application ที่มีอยู่
  * Custom models ส่วนที่เตรียมไว้สำหรับการตัดแต่ง และจัดการ AI เพื่อให้ตรงกับความต้องการของผู้ใช้
* Vitis AI Development kit เป็นในส่วน SDK ที่เก็บ Library ในการจัดการ AI ต่างๆที่เราจะได้ทดลองกันในบทเรียนถัดๆ ไป
* Overlay หรือส่วนที่นำไปใช้งานกับ DPU หรือตัวประมวลผล AI ที่เราได้เรียนกันในคาบที่แล้วนั่นเอง

### *Pointpillar (What it is?)*

Point pillars คือ ขั้นตอนในการทำงานของ AI จากคาบที่แล้วที่ตรวจจับวัตถุ 3D ผ่าน Sensor ที่ชื่อว่า Lidar โดยการทำงานของ sensor ตัวนี้จะใช้แสงในการส่งข้อมูลเพื่อตรวจสอบในจุดที่สะท้อนเราจึงเห็นเป็นภาพจุดๆที่เป็นวัตถุก้อนๆนั่นเอง โดยที่จุดที่ถูกส่งมาเป็นจุดบนโลก 3D นั้นถูกเรียกว่า "Point clouds" เมื่อเราตีกรอบวัตถุเพื่อบอกจุดต่างๆที่อยู่บนภาพ ว่าจุดรอบๆนั้นจะถูกเรียกว่า "Stack of pillars" และการบอกว่าจุดๆนั้นที่เราตีกรอบคืออะไร อยู่ตรงไหน ที่จะนำไปใช้สอน AI จะถูกเรียกว่า "Learned Features" โดยเมื่อเราได้กลุ่มของจุดและชื่อที่ตีกรอบไว้ชัดเจนแล้วจึงจะได้ตัวอย่างภาพสมมติของวัตถุที่อธิบายด้วยจุดว่า "Psuedo image" ที่จะใช้ในการฝึกสอน AI ด้วยกระบวนการ 2D convolution ในการฝึกสอน AI&#x20;

<figure><img src="https://1856353139-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MClo3nC-1US0rbK8Qau%2Fuploads%2F4vbcdEZloxqaz3bGPHwN%2Fa32xm8FR.png?alt=media&#x26;token=e10f6ff3-c43f-4db2-8c58-364be2a2a464" alt=""><figcaption><p>Implementation of the PointPillars Network for 3D Object Detection in Reprogrammable Heterogeneous Devices Using FINN | SpringerLink</p></figcaption></figure>

<figure><img src="https://1856353139-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MClo3nC-1US0rbK8Qau%2Fuploads%2F3bPPfAldTjRaxG7Dvpjb%2FNV3yNSjA.png?alt=media&#x26;token=cda5cf74-b17d-4251-aef3-e67a083cf3d2" alt=""><figcaption><p>PointPillars object detection</p></figcaption></figure>

โดยขั้นตอนในการทำงานอย่างที่อธิบายเมื่อเราได้ Pillars หรือกลุ่มก้อนจุดที่เราต้องการบอกว่าส่วนนี้คืออะไรแล้วนำไปทำการฝึกสอนด้วย 2D Convolution layers แล้วเราจะนำไปทำสิ่งที่เรียกว่าการทำแผนที่ ในการบอกถึงถนนและรถที่เราเห็นเป็นแผนที่ดำๆมีจุดเยอะๆแต่พอเดาได้ว่าส่วนนี้คือรถ ต้นไม้ หรือถนน ซึ่งพอเรานำแผนที่พวกนี้ไปรวมเข้ากับการประมวลผล AI แล้วเราก็จะบอกได้ว่ากรอบของจุดไหนคือ รถ ต้นไม้ หรือคนโดยที่เราไม่ต้องมานั่งเพ่งดูเอง เจ้า AI จะคอยเป็นตาคอยดูแทนเรานั่นเอง ซึ่งมันถูกนำไปใช้ในการช่วยเหลือในระบบ Automotive driving บน EV car ที่เราเห็นกันในปัจจุบันนั่นเอง

<figure><img src="https://1856353139-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MClo3nC-1US0rbK8Qau%2Fuploads%2FBjndwtI9t5qTPfz4cUVX%2FP3lekS5w.jpeg?alt=media&#x26;token=50914347-69a8-49cd-b520-f8e13efc2cef" alt=""><figcaption><p>การทำงานของ Point pillars และ Object detection</p></figcaption></figure>

โดยที่ถ้านิสิตอยากศึกษาเพิ่มเติมกับเรื่องนี้สามารถศึกษาได้ที่&#x20;

* การทำงานของ Sensor Lidar --> [Link](https://seminex.com/lidar/)
* การทำงานของ Point pillars -->[ Link ](https://becominghuman.ai/pointpillars-3d-point-clouds-bounding-box-detection-and-tracking-pointnet-pointnet-lasernet-67e26116de5a)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aic-eec.com/fpga-design/c-c++-programming-on-ultra96v2-fpga-board/application-c-c++-on-ultra96v2-part-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
