{"cells":[{"metadata":{},"cell_type":"markdown","source":"## Prebuilt AlexeyAB/darknet Binary and Python Module\n\nDue to permission constraint on Kaggle notebook container enviroment, it seems not possible to build darknet from source (`libcuda.so` is not accessible).\n\nAfter many attempts, I discovered that we can upload and use the prebuilt binary and python files directly as a Kaggle dataset, then everything works!\n\nHere is a quick demonstration to the [public dataset](https://www.kaggle.com/markpeng/darknetbuildgpu) of darknet files prebuilt from my Ubuntu 18.04 machine. We can now do both training and inference using the native darknet program (https://github.com/AlexeyAB/darknet).\n\nHope this dataset could be helpful to the others and ease the pain.\n\n\n**Note:**\nThe Dockerfile that I used to prebuilt darknet:\n - https://github.com/guitarmind/dockerfiles/blob/master/deepo/18.04/Dockerfile\n - https://hub.docker.com/repository/docker/guitarmind/deepo"},{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"!cp \"../input/darknetbuildgpu/darknet\" .\n!cp \"../input/darknetbuildgpu/libdarknet.so\" .\n!cp \"../input/darknetbuildgpu/darknet.py\" .","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"!ls -la","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"!chmod a+x darknet","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"!./darknet detector train","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"import darknet as dn\ndn.detect","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}