diff --git a/manual_put_model.py b/manual_put_model.py new file mode 100644 index 0000000..7eb5e9c --- /dev/null +++ b/manual_put_model.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +import requests +import os.path +import json + + +URL = "http://10.105.115.192/model" + +FILE = 'Prototype2500SVM' + + +files = { + "modelFile": (os.path.basename(FILE), open(FILE,'rb').read(), 'application/octet-stream', {'Content-length' : os.path.getsize(FILE)}), + "meansFile": (os.path.basename(FILE + "MEANS"), open(FILE + "MEANS",'rb').read(), 'application/octet-stream', {'Content-length' : os.path.getsize(FILE + "MEANS")}), + "info" : (None, json.dumps({'type' : 'svm'}), "application/json") +} + +r = requests.post(URL,files=files) +print("Content: ", r.content) +print("Headers:", r.headers) +r.raise_for_status() +