forked from rbgirshick/fast-rcnn
-
Notifications
You must be signed in to change notification settings - Fork 34
/
_init_paths.py
38 lines (29 loc) · 982 Bytes
/
_init_paths.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Set up paths for Fast R-CNN."""
import os.path as osp
import sys
import platform
def add_path(path):
if path not in sys.path:
sys.path.insert(0, path)
print 'added {}'.format(path)
this_dir = osp.dirname(__file__)
# Add caffe to PYTHONPATH
# caffe_path = osp.join('caffe', 'python', 'caffe')
# add_path(caffe_path)
caffe_path = osp.join(this_dir, 'caffe-fast-rcnn', 'python')
add_path(caffe_path)
# caffe_path = osp.join(this_dir, 'caffe', 'build_' + platform.node(), 'python')
# add_path(caffe_path)
# Add lib to PYTHONPATH
lib_path = osp.join(this_dir, 'lib')
add_path(lib_path)
lib_path = osp.join(this_dir, 'python_utils')
add_path(lib_path)
root_path = osp.join(this_dir, '.')
add_path(root_path)