Hi Team,
Just a quick follow up, what do I need to change here? Last used this for v7.
Code:
_URL = "https://tools.luxonis.com" #"http://tools.luxonis.com/upload" _OUTPUT_FILE_NAME = "output.zip" _FRACTIONS = { "none": 0, "read": 0.1, "initialized": 0.3, "onnx": 0.5, "openvino": 0.65, "blob": 0.8, "json": 0.9, "zip": 1 }
`def convert_yolo(file_path: str, shape: Union[int, Tuple[int, int]] = 416, version: Literal["v10"] = "v10"):
files = {'file': open(file_path, 'rb')}
values = {
'inputshape': shape if isinstance(shape, int) else " ".join(map(str, shape)),
'version': version,
'id': uuid4()
}
file_name = _OUTPUT_FILE_NAME
url = f"{_URL}/upload"
print(url)
# progress bar
proc = multiprocessing.Process(target=get_progress, args=(str(values["id"]),))
proc.start()
# upload files
session = requests.Session()
with session.post(url, files=files, data=values, stream=True) as r:
r.raise_for_status()
proc.terminate()
print(f"Conversion complete. Downloading...")
with open(file_name, 'wb') as f:
for chunk in r.iter_content(chunk_size=8192):
# If you have chunk encoded response uncomment if
# and set chunk_size parameter to None.
# if chunk:
f.write(chunk)
return file_name`
Output:
https://tools.luxonis.com/upload
Progress
HTTP error occurred: 520 Server Error: UNKNOWN for url: https://tools.luxonis.com/upload