Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify create_modules() 'route' option #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
26 changes: 1 addition & 25 deletions darknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,36 +206,12 @@ def create_modules(blocks):

#If it is a route layer
elif (x["type"] == "route"):
x["layers"] = x["layers"].split(',')

#Start of a route
start = int(x["layers"][0])

#end, if there exists one.
try:
end = int(x["layers"][1])
except:
end = 0



#Positive anotation
if start > 0:
start = start - index

if end > 0:
end = end - index


route = EmptyLayer()
module.add_module("route_{0}".format(index), route)



if end < 0:
filters = output_filters[index + start] + output_filters[index + end]
else:
filters= output_filters[index + start]
filters = sum([output_filters[int(i)] for i in x['layers'].split(',')])



Expand Down