@@ -11,6 +11,7 @@
 - Set global variable DARKNET_FORCE_CPU to True
 - Set environment variable CUDA_VISIBLE_DEVICES to -1
 - Set environment variable "FORCE_CPU" to "true"
+- Set environment variable "DARKNET_PATH" to path darknet lib .so (for Linux)
 
 Directly viewing or returning bounding-boxed images requires scikit-image to be installed (`pip install scikit-image`)
 
@@ -219,7 +220,9 @@ def detect_image(network, class_names, image, thresh=.5, hier_thresh=.5, nms=.45
             lib = CDLL(winGPUdll, RTLD_GLOBAL)
             print("Environment variables indicated a CPU run, but we didn't find {}. Trying a GPU run anyway.".format(winNoGPUdll))
 else:
-    lib = CDLL("./libdarknet.so", RTLD_GLOBAL)
+    lib = CDLL(os.path.join(
+        os.environ.get('DARKNET_PATH', './'),
+        "libdarknet.so"), RTLD_GLOBAL)
 lib.network_width.argtypes = [c_void_p]
 lib.network_width.restype = c_int
 lib.network_height.argtypes = [c_void_p]