Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Preparing for YoloV4 *WAITING-SUPPORT* #68

Merged
merged 4 commits into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ libraries/nitramite_alpr/
models/coco.names
models/yolov3.cfg
models/yolov3.weights
models/yolov4.cfg
models/yolov4.weights
models/car_CNN_13AUGM_CMCMCMCMF.h5py
models/color_model.h5

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ Python side
(Windows only)
1. Download Python 3.6 ( https://www.python.org/ftp/python/3.6.0/python-3.6.0-amd64.exe )
2. Install dependencies `pip install -r requirements_windows.txt`
3. Run `Setup.py` OR Download <b>YOLOv3-608</b> weights, cfg, coco.names https://pjreddie.com/darknet/yolo/
3. Run `Setup.py` OR Download cfg and weights from here https://github.com/AlexeyAB/darknet#pre-trained-models, cfg, coco.names https://pjreddie.com/darknet/yolo/
Ensure that cfg file width and height is 608
4. Extract weights, cfg and coco to `models` folder
5. Download Postgresql server ( https://www.postgresql.org/ ) I am using version <b>11.6</b> but
its also tested with version 12.
Expand Down
12 changes: 6 additions & 6 deletions Setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
urllib.request.urlretrieve(url, models_folder + 'coco.names')

# Download cfg
print('Download yolov3.cfg')
url = 'https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov3.cfg'
urllib.request.urlretrieve(url, models_folder + 'yolov3.cfg')
print('Download yolovX cfg')
url = 'https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov4.cfg'
urllib.request.urlretrieve(url, models_folder + 'yolov4.cfg')

# Download weights
print('Download yolov3.weights')
url = 'https://pjreddie.com/media/files/yolov3.weights'
urllib.request.urlretrieve(url, models_folder + 'yolov3.weights')
print('Download yolovX weights')
url = 'https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights'
urllib.request.urlretrieve(url, models_folder + 'yolov4.weights')

# Completed
print('Setup finished!')
2 changes: 1 addition & 1 deletion module/object_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def filter_negative_values(array_boxes):
def analyze_image(image_object, bool_move_processed):
try:
# Load Yolo
net = cv2.dnn.readNet(models_path + "yolov3.weights", models_path + "yolov3.cfg")
net = cv2.dnn.readNet(models_path + "yolov4.weights", models_path + "yolov4.cfg")

classes = []
with open(models_path + "coco.names", "r") as f:
Expand Down
2 changes: 1 addition & 1 deletion requirements_windows.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
numpy==1.18.1
matplotlib==3.1.2
Pillow==6.2.2
opencv-python==4.1.2.30
opencv-python==4.4.0.44
tensorflow==2.0.1
tensorflow-gpu==2.0.1
Keras==2.3.1
Expand Down