In this section, we will provide a demonstration of using Breadboard to perform image classification using the Hugging Face inference API.

WARNING

Because the core kit stringifies the request body, this wont currently work inside of the board.

However it can still be run on CLI as it demonstrates the expected board functionality using built in fetch function.

Introduction

In this demonstration, we will be showcasing how to use a board to classify images. This demo is performed using the CLI environment due to a current bug in the core kit. The issue lies in the way requests are handled: they are always stringified, while the API endpoint expects raw binary format images.

See more about the endpoint here.

Image Classification Process

The Hugging Face board takes an image as input and returns a set of labels attempting to classify the image. For this demonstration, we will use a picture of a cat.

Running the Board

  1. Upload Image: Begin by uploading the image to be classified.
  2. Execute Classification: Run the board to classify the uploaded image.

Results

Upon running the board, the output consists of labels related to the image content. For our cat image, all the labels returned were associated with cats, indicating successful image classification.

Future Use Cases

This could be useful functionality in our Chrome Breadboard API. This would enable users to upload images via a browser or take screenshots and classify these images using the Hugging Face board.

Conclusion

This demonstration illustrates the current capabilities and future potential of the Hugging Face board for image classification within the Breadboard project.

Source