Skip to content

Arbath/sinji_web_backend

Repository files navigation

AI Deteksi Depresi (YOLO Face & YOLO Depresi)

Proyek ini adalah sistem deteksi depresi berbasis AI yang menggunakan dua model YOLO (You Only Look Once) yang telah dilatih secara khusus:

  1. YOLO Face: Untuk mendeteksi dan melakukan cropping pada area wajah.
  2. YOLO Depresi: Untuk menganalisis ekspresi wajah dan mengklasifikasikan tingkat/indikasi depresi.

Backend proyek ini dibangun menggunakan Rust dan membutuhkan ONNX Runtime untuk menjalankan inferensi model AI dengan sangat cepat.


Persyaratan Sistem

Sebelum memulai, pastikan Anda telah menginstal Rust v1.92.0 dan Cargo. Jika belum, silakan instal dari situs resminya: Install Rust (rustup)

Anda juga harus memastikan bahwa file model YOLO Anda (.onnx) sudah diletakkan di direktori yang tepat sesuai dengan konfigurasi kode Anda.


Panduan Instalasi & Eksekusi

Pilih sistem operasi yang Anda gunakan untuk melihat langkah-langkah instalasi compiler dan ONNX Runtime.

Linux (Ubuntu/Debian)

1. Install Compiler dan Dependencies

sudo apt-get update
sudo apt-get install -y pkg-config libv4l-dev build-essential libclang-dev clang

2. Download dan Ekstrak ONNX Runtime (v1.24.2)

wget [https://github.com/microsoft/onnxruntime/releases/download/v1.24.2/onnxruntime-linux-x64-1.24.2.tgz](https://github.com/microsoft/onnxruntime/releases/download/v1.24.2/onnxruntime-linux-x64-1.24.2.tgz)
tar -zxvf onnxruntime-linux-x64-1.24.2.tgz

3. Set Environment Variable dan Jalankan Program

export ORT_DYLIB_PATH="$(pwd)/onnxruntime-linux-x64-1.24.2/lib/libonnxruntime.so"
cargo run --release

macOS

1. Install Command Line Tools & Dependencies Buka terminal dan jalankan perintah berikut (membutuhkan Homebrew):

xcode-select --install
brew install pkg-config

2. Download dan Ekstrak ONNX Runtime (v1.24.2 - Universal)

curl -LO [https://github.com/microsoft/onnxruntime/releases/download/v1.24.2/onnxruntime-osx-universal2-1.24.2.tgz](https://github.com/microsoft/onnxruntime/releases/download/v1.24.2/onnxruntime-osx-universal2-1.24.2.tgz)
tar -zxvf onnxruntime-osx-universal2-1.24.2.tgz

3. Set Environment Variable dan Jalankan Program

export ORT_DYLIB_PATH="$(pwd)/onnxruntime-osx-universal2-1.24.2/lib/libonnxruntime.dylib"
cargo run --release

Windows

Gunakan PowerShell untuk menjalankan perintah di bawah ini.

1. Install Build Tools Pastikan Anda telah menginstal Visual Studio Build Tools dengan komponen Desktop development with C++. Anda bisa mengunduhnya dari situs resmi Microsoft.

2. Download dan Ekstrak ONNX Runtime (v1.24.2)

# Download file ZIP
Invoke-WebRequest -Uri "[https://github.com/microsoft/onnxruntime/releases/download/v1.24.2/onnxruntime-win-x64-1.24.2.zip](https://github.com/microsoft/onnxruntime/releases/download/v1.24.2/onnxruntime-win-x64-1.24.2.zip)" -OutFile "onnxruntime.zip"

# Ekstrak file ZIP
Expand-Archive -Path "onnxruntime.zip" -DestinationPath "."

3. Set Environment Variable dan Jalankan Program

# Set path menuju file .dll
$env:ORT_DYLIB_PATH="$PWD\onnxruntime-win-x64-1.24.2\lib\onnxruntime.dll"

# Build dan run
cargo run --release

Frontend

Troubleshooting

  • Error: could not find native static library 'onnxruntime' atau ORT_DYLIB_PATH is not set Pastikan path pada ORT_DYLIB_PATH benar-benar mengarah ke file library libonnxruntime.so (Linux), libonnxruntime.dylib (macOS), atau onnxruntime.dll (Windows). Gunakan absolute path jika relative path gagal.

About

Backend Deteksi Depresi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors