MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / image_to_bytes

Function image_to_bytes

bmtools/tools/hugging_tools/api.py:85–89  ·  view source on GitHub ↗
(img_url)

Source from the content-addressed store, hash-verified

83 return r.status_code == 200 and "loaded" in r.json() and r.json()["loaded"]
84
85def image_to_bytes(img_url):
86 img_byte = io.BytesIO()
87 load_image(img_url).save(img_byte, format="png")
88 img_data = img_byte.getvalue()
89 return img_data
90
91def build_tool(conf) -> Tool:
92 task_list = []

Callers 7

image_to_imageFunction · 0.85
image_segmentationFunction · 0.85
object_detectionFunction · 0.85
image_classificationFunction · 0.85
image_to_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected