darkforte / lowpoly Goto Github PK
View Code? Open in Web Editor NEW15-618 Final Project: Transforming an image to low poly style
15-618 Final Project: Transforming an image to low poly style
Hello!
First of all thank you so much for sharing!
I'd like to share my experience about running this project in my Macbook OSX 10.14. As JS developer it was a nice challenge to compile and run :D so i am here to share my experience. So hope of utility for others
export PATH=/Developer/NVIDIA/CUDA-8.0/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-8.0/lib\
${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
otool -L /Developer/NVIDIA/CUDA-8.0/bin/nvcc
/Developer/NVIDIA/CUDA-8.0/bin/nvcc:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 2577.0.0)
Make sure you have xcode basics installed
xcode-select install
Get CMT from apple old archives: Download CLT for XCode 8.2
Dec 2016
sudo xcode-select --switch /Library/Developer/CommandLineTools
Later you may want to revert this change, if you want/can/must restore back to defaults once you finish with this project
sudo xcode-select --reset
brew install opencv@3
export PKG_CONFIG_PATH=/usr/local/opt/opencv@3/lib/pkgconfig
Configure opencv3:
pkg-config --cflags --libs opencv
-gencode arch=compute_61,code=sm_61
NVCC_FLAG and included opencv directorycmake_minimum_required (VERSION 2.8)
set (OPENCV_PATH "/usr/local/opt/opencv@3")
project ("LowPoly")
FIND_PACKAGE(CUDA REQUIRED)
set(CUDA_SEPARABLE_COMPILATION ON)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++11")
SET (CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-O3;--std=c++11;")
message(${CUDA_NVCC_FLAGS})
include_directories(${OPENCV_PATH}/include)
# Include sub-projects.
add_subdirectory ("src")
Find line with LINK_DIRECTORIES and change to follow
LINK_DIRECTORIES(/usr/local/opt/opencv@3/lib)
I had compilation errors at cuda library, you can fix and patch manually by your self:
Edit as sudo following file
/Developer/NVIDIA/CUDA-8.0/include/thrust/system/cuda/detail/cub/util_ptx.cuh
Change lines
return __all(cond);
into return ::__all(cond);
return __any(cond);
into return ::__any(cond);
I found very useful IDE CLion for OSX, as JS dev it was easy to load CMakeLists.txt and rebuild.
./cmake-build-debug/LowPoly -c -i test.jpg -t 30.0 -b 0.2 -e 10e-3 -n 10e-4
@DarkForte @FredHuangBia can you give an example how to save Edge Detection and Selected vertices output as image?
This is how my env looks like
/Library/Developer/CommandLineTools/usr/bin/c++ --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
/usr/bin/make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:46_CST_2017
Cuda compilation tools, release 8.0, V8.0.61
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.