Skip to content

Commit 9c16713

Browse files
Use current working directory to store files instead of specific directory
1 parent eaa327b commit 9c16713

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

collect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""Scripts to collect images without running a detection."""
22

33
import sys
4+
import os
45

56
import cv2
67

7-
IMG_ADDR = "/home/pi/Desktop/Object Detection/Raspberry Pi"
8+
IMG_ADDR = str(os.getcwd())
89

910
counter = 0
1011

test/deeplearning_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from utils import vizres, array, plot
1515

1616
# Add project directory to path before importing modules
17-
sys.path.insert(0, "/home/pi/Desktop/Object Detection/Raspberry Pi")
17+
sys.path.insert(0, str(os.getcwd()))
1818

1919

2020
def parse_argument():
@@ -32,7 +32,7 @@ def parse_argument():
3232
"--imgPath",
3333
help="Path of the test images.",
3434
required=False,
35-
default="/home/pi/Desktop/Object Detection/Raspberry Pi/test_data",
35+
default=str(os.getcwd()) + "/test_data",
3636
)
3737
parser.add_argument(
3838
"--numThreads",

test/traditional_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from utils import vizres, array, plot
1212

1313
# Add project directory to path before importing modules
14-
sys.path.insert(0, "/home/pi/Desktop/Object Detection/Raspberry Pi")
14+
sys.path.insert(0, str(os.getcwd()))
1515

1616

1717
def parse_argument():
@@ -30,7 +30,7 @@ def parse_argument():
3030
"--imgPath",
3131
help="Path of the test images.",
3232
required=False,
33-
default="/home/pi/Desktop/Object Detection/Raspberry Pi/test_data",
33+
default=str(os.getcwd()) + "/test_data",
3434
)
3535
parser.add_argument(
3636
"--csvFilename",

utils/video.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010

1111
# Define images and parent directory
12-
IMAGE_DIR = r"/home/pi/Desktop/Object Detection/Raspberry Pi/image"
13-
VIDEO_DIR = r"/home/pi/Desktop/Object Detection/Raspberry Pi/video"
14-
PARENT_DIR = r"/home/pi/Desktop/Object Detection/Raspberry Pi"
12+
PARENT_DIR = str(os.getcwd())
13+
IMAGE_DIR = PARENT_DIR + '/' + 'image'
14+
VIDEO_DIR = PARENT_DIR + '/' + 'video'
1515

1616

1717
def save_img(

0 commit comments

Comments
 (0)