Commit ee54bafe authored by Alexander Alekhin's avatar Alexander Alekhin

dnn: fix dnn python test files

parent e03569f3
...@@ -4,13 +4,11 @@ import os ...@@ -4,13 +4,11 @@ import os
import fnmatch import fnmatch
import argparse import argparse
# sys.path.append('<path to opencv_build_dir/lib>')
sys.path.append('/home/arrybn/build/opencv_w_contrib/lib')
try: try:
import cv2 as cv import cv2 as cv
except ImportError: except ImportError:
raise ImportError('Can\'t find opencv. If you\'ve built it from sources without installation, ' raise ImportError('Can\'t find OpenCV Python module. If you\'ve built it from sources without installation, '
'uncomment the line before and insert there path to opencv_build_dir/lib dir') 'configure environemnt variable PYTHONPATH to "opencv_build_dir/lib" directory (with "python3" subdirectory if required)')
try: try:
import torch import torch
except ImportError: except ImportError:
......
...@@ -5,20 +5,16 @@ import os ...@@ -5,20 +5,16 @@ import os
import argparse import argparse
import time import time
# sys.path.append('<path to git/caffe/python dir>')
sys.path.append('/home/arrybn/git/caffe/python')
try: try:
import caffe import caffe
except ImportError: except ImportError:
raise ImportError('Can\'t find caffe. If you\'ve built it from sources without installation, ' raise ImportError('Can\'t find Caffe Python module. If you\'ve built it from sources without installation, '
'uncomment the line before and insert there path to git/caffe/python dir') 'configure environemnt variable PYTHONPATH to "git/caffe/python" directory')
# sys.path.append('<path to opencv_build_dir/lib>')
sys.path.append('/home/arrybn/build/opencv_w_contrib/lib')
try: try:
import cv2 as cv import cv2 as cv
except ImportError: except ImportError:
raise ImportError('Can\'t find opencv. If you\'ve built it from sources without installation, ' raise ImportError('Can\'t find OpenCV Python module. If you\'ve built it from sources without installation, '
'uncomment the line before and insert there path to opencv_build_dir/lib dir') 'configure environemnt variable PYTHONPATH to "opencv_build_dir/lib" directory (with "python3" subdirectory if required)')
class DataFetch(object): class DataFetch(object):
......
...@@ -3,20 +3,16 @@ import sys ...@@ -3,20 +3,16 @@ import sys
import os import os
import argparse import argparse
from imagenet_cls_test_alexnet import MeanChannelsFetch, CaffeModel, DnnCaffeModel, ClsAccEvaluation from imagenet_cls_test_alexnet import MeanChannelsFetch, CaffeModel, DnnCaffeModel, ClsAccEvaluation
# sys.path.append('<path to git/caffe/python dir>')
sys.path.append('/home/arrybn/git/caffe/python')
try: try:
import caffe import caffe
except ImportError: except ImportError:
raise ImportError('Can\'t find caffe. If you\'ve built it from sources without installation, ' raise ImportError('Can\'t find Caffe Python module. If you\'ve built it from sources without installation, '
'uncomment the line before and insert there path to git/caffe/python dir') 'configure environemnt variable PYTHONPATH to "git/caffe/python" directory')
# sys.path.append('<path to opencv_build_dir/lib>')
sys.path.append('/home/arrybn/build/opencv_w_contrib/lib')
try: try:
import cv2 as cv import cv2 as cv
except ImportError: except ImportError:
raise ImportError('Can\'t find opencv. If you\'ve built it from sources without installation, ' raise ImportError('Can\'t find OpenCV Python module. If you\'ve built it from sources without installation, '
'uncomment the line before and insert there path to opencv_build_dir/lib dir') 'configure environemnt variable PYTHONPATH to "opencv_build_dir/lib" directory (with "python3" subdirectory if required)')
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
......
...@@ -5,13 +5,11 @@ import argparse ...@@ -5,13 +5,11 @@ import argparse
import tensorflow as tf import tensorflow as tf
from tensorflow.python.platform import gfile from tensorflow.python.platform import gfile
from imagenet_cls_test_alexnet import MeanValueFetch, DnnCaffeModel, Framework, ClsAccEvaluation from imagenet_cls_test_alexnet import MeanValueFetch, DnnCaffeModel, Framework, ClsAccEvaluation
# sys.path.append('<path to opencv_build_dir/lib>')
sys.path.append('/home/arrybn/build/opencv_w_contrib/lib')
try: try:
import cv2 as cv import cv2 as cv
except ImportError: except ImportError:
raise ImportError('Can\'t find opencv. If you\'ve built it from sources without installation, ' raise ImportError('Can\'t find OpenCV Python module. If you\'ve built it from sources without installation, '
'uncomment the line before and insert there path to opencv_build_dir/lib dir') 'configure environemnt variable PYTHONPATH to "opencv_build_dir/lib" directory (with "python3" subdirectory if required)')
# If you've got an exception "Cannot load libmkl_avx.so or libmkl_def.so" or similar, try to export next variable # If you've got an exception "Cannot load libmkl_avx.so or libmkl_def.so" or similar, try to export next variable
# before runnigng the script: # before runnigng the script:
......
...@@ -5,12 +5,11 @@ import argparse ...@@ -5,12 +5,11 @@ import argparse
import time import time
from imagenet_cls_test_alexnet import CaffeModel, DnnCaffeModel from imagenet_cls_test_alexnet import CaffeModel, DnnCaffeModel
sys.path.append('/home/arrybn/build/opencv_w_contrib/lib')
try: try:
import cv2 as cv import cv2 as cv
except ImportError: except ImportError:
raise ImportError('Can\'t find opencv. If you\'ve built it from sources without installation, ' raise ImportError('Can\'t find OpenCV Python module. If you\'ve built it from sources without installation, '
'uncomment the line before and insert there path to opencv_build_dir/lib dir') 'configure environemnt variable PYTHONPATH to "opencv_build_dir/lib" directory (with "python3" subdirectory if required)')
def get_metrics(conf_mat): def get_metrics(conf_mat):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment