2025年1月7日 星期二

有關 yolob8 進行 訓練圖形 標記工具有哪些推荐

 在使用 YOLOv8 進行訓練時,選擇合適的圖形標記工具是至關重要的。以下是一些常用的標記工具,適合用於 YOLOv8 的圖像標註:

常用標記工具

  1. LabelImg
    • 一款開源的圖像標註工具,支持 YOLO 格式的標註。
    • 用戶可以輕鬆地為每個目標物體繪製矩形框並指定類別。
    • 標註結果通常以 XML 格式保存。
  2. CVAT (Computer Vision Annotation Tool)
    • 由 Intel 開發的一個強大的標註工具,支持多種標註格式,包括 YOLO。
    • 提供多邊形、矩形框等多種標註方式,適合複雜場景的標註需求。
    • 支持團隊協作和自動化標註功能。
  3. Roboflow
    • 一個在線平台,提供圖像上傳、標註和數據集管理功能。
    • 用戶可以輕鬆創建項目並使用內建的標註工具進行邊界框或多邊形標註。
    • 支持自動化標註助手,可以加速標註過程。
  4. VGG Image Annotator (VIA)
    • 一款輕量級的網頁應用程序,無需安裝即可使用。
    • 支持矩形框、多邊形等多種標註形式,並能導出多種格式。
  5. MakeSense.ai
    • 一個免費的在線圖像標註工具,無需登錄即可使用。
    • 提供直觀的界面,用戶可以快速為圖像添加標籤和邊界框。

標記流程概述

在選擇合適的工具後,通常的標記流程如下:
  1. 收集數據:從網絡、公開數據集或自拍攝影收集相關圖像。
  2. 導入圖像:將收集到的圖像導入所選擇的標記工具中。
  3. 進行標註:使用工具提供的功能為每個目標物體添加矩形框或其他類型的標註,並指定類別。
  4. 保存和導出:將完成的標註保存為 YOLO 所需格式(例如 .txt 文件),以便後續使用。
這些工具能夠幫助用戶高效地完成圖像數據集的標註工作,為 YOLOv8 的模型訓練打下良好的基礎。


推薦的標註工具

  1. X-AnyLabeling
    • 這是一款功能強大的標註工具,支持 YOLOv8 的旋轉目標檢測。
    • 提供多種標註模式,包括矩形、旋轉框和多邊形等,並支持自動切換編輯模式。
    • 支持一鍵導入和導出多種格式,包括 YOLO 格式,方便用戶快速集成到工作流程中【1】。
  2. LabelImg
    • 一個非常流行的開源圖像標註工具,簡單易用,適合初學者。
    • 支持矩形框標註,可以將標註結果保存為 YOLO 格式的 TXT 文件,非常適合用於 YOLOv8 訓練【2】【3】。
  3. CVAT (Computer Vision Annotation Tool)
    • 由 Intel 開發的開源工具,功能強大,支持多種標註類型,包括矩形、線條和多邊形等。
    • 支持多人協作,非常適合大型數據集的標註工作【2】【3】。
  4. MakeSense.ai
    • 一個免費的在線標註工具,無需登錄即可使用。
    • 提供直觀的界面,用戶可以快速為圖像添加邊界框和類別,並支持導出為 YOLO 格式【3】。
  5. LabelMe
    • 由麻省理工學院開發的一款著名標註工具,支持多種標註方式,包括矩形框和多邊形。
    • 雖然不支持多人協作,但對於小型項目來說非常實用,可以導出為 VOC 和 COCO 格式【2】【4】。
  6. VGG Image Annotator (VIA)
    • 一個簡單易用的網頁應用程序,可以手動標註圖像、音頻和視頻。
    • 支持多種標註形式,包括包圍框和多邊形,並能導出 CSV 和 JSON 格式【2】。

總結

這些工具各有優勢,可以根據項目的需求選擇合適的工具來進行圖像標註。無論是針對小型項目的簡單工具還是大型項目的協作平台,都能找到合適的解決方案,以支持 YOLOv8 的模型訓練。

介紹 llama v3.1

 

介紹 llama v3.1
来源答案
Llama 3.1 是 Meta 最新推出的開源語言模型,於2024年7月23日正式發布。這一版本的模型包含了多個參數配置,包括 8B、70B 和 405B,特別是 405B 模型在性能上達到了新的高度,甚至在某些測試中超越了 GPT-4o。

主要特點

1. 增強的上下文窗口

Llama 3.1 將上下文窗口的大小從原來的 8K tokens 擴展至 128K tokens,這一改進使得模型能夠更有效地處理長文本和長對話,極大提升了其在摘要和會議記錄等應用中的表現【1】【3】。

2. 模型架構

Llama 3.1 保持了 Llama 3 的基本架構,使用 標準的 decoder-only transformer 結構,而未採用混合專家模型。這一設計使得模型在處理複雜任務時仍然保持高效【1】【6】。

3. 性能評估

