This project provides a multimodal system for detecting grooming behavior using both voice and text inputs. It includes a REST API built in Python, running on a virtual environment and deployable via SLURM for GPU acceleration.
final/
├── creating_venv.bash # Script to create a Python virtual environment
├── requirements.txt # Python dependencies
├── venv.bash # Script to activate the environment
├── API/
│ ├── main.py # Entry point for REST API
│ ├── check_val.py # Validation helper
│ ├── combined_analysis.py # Core logic for voice+text inference
│ ├── sample.mp3 # Example audio input
│ ├── run_api.slurm # SLURM script for API deployment
│ ├── test_combined_analysis.py # Unit test for analysis logic
│ └── test_endpoints.py # API endpoint tests
git clone https://github.com/zayn303/grooming-detection-api.git
cd grooming-detection-api/finalbash creating_venv.bash
source venv/bin/activatepip install -r requirements.txtcd API
python3 main.pyThe API will start on http://127.0.0.1:5000/.
pytest test_endpoints.py
pytest test_combined_analysis.pyUse the provided sample.mp3 file to test the grooming detection endpoint once the API is running.
POST /analyze
Content-Type: multipart/form-data
Payload:
- audio: sample.mp3
- transcript: "example conversation text"
For running on a SLURM-managed GPU cluster:
sbatch run_api.slurmMake sure the cluster has access to the needed Python environment and GPU.
Key libraries include:
Flask– for REST APItorch,transformers– for running modelslibrosa,torchaudio– for audio preprocessingpytest– for testing
Full list in requirements.txt.
- Andrii Kolomiiets
Bachelor's thesis, Technical University of Košice
This project is licensed under the MIT License.