YOLO_v3_tutorial_from_scratch icon indicating copy to clipboard operation
YOLO_v3_tutorial_from_scratch copied to clipboard

What does the manipulation of start and end in shortcut layer mean

Open prashkmr opened this issue 6 years ago • 1 comments

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

I am unable to understand what this means in the shortcut layer.

prashkmr avatar Dec 08 '18 13:12 prashkmr

@prashant030591 this piece may seem strange and quite hard to understand. Actually, the whole 'route' block code can be replaced by the following

    # here we need to deal only with the number of filters 
    elif x['type'] == 'route':
        # route can have one, two, or more sources
        # first, let's make them to be ints
        routes = [int(route) for route in x['layers'].split(',')]
        # then, sum the number of filters from at each mentioned layer
        filters = sum([output_filters[route] for route in routes])

Note: it also helps to deal with a more general case when x['layers'] has more than 2 elements.

@ayooshkathuria it would be nice to have your comments as well. Do you need a PR on this subtle change?

v-iashin avatar Feb 10 '19 15:02 v-iashin