Baidu AIP Python SDK

repository·master·Indexed 43 days ago

https://github.com/baidu-aip/python-sdk

A programmatic interface for accessing Baidu's Artificial Intelligence services, including speech, face recognition, OCR, NLP, Knowledge Graph, image censorship, image classification, and image search. Supports Python 2.7+ and 3.x+.

Tokens
418
Snippets
3
Records
4
Agent score
6%

What's inside Baidu AIP

  1. Overview of Baidu AIP SDK modules

    master

    The SDK is structured into several service-specific modules within the aip directory. Each module provides access to a different category of Baidu AI capabilities:

    • speech: Speech services
    • face: Face recognition and analysis
    • ocr: Optical Character Recognition
    • nlp: Natural Language Processing
    • kg: Knowledge Graph
    • imagecensor: Image censorship/moderation
    • imageclassify: Image classification
    • imagesearch: Image search
  2. Import and use Baidu AIP services

    master

    After installation, you can access specific Baidu AI services by importing the corresponding module from the aip package. The SDK is organized by service type (e.g., speech, face, ocr, nlp).

    from aip import speech
    # or
    from aip import face
    # or
    from aip import ocr
  3. Launch the interactive Baidu AIP Python shell

    master

    The bin/aip_client script provides an interactive Python shell pre-configured for rapid testing of the Baidu AIP SDK. When executed, it sets up a Python environment that automatically imports all modules from the aip package and sets the prompt to baidu-aip >>>. This allows you to immediately begin calling API methods without writing a standalone script.

    #!/bin/bash
    
    # Run this script to enter the interactive shell
    ./bin/aip_client