根據 Meta 的官方數據,Llama 3.1 在多個基準測試中表現優於 GPT-4o 和 Claude 3.5 sonnet,尤其在 GSM8K、ARC Challenge 和 Multilingual MGSN 等測試集上顯示出色的性能。雖然在 MMLU 和 Human Eval 測試中略遜於某些閉源模型,但整體表現仍然非常接近【1】【4】。

4. 新功能與工具支持

Llama 3.1 引入了一個名為 ipython 的新角色,用於管理工具呼叫的輸出,並增強了對多種內建工具的支持,如 Brave 搜尋和 Wolfram Alpha。這使得模型在處理複雜查詢時更加靈活【2】【5】。

5. 知識蒸餾與許可更新

Meta 更新了 Llama 3.1 的許可條款,允許用戶使用模型輸出來改進其他語言模型,但要求訓練出的模型名稱必須以 "Llama" 開頭,並標註 "Build with Llama"【1】【4】。

使用方式

用戶可以通過多種方式免費使用 Llama 3.1 模型:
  • Hugging Face HuggingChat:提供友好的對話介面和工具調用功能。
  • Groq:使用其自研的 LPU 進行推理,支持免費 API 調用。
  • 本機使用:可通過 LM Studio 程式下載和運行 Llama 3.1 模型,即使沒有獨立顯卡也能運行【1】【2】。

總結

Llama 3.1 的發布標誌著開源語言模型的一次重大進步,其強大的性能和靈活性使其成為開發者和研究人員的重要工具。隨著其在多語言支持和長文本處理能力上的提升,Llama 3.1 無疑將在未來的人工智慧應用中扮演重要角色。

2024年11月25日 星期一

Linux nohup , & 行程執行管理 NOTE

1 ## 

於Linux 下 要執行 長時間的 運算 無法掛機等待結果 !

或是 需要多個 程式同時運作 可以利用 行程管理

$nohup python -u {filename.py} &

[ nohup  ] 表示 可以離開 shell 後不終止!

 [ & ] 表示 將執行放於背景執行 會顯示占用的 PID


於 Linux 終端機 ssh 介面下 託管 執行程式後 會顯示 PID

PID 可以提供 進行執行監控用

若有執行訊息需要監看 則可以 將畫面輸出轉向到指定的 log  file

$ nohup python test.py > {path} 2>& 1 &


2##

$ps PID  行程查詢

  • ps -f
    這個行程是由bash行程(PID 312)衍生出來的子行程(PPID 312),也可以說bash是ps -f的父行程

  • ps -aux

    加上aux查看系統行程

  • ps -l
    bash 介面相關的程序

  • ps o [欄位1],[欄位2],...
    顯示想知道的欄位

$pstree   顯示行程關係

pstree 指令不加任何參數,就會以樹狀圖顯示整個系統上每個程序之間的從屬關係

  • pstree -a
    顯示指令完整參數
  • pstree -p
    顯示每個行程的PID
  • pstree -np
    以PID排序
  • pstree [使用者名稱]
    只顯示使用者的程序
  • pstree -p [PID]
    查看特定PID程序

3# Kill

$kill [訊號代碼] PID 

 kill 指令,終止程序執行

訊號代碼:

  • -2 訊號等同 Ctrl+C,也是通知程序停止執行。
  • -9 立刻強制停止程序執行。
  • -15 以正常的程序通知程序停止執行,這是預設的訊號。
  • -l 列出所有可用的訊號。

 

 


2023年4月20日 星期四

PICO W Drive Lib by MicroPython note1

 

===============
##MCU Frequency check and Switch speed 
import machine

machine.freq()          # get the current frequency of the CPU
machine.freq(240000000) # set the CPU frequency to 240 MHz

The rp2 module:
import rp2
===============
##Delay and timing Use the time module:
import time

time.sleep(1)           # sleep for 1 second
time.sleep_ms(500)      # sleep for 500 milliseconds
time.sleep_us(10)       # sleep for 10 microseconds
start = time.ticks_ms() # get millisecond counter
delta = time.ticks_diff(time.ticks_ms(), start) # compute time difference

===============
##Pins and GPIO Use the machine.Pin class:

from machine import Pin

p0 = Pin(0, Pin.OUT)    # create output pin on GPIO0
p0.on()                 # set pin to "on" (high) level
p0.off()                # set pin to "off" (low) level
p0.value(1)             # set pin to on/high

p2 = Pin(2, Pin.IN)     # create input pin on GPIO2
print(p2.value())       # get value, 0 or 1

p4 = Pin(4, Pin.IN, Pin.PULL_UP) # enable internal pull-up resistor
p5 = Pin(5, Pin.OUT, value=1) # set pin high on creation

===============
##UART (serial bus) See machine.UART.

from machine import UART

uart1 = UART(1, baudrate=9600, tx=33, rx=32)
uart1.write('hello')  # write 5 bytes
uart1.read(5)         # read up to 5 bytes



===============
##PWM (pulse width modulation) How does PWM work on the RPi RP2xxx?
##Use the machine.PWM class:

from machine import Pin, PWM

