2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00
2026-07-29 15:01:28 +07:00

NOBAR AYAM — Detection by Case (nobar-ayam)

On-demand visual review for suspect chicken batches. Upload a recorded batch video, run inference with the same YOLO pose model as production (per unit), and download an annotated review video.

Does not replace or interfere with the real-time jetson-counter service (port 5000).

Brand NOBAR AYAM — Nonton Bareng, Review Bareng!
Default port 5050
LAN URL (this site) http://192.168.192.96:5050
Install path /opt/nobar-ayam

Reference: System_Plan_Detection_by_Case.md

Features

  • Choose unit: Salatiga or Cicalengka (different models/config)
  • Upload MP4 / AVI / MOV (max 500MB default)
  • Single-job queue (one video at a time)
  • Progress + ETA in browser
  • Annotated output: skeleton, boxes, IDs, counting line, HUD
  • Temp files in /tmp/nobar-ayam — cleaned after download

Deploy di 192.168.192.96 (port 5050)

Jalankan di host Jetson/LAN 192.168.192.96. Port 5050 dipilih agar tidak bentrok dengan dashboard counting di 5000.

# 1. Salin kode
sudo mkdir -p /opt/nobar-ayam
sudo cp -r nobar-ayam/* /opt/nobar-ayam/
sudo chown -R jetson:jetson /opt/nobar-ayam
cd /opt/nobar-ayam

# 2. Config
cp config.env.example .env
nano .env   # sesuaikan CASE_SALATIGA_MODEL / CASE_CICALENGKA_MODEL
sed -i 's/\r$//' .env

# 3. Dependency di venv counter (torch/ultralytics sudah ada)
/opt/jetson-counter/venv-counter/bin/pip install flask opencv-python-headless

# 4. Systemd
sudo cp nobar-ayam.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now nobar-ayam

# 5. Verifikasi
sudo systemctl status nobar-ayam --no-pager
curl -s http://127.0.0.1:5050/api/units
# Browser: http://192.168.192.96:5050

Setelah ubah .env:

sudo systemctl restart nobar-ayam

Log:

sudo journalctl -u nobar-ayam -f

Jika firewall aktif:

sudo ufw allow 5050/tcp
sudo ufw reload

Quick start (manual, tanpa systemd)

cd /opt/nobar-ayam
cp -n config.env.example .env
source /opt/jetson-counter/venv-counter/bin/activate
export PYTHONNOUSERSITE=1
python app.py

Open: http://192.168.192.96:5050

Environment variables

Variable Default Purpose
CASE_PORT 5050 Flask port
CASE_HOST 0.0.0.0 Bind address (LAN)
CASE_TEMP_DIR /tmp/nobar-ayam Temp upload/output
CASE_MAX_UPLOAD_MB 500 Max upload size
CASE_SALATIGA_MODEL /media/jetson/DATA/yolo11n-salatiga.engine Salatiga model
CASE_CICALENGKA_MODEL /media/jetson/DATA/yolo11n-cicalengka.engine Cicalengka model
CASE_IMGSZ 416 Inference size
CASE_HALF true FP16 (TensorRT)
CASE_CONF 0.3 Detection confidence
CASE_DEVICE 0 GPU index

File contoh: config.env.example. App juga membaca .env di folder yang sama saat start.

API

Endpoint Method Description
/ GET Upload UI
/api/units GET List units
/api/jobs POST Upload unit + video
/api/jobs/<id> GET Job status + progress
/api/jobs/<id>/download GET Download annotated MP4
/api/jobs/<id>/cleanup POST Manual temp cleanup

Project layout

File Role
app.py Flask routes + .env loader
case_processor.py Video inference + overlay
case_queue.py Single-job worker queue
case_config.py Per-unit settings
case_batch.py In-memory batch counting
overlay.py Drawing helpers
templates/index.html Web UI (branded)
static/logo.png Brand logo
static/app.js / app.css Frontend
nobar-ayam.service systemd unit
config.env.example Env template

Notes

  • Run on-demand only — avoid heavy jobs while real-time counting is under stress.
  • Model per unit must match the site where the video was recorded.
  • Queue is in-memory; restarting the app clears pending jobs.
  • Port map: counting dashboard 5000, NOBAR AYAM 5050.
S
Description
No description provided
Readme
306 KiB
0 Stars 1 Watchers 0 Forks
Languages
Python 59%
JavaScript 22.7%
Shell 9.1%
CSS 5.6%
HTML 3.6%