📖
CorgiDude
  • Introduction
  • Specification
  • Installation
    • การใช้งาน Maixpy IDE เบื้องต้น
    • วิธีการลง Maixpy ใน Sipeed Maix Bit
    • การใช้งาน Kflash GUI และการอัพโหลดไฟล์ .bin kmodel
  • Lessons
  • Article & API
    • การใช้งาน GPIO
    • การอ่านและเขียนไฟล์ SD Card
    • การเชื่อมต่อ WiFi
    • การใช้งาน HTTP Request
    • การใช้งาน MQTT
    • การใช้งาน Google Spreadsheet ผ่านทาง IFTTTT
    • การใช้งาน LINE Notify
    • การใช้งาน ThingSpeak
    • การใช้งาน Google Vision
  • Modules
    • Button Switch
    • Drive Motor
    • GPIO Input
    • Servo Motor
  • Demo Projects
    • Face Recognition
      • ตอนที่ 1
      • ตอนที่ 2
      • ตอนที่ 3
      • ตอนที่ 4
    • Image Classification
      • CorgiDude บอร์ด Image Classification โดยใช้ MobileNetV1
      • CorgiDude บอร์ด Image Classification โดยใช้ Transfer Learning MobileNetV1
    • Object Detection
      • CorgiDude บอร์ดกับการทำ Object Detection โดยใช้ Yolo
      • CorgiDude บอร์ด ตรวจจับใบหน้าด้วย Yolo Face Detection
      • CorgiDude บอร์ดกับการทำ Cat Face Detection โดยใช้ Yolo2
      • การทำ Dataset แบบ Object Detection ชนิด VOC ที่สามารถเอาไปใช้ตอนเทรนใน Yolo2 ได้เลย
      • CorgiDude บอร์ดกับการทำ License Plate Detection ของรถมอเตอร์ไซค์ โดยใช้ Yolo2
      • CorgiDude บอร์ด ตรวจจับใบหน้า และ Mask ด้วย Yolo2 Face Mask Detection
  • Downloads
    • Firmware
    • Models
Powered by GitBook
On this page

Was this helpful?

  1. Demo Projects
  2. Image Classification

CorgiDude บอร์ด Image Classification โดยใช้ MobileNetV1

PreviousImage ClassificationNextCorgiDude บอร์ด Image Classification โดยใช้ Transfer Learning MobileNetV1

Last updated 4 years ago

Was this helpful?

ดีครับ สำหรับบอร์ด CorgiDude ที่อยากจะทำ Image Clssification นั้นนะครับ บทความนี้จะมาสอนใช้โมเดลที่มีอยู่แล้วนะครับ แต่ถ้าอยากจะเทรนเองเดียวมีบทความต่อให้นะครับ เรามาเริ่มกันเลยดีกว่าครับ ก่อนอื่นก็ต้องมี โมเดลก่อนครับ ลิ้งโหลดด้านล่างครับ

(]

ต่อไปก็ทำการ Flash model ที่ได้โหลดมาครับ หรื่อใคร Flash model ไม่เป็น ไปทำตามบทความตามลิ้งต่อไปนี้ครับ

(]

Flash ไปที่ตำแหน่ง 0x200000 เลยครับ

หลังจาก Flash เสร็จแล้ว ต่อไปนำไฟล์ labels.txt ไปใว้ใน SD Card ได้เลยครับ ไฟล์ labels.txt หาได้จาก

นำไฟล์ labels.txt ไปใส่ SD Card ได้เลยครับ เรามารัน script ต่อไปนี้ได้เลยครับ

import sensor, image, lcd, time
import KPU as kpu
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_windowing((224, 224))
sensor.set_vflip(1)
sensor.run(1)
lcd.init(type=2, freq=20000000, color=lcd.BLACK)
lcd.rotation(2)
f=open('/sd/labels.txt','r')
labels=f.readlines()
f.close()

task = kpu.load(0x200000) 
clock = time.clock()
while(True):
    img = sensor.snapshot()
    clock.tick()
    fmap = kpu.forward(task, img)
    fps=clock.fps()
    plist=fmap[:]
    pmax=max(plist) 
    max_index=plist.index(pmax)
    a = lcd.display(img)
    lcd.draw_string(0, 0, "%.2f:%s "%(pmax, labels[max_index].strip()))
    print(fps)
a = kpu.deinit(task)

สำหรับใครที่ Copy Script แล้วมีปัญหา โหลดได้ครับ

ผลจากการรันดูครับ

(]

(]

https://github.com/AiDude-io/CorgiDude/blob/master/models/MobilenetV1_1000/labels.txt)[https://github.com/AiDude-io/CorgiDude/blob/master/models/MobilenetV1_1000/labels.txt
https://github.com/AiDude-io/CorgiDude/blob/master/models/MobilenetV1_1000/MobilenetV1_1000.py)[https://github.com/AiDude-io/CorgiDude/blob/master/models/MobilenetV1_1000/MobilenetV1_1000.py
https://github.com/AiDude-io/CorgiDude/blob/master/models/MobilenetV1_1000/mbnet751.kmodel)[https://github.com/AiDude-io/CorgiDude/blob/master/models/MobilenetV1_1000/mbnet751.kmodel
https://www.aiiotshop.com/b/5)[https://www.aiiotshop.com/b/5