npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@blokcert/node-red-contrib-plate-crop

v2.2.0

Published

Node-RED node:輸入車牌圖(Buffer/base64),輸出裁切後車牌(YOLO ONNX,自帶 onnxruntime 與模型)

Readme

@blokcert/node-red-contrib-plate-crop

Node-RED 節點:輸入車牌圖片(Buffer 或 base64),偵測並裁切車牌,輸出裁切後的車牌圖。

底層呼叫內附的 yolo-plate binary(Go + YOLO ONNX,binary 自帶 onnxruntime,目標機免安裝)。

安裝

Node-RED 編輯器 → 右上選單 → 節點管理(Manage palette) → 安裝 → 搜尋 @blokcert/node-red-contrib-plate-crop;或用指令:

cd ~/.node-red
npm install @blokcert/node-red-contrib-plate-crop

安裝完成後重啟 Node-RED,編輯器的 function 類別下會出現「車牌裁切」節點。

已內附兩個車牌偵測模型,節點可切換,無需另外準備:

  • 精準(fp32,~260MB):框最貼,推論約 1 秒。因 npm 單套件大小限制, 以 4 個資料套件(@blokcert/plate-crop-fp32-p0~p3)分塊發佈, 安裝時自動拼裝成 models/plate-fp32.onnx(含 sha256 校驗;若安裝時被跳過,首次使用會自動補拼)。
  • 快速(models/plate-fast.onnx,YOLOv8n,~12MB):推論約 0.15 秒,框略鬆。

使用

  1. 拉「車牌裁切」節點到流程。
  2. 雙擊設定:選模型(精準/快速/自訂路徑),並可指定輸入/輸出屬性與輸出格式。
  3. 上游把圖片放到輸入屬性(預設 msg.payload)——Buffer(原始 PNG/JPEG 位元組) 或 base64 字串(可含 data:image/...;base64, 前綴)皆可。
  4. 結果寫入輸出屬性(預設 msg.payload):
    • 裁切車牌 PNG,依輸出格式為 Buffer(預設)或 base64 字串
    • 勾「全部車牌」:陣列
    • 未偵測到車牌:輸出原本圖片(節點狀態顯示「無車牌」)

設定項

| 項目 | 說明 | |------|------| | 模型 | 內附「精準」/「快速」,或選「自訂路徑」填自己的 .onnx | | 輸入屬性 | 讀圖片(Buffer 或 base64)的 msg 屬性,預設 payload,支援巢狀如 payload.image | | 輸出屬性 | 寫結果的 msg 屬性,預設 payload,支援巢狀如 result.plate | | 輸出格式 | Buffer(預設)或 base64 字串 | | 信心門檻 | 對應 -conf,預設 0.25 | | 外擴像素 | 對應 -pad,裁切外擴,預設 0 | | 解析度 | 對應 -imgsz,留空=模型預設(通常640);填 960/1280 提升偵測信心(較慢) | | 遮罩屬性 | 讀遮罩多邊形的 msg 屬性,預設 cropPath;msg 沒有該屬性時不遮罩 | | 銳利化 | unsharp mask 的 sigma(建議 1-10),留空關閉 | | 自動對比 | 勾選啟用 1%~99% 亮度百分位拉伸 | | 全部車牌 | 對應 -all,勾選輸出所有車牌 | | binary 路徑 | 留空=自動依平台選內附 binary |

前處理(遮罩/銳利化/自動對比)

偵測前依序套用:遮罩 → 銳利化 → 自動對比,裁切也從處理後的圖取出, 可取代上游 sharp/canvas 的 ROI 前處理 function 節點。

遮罩多邊形放在 msg.cropPath(屬性名可改),格式 [{"x":..,"y":..},...] (陣列或 JSON 字串皆可),多邊形外的區域塗黑(等效 sharp 的 dest-in 合成):

// 上游 function 節點(每台相機不同 ROI)
msg.cropPath = global.get("cameras.cp" + msg.snap.cameraId + ".cropPath");
return msg;

v2.2.0:新增前處理(遮罩/銳利化/自動對比);無車牌時輸出原本圖片(原為 null)。 v2.1.0:內附「精準」模型由 int8 換回 fp32(快 ~2.3 倍、框相同),以分塊套件自動拼裝。 v2.0.0 重大變更:輸出預設由 base64 字串改為 Buffer;要維持舊行為請把「輸出格式」設為 base64。 支援模型格式新增 YOLO26/YOLOv10 端到端輸出([1,300,6])。

支援平台

內附 binary:linux-x64(一般 x86 伺服器/PC,Node-RED 部署用)、darwin-arm64(mac 本機開發/測試)。 兩者皆自帶 onnxruntime 1.26,目標機免安裝。 其他平台請自行編譯 yolo-plate(見上層專案),並在節點設定「binary 路徑」指定。

測試

npm test        # 需要上層 plate.onnx 與一張範例圖,可用環境變數覆寫:
PLATE_MODEL=/path/plate.onnx PLATE_IMG=/path/img.jpg npm test