Skip to content

Installing DeepCV

Installing dependencies

DeepCV requires the following libraries (the supported version for each library is as of the current version of DeepCV):

tensorflow-gpu==2.10.0
tensorflow-addons
numpy
scikit-learn
scipy
sympy
matplotlib
ase
imageio
natsort
tabulate
bayesian-optimization
tqdm
pydot
graphviz

One can use this command to install all of them

pip install -r requirements.txt # or conda install --file requirements.txt

Note that installing tensorflow may be sometimes tricky, depending on system environment. Please consult its official website in case you have errors.

Installing DeepCV (Python)

cd deepcv/
python3 -m pip install .
# Test calling the main API
main.py # or deepcv

Installing DeepCV (C++)

Standalone shared library file

export LIB_TF=/usr/local/tensorflow/

g++ -Wall -fPIC -o deepcv.o deepcv.cpp \
    -O3 -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 -fPIC \
    -I${LIB_TF}/include/ -L${LIB_TF}/lib \
    -ltensorflow -ltensorflow_cc -ltensorflow_framework
or just type
make CXXFLAGS="-std=c++14 -fPIC"
and then build an object file
g++ -shared -o deepcv.so deepcv.o

Check if GPU is available for TF

Execute this script to check if TensorFlow 2.x can see GPU.

import tensorflow as tf

assert tf.test.is_gpu_available(), "TF can't see GPU on this machine."
assert tf.test.is_built_with_cuda(), "TF was not built with CUDA."