Skip to content

Instantly share code, notes, and snippets.

View walkerlala's full-sized avatar

Yubin walkerlala

View GitHub Profile
@zeryx
zeryx / CMakeLists.txt
Created October 11, 2018 17:21
minimal pytorch 1.0 pytorch -> C++ full example demo image at: https://i.imgur.com/hiWRITj.jpg
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(cpp_shim)
set(CMAKE_PREFIX_PATH ../libtorch)
find_package(Torch REQUIRED)
find_package(OpenCV REQUIRED)
add_executable(testing main.cpp)
message(STATUS "OpenCV library status:")
message(STATUS " config: ${OpenCV_DIR}")
git diff -U1 |
  perl -ne '
    if (m|^\+\+\+ b/(.*)|) { $name = $1 }
    if (m|^@@.*\+(\d+),(\d+)|) { $from = $1; $to = $from + $2; print "clang-format -lines=$from:$to -style=file -i $name\n" }
  ' |
  sh
@kyleturner
kyleturner / Remove Submodule
Created January 5, 2012 01:07
How to remove a submodule from a Github project
To remove a submodule you need to:
Delete the relevant line from the .gitmodules file.
Delete the relevant section from .git/config.
Run git rm --cached path_to_submodule (no trailing slash).
Commit and delete the now untracked submodule files.