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"}:pythonis the path of your python3.6 executable:detect_scriptis the path of thedetect.pyscript.- just leave
:modelset to{:system, "YOLO_MODEL"}- it will load the model name from theYOLO_MODELenvironment variable.