# Priorboxes
ANCHORS_STRIDE = [8, 16, 32, 64, 100, 300]
ANCHORS_ASPECT_RATIOS = [[2], [2, 3], [2, 3], [2, 3], [2], [2]]
# control the size of the default square priorboxes
# REF: https://github.com/weiliu89/caffe/blob/ssd/src/caffe/layers/prior_box_layer.cpp#L164
MIN_SIZE_RATIO = 15 # 0.15 instead of 0.2
MAX_SIZE_RATIO = 90 # 0.9 as in SSD paper
INPUT_DIM = 300

CLASS_WEIGHT = 1.0
BOX_WEIGHT = 1.0

SKIP_L2_LOSS_VARS=['l2_norm_scaler', 'BatchNorm']



import os

def check_for_existing_model(modelDir):

    last_model = None
    last_epoch = -1

    if not os.path.exists(modelDir):
        return last_model, last_epoch
    filelist = os.listdir(modelDir)

    #pdb.set_trace()
    metafiles = [x for x in filelist if '.meta' in x]
    if len(metafiles)<1:
        print('no existing network')
        return last_model, last_epoch
    else:
        for mf in metafiles:
            mf_noextn = os.path.splitext(mf)[0]
            mf_split = mf_noextn.split('-')
            epoch = int(mf_split[1])
            if epoch > last_epoch:
                last_epoch = epoch
                last_model = os.path.join(modelDir,mf_noextn)

        return last_model, last_epoch


655389e12df477e0863e90fc11aa917b042039d2
<mask token>

<mask token>


def check_for_existing_model(modelDir):
    last_model = None
    last_epoch = -1
    if not os.path.exists(modelDir):
        return last_model, last_epoch
    filelist = os.listdir(modelDir)
    metafiles = [x for x in filelist if '.meta' in x]
    if len(metafiles) < 1:
        print('no existing network')
        return last_model, last_epoch
    else:
        for mf in metafiles:
            mf_noextn = os.path.splitext(mf)[0]
            mf_split = mf_noextn.split('-')
            epoch = int(mf_split[1])
            if epoch > last_epoch:
                last_epoch = epoch
                last_model = os.path.join(modelDir, mf_noextn)
        return last_model, last_epoch

ANCHORS_STRIDE = [8, 16, 32, 64, 100, 300]
ANCHORS_ASPECT_RATIOS = [[2], [2, 3], [2, 3], [2, 3], [2], [2]]
MIN_SIZE_RATIO = 15
MAX_SIZE_RATIO = 90
INPUT_DIM = 300
CLASS_WEIGHT = 1.0
BOX_WEIGHT = 1.0
SKIP_L2_LOSS_VARS = ['l2_norm_scaler', 'BatchNorm']
<mask token>


def check_for_existing_model(modelDir):
    last_model = None
    last_epoch = -1
    if not os.path.exists(modelDir):
        return last_model, last_epoch
    filelist = os.listdir(modelDir)
    metafiles = [x for x in filelist if '.meta' in x]
    if len(metafiles) < 1:
        print('no existing network')
        return last_model, last_epoch
    else:
        for mf in metafiles:
            mf_noextn = os.path.splitext(mf)[0]
            mf_split = mf_noextn.split('-')
            epoch = int(mf_split[1])
            if epoch > last_epoch:
                last_epoch = epoch
                last_model = os.path.join(modelDir, mf_noextn)
        return last_model, last_epoch

ANCHORS_STRIDE = [8, 16, 32, 64, 100, 300]
ANCHORS_ASPECT_RATIOS = [[2], [2, 3], [2, 3], [2, 3], [2], [2]]
MIN_SIZE_RATIO = 15
MAX_SIZE_RATIO = 90
INPUT_DIM = 300
CLASS_WEIGHT = 1.0
BOX_WEIGHT = 1.0
SKIP_L2_LOSS_VARS = ['l2_norm_scaler', 'BatchNorm']
import os


def check_for_existing_model(modelDir):
    last_model = None
    last_epoch = -1
    if not os.path.exists(modelDir):
        return last_model, last_epoch
    filelist = os.listdir(modelDir)
    metafiles = [x for x in filelist if '.meta' in x]
    if len(metafiles) < 1:
        print('no existing network')
        return last_model, last_epoch
    else:
        for mf in metafiles:
            mf_noextn = os.path.splitext(mf)[0]
            mf_split = mf_noextn.split('-')
            epoch = int(mf_split[1])
            if epoch > last_epoch:
                last_epoch = epoch
                last_model = os.path.join(modelDir, mf_noextn)
        return last_model, last_epoch

# Priorboxes
ANCHORS_STRIDE = [8, 16, 32, 64, 100, 300]
ANCHORS_ASPECT_RATIOS = [[2], [2, 3], [2, 3], [2, 3], [2], [2]]
# control the size of the default square priorboxes
# REF: https://github.com/weiliu89/caffe/blob/ssd/src/caffe/layers/prior_box_layer.cpp#L164
MIN_SIZE_RATIO = 15 # 0.15 instead of 0.2
MAX_SIZE_RATIO = 90 # 0.9 as in SSD paper
INPUT_DIM = 300

CLASS_WEIGHT = 1.0
BOX_WEIGHT = 1.0

SKIP_L2_LOSS_VARS=['l2_norm_scaler', 'BatchNorm']



import os

def check_for_existing_model(modelDir):

    last_model = None
    last_epoch = -1

    if not os.path.exists(modelDir):
        return last_model, last_epoch
    filelist = os.listdir(modelDir)

    #pdb.set_trace()
    metafiles = [x for x in filelist if '.meta' in x]
    if len(metafiles)<1:
        print('no existing network')
        return last_model, last_epoch
    else:
        for mf in metafiles:
            mf_noextn = os.path.splitext(mf)[0]
            mf_split = mf_noextn.split('-')
            epoch = int(mf_split[1])
            if epoch > last_epoch:
                last_epoch = epoch
                last_model = os.path.join(modelDir,mf_noextn)

        return last_model, last_epoch

