import cv2


# TODO: make this downloadable
PATH_PROTO = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/deploy.prototxt.txt"
PATH_WEIGHTS = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/res10_300x300_ssd_iter_140000.caffemodel"


def get_kernel(params, unparsed_args=None):
    assert params["mode"] == "inference"
    Net = cv2.dnn.readNetFromCaffe(PATH_PROTO, PATH_WEIGHTS)
    return Net

@@ -1,290 +1,598 @@
-import cv2%0A%0A%0A# TODO: make this downloadable%0APATH_PROTO = %22/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/deploy.prototxt.txt%22%0APATH_WEIGHTS = %22/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/res10_300x300_ssd_iter_140000.caffemodel%22%0A%0A%0Adef get_kernel(params, unparsed_args=None):
+from pathlib import Path%0A%0Aimport cv2%0A%0A%0Adef get_kernel(params, unparsed_args=None):%0A    proto = %22deploy.prototxt.txt%22%0A    weights = %22res10_300x300_ssd_iter_140000.caffemodel%22%0A%0A    BASE = Path(%22~/.cache/benchmarker/models%22).expanduser()%0A    PATH_PROTO = BASE.joinpath(proto)%0A    PATH_WEIGHTS = BASE.joinpath(weights)%0A%0A    URL = %22Download https://github.com/thegopieffect/computer_vision/raw/master/CAFFE_DNN/%7B%7D to %7B%7D%22%0A    # TODO(vatai): make this automagically download!%0A    assert PATH_PROTO.exists(), URL.format(proto, str(BASE))%0A    assert PATH_WEIGHTS.exists(), URL.format(weights, str(BASE))
 %0A   
@@ -629,16 +629,17 @@
 erence%22%0A
+%0A
     Net 
@@ -665,16 +665,20 @@
 omCaffe(
+str(
 PATH_PRO
@@ -679,18 +679,23 @@
 TH_PROTO
+)
 , 
+str(
 PATH_WEI
@@ -699,16 +699,17 @@
 WEIGHTS)
+)
 %0A    ret

Fix hardwired weights for res10ssd