Skip to main content

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.

Metadata

Release files for hugging-py-face 0.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hugging-py-face 0.5.3
File Size Uploaded Provenance Actions
hugging_py_face-0.5.3.tar.gz 10.9 kB Without provenance Details for hugging_py_face-0.5.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hugging-py-face 0.5.3
File Interpreter ABI Platform Actions
hugging_py_face-0.5.3-py3-none-any.whl Python 3 none any Details for hugging_py_face-0.5.3-py3-none-any.whl

Total release size: 36.6 kB

Release files / hugging_py_face-0.5.3.tar.gz

Download URL hugging_py_face-0.5.3.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
66613b9ff3be2ea18b0750bd38c6d815dcd4b97d0ced0a5764a7998c74d4e1f8
BLAKE2b-256 checksum
How to use checksums
3bc30202dcc0febaf407966fe37d296bc3f2dac9b33e2372a8654f8fb26e57d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.9

Release files / hugging_py_face-0.5.3-py3-none-any.whl

Download URL hugging_py_face-0.5.3-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96d01eb7789d5fbbacac89134d4d77d982d95135a44ede93d35eb0255f7f866b
BLAKE2b-256 checksum
How to use checksums
7c55d0ca40964568399a0b91caba41d1e786cc73997b668bf9bd62fc591a684a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.9

Security for hugging-py-face 0.5.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page