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

Function image_classification

bmtools/tools/hugging_tools/api.py:259–263  ·  view source on GitHub ↗
(model_id: str, image_file_name: str)

Source from the content-addressed store, hash-verified

257 return str(result)
258 @task
259 def image_classification(model_id: str, image_file_name: str) -> str:
260 inference = InferenceApi(repo_id=model_id, token=CONFIG["huggingface"]["token"])
261 img_data = image_to_bytes(f"{DIRPATH}/{INPUT_PATH}/{image_file_name}")
262 result = inference(data=img_data)
263 return str(result)
264 @task
265 def image_to_text(model_id: str, image_file_name: str) -> str:
266 inference = InferenceApi(repo_id=model_id, token=CONFIG["huggingface"]["token"])

Callers

nothing calls this directly

Calls 1

image_to_bytesFunction · 0.85

Tested by

no test coverage detected