hunglc007 / tensorflow-yolov4-tflite

YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite
https://github.com/hunglc007/tensorflow-yolov4-tflite
MIT License
2.23k stars 1.24k forks source link

[Suggestion] Path issue when using child process #345

Open shinychan95 opened 3 years ago

shinychan95 commented 3 years ago

As I mention in title, this issue is just suggestion for better code.

First, I use this repo for class project at university, building soda bottle detection application.

Also, the running environment is node.js backend system and the python code executes as subprocess in backend system.

In this situation, the path is not recognized by "./data/kite.jpg". Because the working directory is not current file path.

So, I suggest that below code for general file path.

current_path = os.path.dirname(os.path.abspath(__file__)

image_path = os.path.join(current_path,  "data", "kite.jpg")

# flags.DEFINE_string('image', './data/kite.jpg', 'path to input image')
flags.DEFINE_string('image', image_path, 'path to input image')

Thanks for reading my opinion.