Closed jdimpson closed 1 week ago
OK the simplest and I think best fix was to change line 163 of detection.py
from:
f"filesrc location={self.video_source} name=src_0 ! "
to
f"filesrc location=\"{self.video_source}\" name=src_0 ! "
Similar fixes in instance_segmentation.py
and pose_estimation.py
are needed where filesrc
is being configured.
When I run:
python ./basic_pipelines/detection.py --input '/media/video/movies/Godzilla Minus One (2023)/Sample 2.mp4'
I get the following output (I've truncated length of the first and third lines of output, but not, I believe, the important parts):
It seems the spaces in the file name are not being passed to the call to gstreamer correctly.
When I run the modified command:
python ./basic_pipelines/detection.py --input '/media/video/movies/Godzilla\ Minus\ One\ \(2023\)/Sample\ 2.mp4'
the example works as expected (except that sometimes Godzilla is detected as a horse and sometimes as a bird, but I'll open a a different issue for that[1]). The outlook looks like this (again, truncated):
I think
detection.py
needs to use Python's pathlib when handlingfilesrc
inputs, or at least needs to implement some kind of escape code to handle spaces and perhaps other odd characters in file names.Are you open to merge requests?
[1] For the record, this is a joke. Obviously I'd have to open a detection-related issue on the appropriate YOLO* data set repositories!