Skip to content

Commit

Permalink
update yolov3-spp
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffffffli committed Sep 17, 2018
1 parent 15d836e commit 8446eb1
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ class VideoDetectionLoader:
def __init__(self, path, batchSize=4, queueSize=256):
# initialize the file video stream along with the boolean
# used to indicate if the thread should be stopped or not
self.det_model = Darknet("yolo/cfg/yolov3.cfg")
self.det_model.load_weights('models/yolo/yolov3.weights')
self.det_model = Darknet("yolo/cfg/yolov3-spp.cfg")
self.det_model.load_weights('models/yolo/yolov3-spp.weights')
self.det_model.net_info['height'] = opt.inp_dim
self.det_inp_dim = int(self.det_model.net_info['height'])
assert self.det_inp_dim % 32 == 0
Expand Down
8 changes: 4 additions & 4 deletions dataloader_webcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ class DetectionLoader:
def __init__(self, dataloder, batchSize=1, queueSize=1024):
# initialize the file video stream along with the boolean
# used to indicate if the thread should be stopped or not
self.det_model = Darknet("yolo/cfg/yolov3.cfg")
self.det_model.load_weights('models/yolo/yolov3.weights')
self.det_model = Darknet("yolo/cfg/yolov3-spp.cfg")
self.det_model.load_weights('models/yolo/yolov3-spp.weights')
self.det_model.net_info['height'] = opt.inp_dim
self.det_inp_dim = int(self.det_model.net_info['height'])
assert self.det_inp_dim % 32 == 0
Expand Down Expand Up @@ -244,8 +244,8 @@ class WebcamDetectionLoader:
def __init__(self, webcam = 0, batchSize=1, queueSize=256):
# initialize the file video stream along with the boolean
# used to indicate if the thread should be stopped or not
self.det_model = Darknet("yolo/cfg/yolov3.cfg")
self.det_model.load_weights('models/yolo/yolov3.weights')
self.det_model = Darknet("yolo/cfg/yolov3-spp.cfg")
self.det_model.load_weights('models/yolo/yolov3-spp.weights')
self.det_model.net_info['height'] = opt.inp_dim
self.det_inp_dim = int(self.det_model.net_info['height'])
assert self.det_inp_dim % 32 == 0
Expand Down
4 changes: 2 additions & 2 deletions online_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def loop():
# Load YOLO model
print('Loading YOLO model..')
sys.stdout.flush()
det_model = Darknet("yolo/cfg/yolov3.cfg")
det_model.load_weights('models/yolo/yolov3.weights')
det_model = Darknet("yolo/cfg/yolov3-spp.cfg")
det_model.load_weights('models/yolo/yolov3-spp.weights')
det_model.net_info['height'] = args.inp_dim
det_inp_dim = int(det_model.net_info['height'])
assert det_inp_dim % 32 == 0
Expand Down
2 changes: 1 addition & 1 deletion opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@
help='use fast rendering', action='store_true', default=False)
opt = parser.parse_args()

opt.num_classes = 500
opt.num_classes = 80
4 changes: 2 additions & 2 deletions yolo/cam_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def arg_parse():


if __name__ == '__main__':
cfgfile = "cfg/yolov3.cfg"
weightsfile = "yolov3.weights"
cfgfile = "cfg/yolov3-spp.cfg"
weightsfile = "yolov3-spp.weights"
num_classes = 80

args = arg_parse()
Expand Down
4 changes: 2 additions & 2 deletions yolo/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

#Set up the neural network
print("Loading network.....")
model = Darknet("cfg/yolov3.cfg")
model.load_weights("yolov3.weights")
model = Darknet("cfg/yolov3-spp.cfg")
model.load_weights("yolov3-spp.weights")
print("Network successfully loaded")

model.net_info["height"] = "608"
Expand Down
4 changes: 2 additions & 2 deletions yolo/video_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def arg_parse():
parser.add_argument("--nms_thresh", dest = "nms_thresh", help = "NMS Threshhold", default = 0.4)
parser.add_argument("--cfg", dest = 'cfgfile', help =
"Config file",
default = "cfg/yolov3.cfg", type = str)
default = "cfg/yolov3-spp.cfg", type = str)
parser.add_argument("--weights", dest = 'weightsfile', help =
"weightsfile",
default = "yolov3.weights", type = str)
default = "yolov3-spp.weights", type = str)
parser.add_argument("--reso", dest = 'reso', help =
"Input resolution of the network. Increase to increase accuracy. Decrease to increase speed",
default = "416", type = str)
Expand Down
4 changes: 2 additions & 2 deletions yolo/video_demo_half.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def arg_parse():
parser.add_argument("--nms_thresh", dest = "nms_thresh", help = "NMS Threshhold", default = 0.4)
parser.add_argument("--cfg", dest = 'cfgfile', help =
"Config file",
default = "cfg/yolov3.cfg", type = str)
default = "cfg/yolov3-spp.cfg", type = str)
parser.add_argument("--weights", dest = 'weightsfile', help =
"weightsfile",
default = "yolov3.weights", type = str)
default = "yolov3-spp.weights", type = str)
parser.add_argument("--reso", dest = 'reso', help =
"Input resolution of the network. Increase to increase accuracy. Decrease to increase speed",
default = "416", type = str)
Expand Down

0 comments on commit 8446eb1

Please sign in to comment.