Beispiel #1
0
def apiRun(params):
	model = models.SSDMOBILENET
	params = common.pre(model, params)

	modelFileName='ssdmobilenet_'+params[const.PRECISION] + '.xml'
    
	if params == None:
		return None, None
	if params[const.HARDWARE] == const.GPU:
		modelFileName='ssdmobilenet_'+params[const.PRECISION]+'_b'+str(params[const.BATCH])+'.xml'
		if os.path.exists(modelFileName):
			print("Cannot find model file {}. Please ensure an IR was generated for the requested batch size and precision during compilation.".format(modelFileName))
			sys.exit(1)
	else:
		if os.path.exists(modelFileName):
			print("Cannot find model file {}. Please ensure an IR was generated for the requested precision during compilation.".format(modelFileName))
			sys.exit(1)

	if params[const.MODE] in [const.THROUGHPUT, const.LATENCY]:
		net = SSDMOBILENET(
			os.path.join(paths.MODELS, 'openvino', model, modelFileName),
			params[const.HARDWARE], params[const.PRECISION], params[const.MODE], params[const.BATCH], params[const.CONCURRENCY])
	else:
		net = SSDMOBILENET(
			os.path.join(paths.MODELS, 'openvino', model,modelFileName),
			params[const.HARDWARE], params[const.PRECISION], params[const.MODE], params[const.BATCH] )
	return params, common.run(model, net, params)
Beispiel #2
0
def apiRun(params):
	model = models.SSDMOBILENET
	params = common.pre(model, params)
	if params == None:
		return None, None
	net = SsdMobileNet(
		os.path.join(paths.MODELS, 'tensorflow_lite_quantised', model, 'quantised_PTIQ_edgetpu.tflite'))
	return params, common.run(model, net, params)
Beispiel #3
0
def apiRun(params):
	model = models.SSDMOBILENET
	params = common.pre(model, params)
	if params == None:
		return None, None
	net = SsdMobileNet(
		os.path.join(paths.MODELS, 'tensorflow', model, 'frozen_graph.pb'),
		params[const.HARDWARE])
	return params, common.run(model, net, params)
Beispiel #4
0
def apiRun(params):
    model = models.RESNET50
    params = common.pre(model, params)
    if params == None:
        return None, None
    net = ResNet50(
        os.path.join(paths.MODELS, 'tensorflow', model, 'frozen_graph.pb'),
        params[const.HARDWARE])
    return params, common.run(model, net, params)
Beispiel #5
0
def apiRun(params):
        model = models.MOBILENET
        params = common.pre(model, params)
        if params == None:
                return None, None
        if params[const.MODE] in [const.THROUGHPUT, const.LATENCY]:
                net = MobileNet(os.path.join(paths.MODELS, 'tensorflow_uff', model, 'frozen_graph_mobilenet.uff'),params[const.BATCH],params[const.HARDWARE],params[const.MODE],params[const.PRECISION],params[const.CONCURRENCY])
        else:
                net = MobileNet(os.path.join(paths.MODELS, 'tensorflow_uff', model, 'frozen_graph_mobilenet.uff'),params[const.BATCH],params[const.HARDWARE],params[const.MODE],params[const.PRECISION])
        return params, common.run(model, net, params)
Beispiel #6
0
def apiRun(params):
	model = models.RESNET50
	params = common.pre(model, params)
	if params == None:
		return None, None
	if params[const.PRECISION] == const.FP32:
		net = ResNet50(os.path.join(paths.MODELS, 'tensorflow_lite', model, 'converted_model.tflite'),params[const.HARDWARE])
		return params, common.run(model, net, params)
	if params[const.PRECISION] == const.INT8:
		net = ResNet50(os.path.join(paths.MODELS, 'tensorflow_lite_quantised', model, 'quantised_PTIQ.tflite'),params[const.HARDWARE])
		return params, common.run(model, net, params)
Beispiel #7
0
def apiRun(params):
    model = models.RESNET50
    params = common.pre(model, params)
    if params == None:
        return None, None
    if params[const.MODE] in [const.THROUGHPUT, const.LATENCY]:
        net = ResNet50(
            os.path.join(paths.MODELS, 'openvino', model,
                         'resnet-50_' + params[const.PRECISION] + '.xml'),
            params[const.HARDWARE], params[const.PRECISION],
            params[const.MODE], params[const.BATCH], params[const.CONCURRENCY])
    else:
        net = ResNet50(
            os.path.join(paths.MODELS, 'openvino', model,
                         'resnet-50_' + params[const.PRECISION] + '.xml'),
            params[const.HARDWARE], params[const.PRECISION],
            params[const.MODE], params[const.BATCH])
    return params, common.run(model, net, params)
Beispiel #8
0
def apiRun(params):
    model = models.MOBILENET
    params = common.pre(model, params)
    if params == None:
        return None, None

    if params[const.MODE] in [const.THROUGHPUT, const.LATENCY]:
        net = MobileNet(
            os.path.join(paths.MODELS, 'openvino', model,
                         'mobilenetv1_' + params[const.PRECISION] + '.xml'),
            params[const.HARDWARE], params[const.PRECISION],
            params[const.MODE], params[const.BATCH], params[const.CONCURRENCY])
    else:
        net = MobileNet(
            os.path.join(paths.MODELS, 'openvino', model,
                         'mobilenetv1_' + params[const.PRECISION] + '.xml'),
            params[const.HARDWARE], params[const.PRECISION],
            params[const.MODE], params[const.BATCH])
    return params, common.run(model, net, params)