MCPcopy Index your code
hub / github.com/TensorPy/TensorPy / classify

Function classify

tensorpy/image_base.py:150–162  ·  view source on GitHub ↗

Classify an image from a URL or local file path. If a local folder is provided, all images in the folder will be classified.

(image_url_or_path)

Source from the content-addressed store, hash-verified

148
149
150def classify(image_url_or_path):
151 """ Classify an image from a URL or local file path.
152 If a local folder is provided, all images in the folder
153 will be classified. """
154 is_valid_url = web_core.is_valid_url(image_url_or_path)
155 if is_valid_url:
156 return classify_image_url(image_url_or_path)
157 elif isfile(image_url_or_path):
158 return classify_local_image(image_url_or_path)
159 elif isdir(image_url_or_path):
160 return classify_folder_images(image_url_or_path, return_dict=True)
161 else:
162 raise Exception("Expecting an image URL, file path, or folder path!")

Callers

nothing calls this directly

Calls 3

classify_image_urlFunction · 0.85
classify_local_imageFunction · 0.85
classify_folder_imagesFunction · 0.85

Tested by

no test coverage detected