agentleFS
Seeed-ProjectsSeeed-Projects/Seeed-Jetson-DevelopTool/skills/codex/hardhat-setup/AGENTS.md

Seeed-Jetson-DevelopTool / hardhat-setup

AGENTS.md57 starsChanged 4 months agoMITView on GitHub

Train and deploy a hard hat detection ML model using Edge Impulse on Jetson Nano/NX/AGX. Covers Edge Impulse project setup, data collection (public datasets, PC camera, or Jetson camera), model training, and deployment via Edge Impulse CLI or Linux Python SDK.

  • Pipes a download into a shell
  • Installs packages

The file

We split this AGENTS.md into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run one phase at a time. After each phase:

    line 12
  2. Very specific:

    If output contains [STOP] → stop immediately, consult the failure decision tree below.

    line 14
  3. Very specific:

    If output ends with [OK] → tell the user "Phase N complete" and proceed to the next phase.

    line 15
  4. Distinctive:

    After collection, go to "Labeling queue" and draw bounding boxes around heads.

    line 66
  5. Distinctive:

    When training completes, click "Model testing" to evaluate

    line 77
  6. Distinctive:

    Ensure Jetson is connected to Edge Impulse (see Phase 2 Option C), then:

    line 87
  7. Distinctive:

    Run the detection script:

    line 115

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Hard Hat Detection with Edge Impulse on Jetson


Execution model

Run one phase at a time. After each phase:

  • Relay all command output to the user.
  • If output contains [STOP] → stop immediately, consult the failure decision tree below.
  • If output ends with [OK] → tell the user "Phase N complete" and proceed to the next phase.

Prerequisites

RequirementDetails
HardwareNVIDIA Jetson Nano, Xavier NX, or Xavier AGX
PeripheralsUSB camera, HDMI display, keyboard, mouse
AccountEdge Impulse account (https://studio.edgeimpulse.com)
NetworkInternet connection on both PC and Jetson
SoftwareUbuntu on Jetson, Edge Impulse CLI

Phase 1 — Create Edge Impulse project (~2 min)

  1. Register/login at https://studio.edgeimpulse.com
  2. Click "Create new project", name it "Hard hat detection"
  3. Select "Image" as the data type
  4. Set configuration to "Classify multiple objects (object detection)"

[OK] when the project dashboard is visible.


Phase 2 — Collect and label data (~15–30 min)

Choose one of three data collection methods:

Option A — Upload public datasets:

Option B — PC camera:

  • From Dashboard, click "LET'S COLLECT SOME DATA" → select computer
  • Grant camera access, capture images
  • Label as "Hard Hat" and "Head"

Option C — Jetson camera:

  • Connect Jetson to Edge Impulse:
ping -c 3 www.google.com
edge-impulse-linux
  • Select USB camera, name the device
  • Capture and label images from the "Data acquisition" page

After collection, go to "Labeling queue" and draw bounding boxes around heads. Label as "Hard Hat" or "Head".

[OK] when labeled data appears in Data acquisition. [STOP] if Jetson can't connect to Edge Impulse.


Phase 3 — Train the model (~10–30 min)

  1. Go to "Impulse design" → add image processing block and object detection learning block → Save impulse
  2. Click "Image" → configure as "RGB" → "Save Parameters" → "Generate features"
  3. Click "Object detection" → "Start training"
  4. When training completes, click "Model testing" to evaluate

[OK] when model testing shows detection results.


Phase 4 — Deploy to Jetson (~5 min)

Option A — Edge Impulse CLI runner:

Ensure Jetson is connected to Edge Impulse (see Phase 2 Option C), then:

edge-impulse-linux-runner

Copy the displayed URL and open in a browser to see live detection.

Option B — Linux Python SDK:

sudo apt-get install libatlas-base-dev libportaudio2 libportaudiocpp0 portaudio19-dev
pip3 install edge_impulse_linux

Install Edge Impulse CLI for Linux:

sudo apt install python3.7-dev
wget -q -O - https://cdn.edgeimpulse.com/firmware/linux/jetson.sh | bash

Download the model:

edge-impulse-linux-runner --download modelfile.eim

Run the detection script:

python3 hardhat_detectation.py /home/jetson-nano/modelfile.eim

[OK] when detection output shows "Hard Hat" or "Head" labels on the display.


Failure decision tree

SymptomAction
edge-impulse-linux command not foundInstall Edge Impulse CLI: wget -q -O - https://cdn.edgeimpulse.com/firmware/linux/jetson.sh | bash
Jetson can't reach Edge ImpulseCheck internet with ping -c 3 www.google.com. Verify DNS settings.
Camera not detectedEnsure USB camera is connected. Try a different USB port. Check with ls /dev/video*.
Training accuracy is lowCollect more data. Ensure balanced labels. Improve labeling quality with tight bounding boxes.
edge-impulse-linux-runner failsRe-run edge-impulse-linux to reconnect. Check account credentials.
Model download failsAdd --clean flag to switch projects. Check internet connectivity.
Python SDK import errorsEnsure libatlas-base-dev and other dependencies are installed. Reinstall edge_impulse_linux.
Detection display not showingVerify camera is accessible. Check the browser URL from the runner output.

Reference files

  • references/source.body.md — full original Seeed tutorial with step-by-step screenshots, Python SDK code, and deployment details (reference only)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.