{"action":"created","issue":{"url":"https://api.github.com/repos/pjreddie/darknet/issues/885","repository_url":"https://api.github.com/repos/pjreddie/darknet","labels_url":"https://api.github.com/repos/pjreddie/darknet/issues/885/labels{/name}","comments_url":"https://api.github.com/repos/pjreddie/darknet/issues/885/comments","events_url":"https://api.github.com/repos/pjreddie/darknet/issues/885/events","html_url":"https://github.com/pjreddie/darknet/issues/885","id":332830012,"node_id":"MDU6SXNzdWUzMzI4MzAwMTI=","number":885,"title":"Not Related Darknet , compiling with opencv Error in MacOS","user":{"login":"hikariakio","id":31139816,"node_id":"MDQ6VXNlcjMxMTM5ODE2","avatar_url":"https://avatars2.githubusercontent.com/u/31139816?v=4","gravatar_id":"","url":"https://api.github.com/users/hikariakio","html_url":"https://github.com/hikariakio","followers_url":"https://api.github.com/users/hikariakio/followers","following_url":"https://api.github.com/users/hikariakio/following{/other_user}","gists_url":"https://api.github.com/users/hikariakio/gists{/gist_id}","starred_url":"https://api.github.com/users/hikariakio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hikariakio/subscriptions","organizations_url":"https://api.github.com/users/hikariakio/orgs","repos_url":"https://api.github.com/users/hikariakio/repos","events_url":"https://api.github.com/users/hikariakio/events{/privacy}","received_events_url":"https://api.github.com/users/hikariakio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-15T16:00:23Z","updated_at":"2018-06-18T18:23:30Z","closed_at":null,"author_association":"NONE","body":"Hello, I am trying to compile Darknet with Opencv 3.4.1 it shows error like \"namespace cv, blah blah\" \r\nI saw that using 3.4.0 or lower can solve this problem..\r\nBut when i install with \"$ brew install opencv\" , it always give me latest version. How can i install version specific opencv to my mac for compiling with darknet yolo :D"},"comment":{"url":"https://api.github.com/repos/pjreddie/darknet/issues/comments/398149294","html_url":"https://github.com/pjreddie/darknet/issues/885#issuecomment-398149294","issue_url":"https://api.github.com/repos/pjreddie/darknet/issues/885","id":398149294,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODE0OTI5NA==","user":{"login":"pshah123","id":6960204,"node_id":"MDQ6VXNlcjY5NjAyMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6960204?v=4","gravatar_id":"","url":"https://api.github.com/users/pshah123","html_url":"https://github.com/pshah123","followers_url":"https://api.github.com/users/pshah123/followers","following_url":"https://api.github.com/users/pshah123/following{/other_user}","gists_url":"https://api.github.com/users/pshah123/gists{/gist_id}","starred_url":"https://api.github.com/users/pshah123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pshah123/subscriptions","organizations_url":"https://api.github.com/users/pshah123/orgs","repos_url":"https://api.github.com/users/pshah123/repos","events_url":"https://api.github.com/users/pshah123/events{/privacy}","received_events_url":"https://api.github.com/users/pshah123/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T18:23:30Z","updated_at":"2018-06-18T18:23:30Z","author_association":"NONE","body":"It seems for this particular tap, Homebrew only updates the formula on Git. [This SO answer may help](https://stackoverflow.com/questions/35664448/brew-downgrade-formula-to-previous-version-opencv3-3-0-0-on-mac-el-capitan), you can use the method there to get 3.0 or navigate to any commit in the git repo linked in the answer. You can also revert the opencv tap on your computer to an older commit as the brew folder is synced to Git ([see this](https://github.com/kimmobrunfeldt/howto-everything/blob/master/build-opencv-osx.md)).\r\n\r\nAs for building it yourself, this is what I did:\r\n1. Install Python 3, NumPy. (Anaconda is best for this)\r\n2. Install [CMake](https://cmake.org/install/)\r\n3. Download the source code for the version you want from [here](https://github.com/opencv/opencv/releases).\r\n4. Unzip the source code and enter the folder in terminal.\r\n5. Build the source:\r\n``` bash\r\nmkdir build; cd build\r\ncmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DPYTHON_DEFAULT_EXECUTABLE=python3 -DBUILD_opencv_python2=False -DBUILD_opencv_python3=True -DPYTHON3_EXECUTABLE=python3 ../opencv-*\r\nmake -j8\r\nsudo make install\r\n```\r\nFor the `cmake` command, you can find some information about those flags [here](https://docs.opencv.org/3.4.0/d7/d9f/tutorial_linux_install.html). For the `make -j8`, the \"8\" means run 8 jobs in parallel, if your CPU cannot handle this try decreasing the number.\r\n6. Move the package to your Python directory. For me this was in the Anaconda directory, but this should be the path for Mac python:\r\n```\r\necho /usr/local/lib/python3.6/site-packages >> /Library/Frameworks/Python.framework/Versions/3.*/lib/python3.*/site-packages/opencv3.pth\r\n```\r\n\r\nThis much should get it working. The link for more info on flags above also contains all the steps for building on Linux, which are more or less the same on Mac (except for the final step of moving the package) so that is also a good reference."}}
{"actor":{"display_login":"pshah123"}}