pwm0 = PWM(Pin(0))      # create PWM object from a pin
pwm0.freq()             # get current frequency
pwm0.freq(1000)         # set frequency
pwm0.duty_u16()         # get current duty cycle, range 0-65535
pwm0.duty_u16(200)      # set duty cycle, range 0-65535
pwm0.deinit()           # turn off PWM on the pin

===============
##ADC (analog to digital conversion)
##How does the ADC module work? Use the machine.ADC class:

from machine import ADC

adc = ADC(Pin(32))          # create ADC object on ADC pin
adc.read_u16()              # read value, 0-65535 across voltage range 0.0v - 3.3v


===============
##Software SPI bus
##Software SPI (using bit-banging) works on all pins, and is accessed via ##the machine.SoftSPI class:

from machine import Pin, SoftSPI

# construct a SoftSPI bus on the given pins
# polarity is the idle state of SCK
# phase=0 means sample on the first edge of SCK, phase=1 means the second
spi = SoftSPI(baudrate=100000, polarity=1, phase=0, sck=Pin(0), mosi=Pin(2), miso=Pin(4))

spi.init(baudrate=200000) # set the baudrate

spi.read(10)            # read 10 bytes on MISO
spi.read(10, 0xff)      # read 10 bytes while outputting 0xff on MOSI

buf = bytearray(50)     # create a buffer
spi.readinto(buf)       # read into the given buffer (reads 50 bytes in this case)
spi.readinto(buf, 0xff) # read into the given buffer and output 0xff on MOSI

spi.write(b'12345')     # write 5 bytes on MOSI

buf = bytearray(4)      # create a buffer
spi.write_readinto(b'1234', buf) # write to MOSI and read from MISO into the buffer
spi.write_readinto(buf, buf) # write buf to MOSI and read MISO back into buf

===============
##Hardware SPI bus
##Hardware SPI is accessed via the machine.SPI class and has the same methods as ##software SPI above:

from machine import Pin, SPI

spi = SPI(1, 10000000)
spi = SPI(1, 10000000, sck=Pin(14), mosi=Pin(13), miso=Pin(12))
spi = SPI(2, baudrate=80000000, polarity=0, phase=0, bits=8, firstbit=0, sck=Pin(18), mosi=Pin(23), miso=Pin(19))

===============
##Software I2C bus

from machine import Pin, SoftI2C

i2c = SoftI2C(scl=Pin(5), sda=Pin(4), freq=100000)

i2c.scan()              # scan for devices

i2c.readfrom(0x3a, 4)   # read 4 bytes from device with address 0x3a
i2c.writeto(0x3a, '12') # write '12' to device with address 0x3a

buf = bytearray(10)     # create a buffer with 10 bytes
i2c.writeto(0x3a, buf)  # write the given buffer to the slave

===============
##Hardware I2C bus

from machine import Pin, I2C

i2c = I2C(0)
i2c = I2C(1, scl=Pin(5), sda=Pin(4), freq=400000)

===============
##Real time clock (RTC)
##See machine.RTC

from machine import RTC

rtc = RTC()
rtc.datetime((2017, 8, 23, 1, 12, 48, 0, 0)) # set a specific date and time
rtc.datetime() # get date and time


===============
##WDT (Watchdog timer)
##Is there a watchdog timer?
##See machine.WDT.

from machine import WDT

# enable the WDT with a timeout of 5s (1s is the minimum)
wdt = WDT(timeout=5000)
wdt.feed()


===============
##Deep-sleep mode

import machine

# check if the device woke from a deep sleep
if machine.reset_cause() == machine.DEEPSLEEP_RESET:
    print('woke from a deep sleep')

# put the device to sleep for 10 seconds
machine.deepsleep(10000)

===============
##OneWire driver
##The OneWire driver is implemented in software and works on all pins:

from machine import Pin
import onewire

ow = onewire.OneWire(Pin(12)) # create a OneWire bus on GPIO12
ow.scan()               # return a list of devices on the bus
ow.reset()              # reset the bus
ow.readbyte()           # read a byte
ow.writebyte(0x12)      # write a byte on the bus
ow.write('123')         # write bytes on the bus
ow.select_rom(b'12345678') # select a specific device by its ROM code

There is a specific driver for DS18S20 and DS18B20 devices:
import time, ds18x20
ds = ds18x20.DS18X20(ow)
roms = ds.scan()
ds.convert_temp()
time.sleep_ms(750)
for rom in roms:
    print(ds.read_temp(rom))


===============
## NeoPixel and APA106 driver
##Use the neopixel and apa106 modules:

from machine import Pin
from neopixel import NeoPixel

pin = Pin(0, Pin.OUT)   # set GPIO0 to output to drive NeoPixels
np = NeoPixel(pin, 8)   # create NeoPixel driver on GPIO0 for 8 pixels
np[0] = (255, 255, 255) # set the first pixel to white
np.write()              # write data to all pixels
r, g, b = np[0]         # get first pixel colour

##The APA106 driver extends NeoPixel, but internally uses a different colour order:

from apa106 import APA106
ap = APA106(pin, 8)
r, g, b = ap[0]

##APA102 (DotStar) uses a different driver as it has an additional clock pin.