theAIGuysCode / yolov4-deepsort

Object tracking implemented with YOLOv4, DeepSort, and TensorFlow.
GNU General Public License v3.0
1.31k stars 745 forks source link

Containerizing deep sort #103

Open maryam95hallal opened 2 years ago

maryam95hallal commented 2 years ago

Dear author First I'd like to thank you for amazing contribution. Iam working on Containerizing the project. I followed the readme file and installed all dependencies. my current issue is in the line 101 of object tracker

 if return_value:
            frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
            image = Image.fromarray(frame)
        else:
            print('Video has ended or failed, try a different video format!') ###here
            break


this is my docker file (docker file isntalled on ubuntu since I was not able to find a windows docker image that contain tensorflow 2.3.0-rc0-devel-gpu on windows, In fact I could not find any tensorflow version image for windows OS

# syntax=docker/dockerfile:1
FROM tensorflow/serving:2.3.0-rc0-devel-gpu
WORKDIR /home/pc/Desktop/yolo4_deep
COPY requirements-gpu.txt .
# install dependencies
RUN pip install -r requirements-gpu.txt

# copy the content of the local src directory to the working directory
COPY src/ .

# command to run on container start
#CMD ["python","./save_model.py","./object_tracker.py" ]
ENTRYPOINT ["./start.sh"]

my requirments-gpu.txt

opencv-python==4.1.1.26
opencv-contrib-python==4.1.1.26  ##applied that as a troubleshooting procedure when the video is not readed
lxml
tqdm
absl-py
matplotlib
easydict
pillow

here is a script that runs the program

#!/bin/bash
python save_model.py --model 'yolov4' 
python object_tracker.py --model 'yolov4' --video '/home/pc/Desktop/yolov4-deepsort/data/video/out.mp4' --output '/home/pc/Desktop/yolov4-deepsort/outputs/outputs/demo_me.mp4'

The model is Converting correctly. I tried to convert the video to mp4 same error. if you have any question please ask, and please help in troubleshooting that error

maryam95hallal commented 2 years ago

file architecture

  1. src
    • save_model.py
    • object_tracker.py
    • ...
  2. requirements-gpu.txt
  3. Dockerfile
iamnothingCC commented 1 year ago

Did your docker container works? I have same problem with the code line, the webcam is closing