View SourceEvision.DNN Example - Object Detection Task with GoogleNet
# set `EVISION_PREFER_PRECOMPILED` to `false`# if you prefer `:evision` to be compiled from source# note that to compile from source, you may need at least 1GB RAM# System.put_env("EVISION_PREFER_PRECOMPILED", "false")Mix.install([{:evision,"~> 0.2"},{:kino,"~> 0.7"},{:req,"~> 0.5"}],system_env:[# optional, defaults to `true`# set `EVISION_PREFER_PRECOMPILED` to `false`# if you prefer `:evision` to be compiled from source# note that to compile from source, you may need at least 1GB RAM{"EVISION_PREFER_PRECOMPILED",true},# optional, defaults to `true`# set `EVISION_ENABLE_CONTRIB` to `false`# if you don't need modules from `opencv_contrib`{"EVISION_ENABLE_CONTRIB",true},# optional, defaults to `false`# set `EVISION_ENABLE_CUDA` to `true`# if you wish to use CUDA related functions# note that `EVISION_ENABLE_CONTRIB` also has to be `true`# because cuda related modules come from the `opencv_contrib` repo{"EVISION_ENABLE_CUDA",false},# required when# - `EVISION_ENABLE_CUDA` is `true`# - and `EVISION_PREFER_PRECOMPILED` is `true`## set `EVISION_CUDA_VERSION` to the version that matches# your local CUDA runtime version## current available versions are# - 118# - 121{"EVISION_CUDA_VERSION","118"},# require for Windows users when# - `EVISION_ENABLE_CUDA` is `true`# set `EVISION_CUDA_RUNTIME_DIR` to the directory that contains# CUDA runtime libraries{"EVISION_CUDA_RUNTIME_DIR","C:/PATH/TO/CUDA/RUNTIME"}])
List of class names. classification_classes_ILSVRC2012.txt
Test image. space_shuttle.jpg
# change to the file's directory# or somewhere you have write permissionFile.cd!(__DIR__)Helper.download!("http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel","bvlc_googlenet.caffemodel")Helper.download!("https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/bvlc_googlenet.prototxt","bvlc_googlenet.prototxt")Helper.download!("https://raw.githubusercontent.com/opencv/opencv/master/samples/data/dnn/classification_classes_ILSVRC2012.txt","classification_classes_ILSVRC2012.txt")Helper.download!("https://docs.opencv.org/4.5.4/space_shuttle.jpg","space_shuttle.jpg")