Skip to main content

Hugging-Py-Face, the Python client for the Hugging Face Inference API.

Project description

Hugging-Py-Face

Copyright © 2023 Minura Punchihewa

Hugging-Py-Face is a powerful Python package that provides seamless integration with the Hugging Face Inference API, allowing you to easily perform inference on your machine learning models hosted on the Hugging Face Model Hub.

One of the key benefits of using the Hugging Face Inference API is that it provides a scalable and efficient way to perform inference on your models, by allowing you to easily deploy and serve your models in the cloud. Additionally, the Inference API provides a simple and standardized API that can be used across different programming languages, making it easy to integrate your models with other services and tools.

With Hugging-Py-Face, you can take advantage of these benefits while also enjoying the simplicity and flexibility of using Python.

It allows you to easily customize your API requests, adjust request parameters, handle authentication and access tokens, and interact with a wide range of machine learning models hosted on the Hugging Face Model Hub.

Overall, Hugging-Py-Face is an awesome tool for any machine learning developer or data scientist who wants to perform efficient and scalable inference on their models, while also enjoying the simplicity and flexibility of using Python. Whether you're working on a personal project or a large-scale enterprise application, Hugging-Py-Face can help you achieve your machine learning goals with ease.

Installation

With pip

pip install hugging_py_face

Components

  • NLP (Natural Language Processing): This component deals with processing and analyzing human language. It includes various techniques such as text classification, text generation, summarization and many more.
  • Computer Vision: This component deals with the analysis of visual data from the real world. It includes the image classification and object detection techniques.
  • Audio Processing: This component deals with the analysis of audio signals. It includes the audio classification and speech recognition techniques.

Usage

The library will first need to be configured with a User Access Tokens from the Hugging Face website.

NLP (Natural Language Processing)

from hugging_py_face import NLP

# initialize the NLP class with the user access token
nlp = NLP('hf_...')

# perform text classification
nlp.text_classification("I like you. I love you.")

# perform object detection
nlp.text_generation("The answer to the universe is")

The inputs to these methods can also be a list of strings. For example:

nlp.text_classification(["I like you. I love you.", "I hate you. I despise you."])

Additionally, the fill mask, summarization, text classification and text generation tasks can also be performed on a pandas DataFrame. For example:

nlp.text_classification_in_df(df, 'text')
# where df is a pandas DataFrame and 'text' is the column name containing the text

Computer Vision

from hugging_py_face import ComputerVision

# initialize the ComputerVision class with the user access token
cp = ComputerVision('hf_...')

# perform image classification
# the image can be a local file or a URL
cp.image_classification("cats.jpg")

# perform object detection
# the image can be a local file or a URL
cp.object_detection("cats.jpg")

The inputs to these methods can also be a list of images. For example:

cp.image_classification(["cats.jpg", "dogs.jpg"])

Additionally, the image classification task can also be performed on a pandas DataFrame. For example:

cp.image_classification_in_df(df, 'images')
# where df is a pandas DataFrame and 'images' is the column name containing the image file paths or URLs

Audio Processing

from hugging_py_face import AudioProcessing

# initialize the AudioProcessing class with the user access token
ap = AudioProcessing('hf_...')

# perform audio classification
# the audio file can be a local file or a URL
ap.audio_classification("dogs.wav")

# perform speech recognition
# the audio file can be a local file or a URL
ap.speech_recognition("dogs.wav")

The inputs to these methods can also be a list of audio files. For example:

ap.audio_classification(["dogs.wav", "cats.wav"])

Additionally, both of the above tasks can also be performed on a pandas DataFrame. For example:

ap.audio_classification_in_df(df, 'audio')
# where df is a pandas DataFrame and 'audio' is the column name containing the audio file paths or URLs

License

This code is licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.txt for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hugging_py_face-0.5.3.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

hugging_py_face-0.5.3-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file hugging_py_face-0.5.3.tar.gz.

File metadata

  • Download URL: hugging_py_face-0.5.3.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for hugging_py_face-0.5.3.tar.gz
Algorithm Hash digest
SHA256 66613b9ff3be2ea18b0750bd38c6d815dcd4b97d0ced0a5764a7998c74d4e1f8
MD5 cf508c09cbc618fa51918af8226ae6c3
BLAKE2b-256 3bc30202dcc0febaf407966fe37d296bc3f2dac9b33e2372a8654f8fb26e57d7

See more details on using hashes here.

File details

Details for the file hugging_py_face-0.5.3-py3-none-any.whl.

File metadata

File hashes

Hashes for hugging_py_face-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 96d01eb7789d5fbbacac89134d4d77d982d95135a44ede93d35eb0255f7f866b
MD5 5bd4ad50b57e41c3ae9ae06b4963e9ba
BLAKE2b-256 7c55d0ca40964568399a0b91caba41d1e786cc73997b668bf9bd62fc591a684a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page