enable local images for efficientnet.py (#116)

This commit is contained in:
dustcollector12
2020-11-13 16:00:12 +01:00
committed by GitHub
parent 420af82888
commit 6f033ea30a

View File

@@ -234,7 +234,10 @@ if __name__ == "__main__":
cap.release()
cv2.destroyAllWindows()
else:
img = Image.open(io.BytesIO(fetch(url)))
if url.startswith('http'):
img = Image.open(io.BytesIO(fetch(url)))
else:
img = Image.open(url)
st = time.time()
out, _ = infer(model, img)
print(np.argmax(out.data), np.max(out.data), lbls[np.argmax(out.data)])