Skip to content

Instantly share code, notes, and snippets.

@jerbly
Created February 27, 2021 21:46
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
global model
if not model:
model = faster_rcnn.model(num_classes=len(class_map))
model_path = os.path.join(context.function_directory, 'quiddler.pt')
model.load_state_dict(torch.load(model_path, map_location=torch.device("cpu")))
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment