In this repository (part1 tag) you find the code described in the Real-time Object Detection with Phoenix and Python article.
This version uses Elixir Port, which takes care of launching and communicating with python_scripts/detect.py
. Be sure you have Python 3.6 installed, along with the libraries you find in python_scripts/requirements
.
Configure the Yolo.Worker
in config/dev.exs
config :yolo, Yolo.Worker,
python: "python", # with Anaconda3 and yolo env is "/opt/anaconda3/envs/yolo/bin/python"
detect_script: "python_scripts/detect.py",
model: {:system, "YOLO_MODEL"}
:python
is the path of your python3.6 executable:detect_script
is the path of thedetect.py
script.- just leave
:model
set to{:system, "YOLO_MODEL"}
- it will load the model name from theYOLO_MODEL
environment variable.