Python realizes image recognition car function

The example in this article shares the specific code of python to realize the image recognition of the car for your reference. The specific content is as follows

Ready to work

1、 Log in to the developer console

2、 Install pip install baidu-aip module

Code

from aip import AipImageClassify

"""
 APPID AK SK
"""
# Fill in the three parameters obtained in Baidu Yunchuang's instance application below
APP_ID ='1***7'
API_KEY ='U***O'
SECRET_KEY ='****'
client =AipImageClassify(APP_ID, API_KEY, SECRET_KEY)

# Open the picture file and read the binary picture information
def get_file_content(file_path):withopen(file_path,'rb')as f:return f.read()

image =get_file_content('111.jpg')"""
 Call vehicle identification
"""
# {" top_num":1}Represents the first of multiple models returned

# Call the carDectect method of the client object
print(client.carDetect(image, options={"top_num":1})["result"][0]["name"])

Show results

The above is the whole content of this article, I hope it will be helpful to your study, and I hope you can support website (zalou.cn).

Articles you may be interested in:

Recommended Posts

Python realizes image recognition car function
Python image recognition OCR
Python realizes online translation function
Python implements image stitching function
Python realizes udp transmission picture function
python3 realizes the function of mask drawing
Python enumerate() function
Python function buffer
Python realizes spaceship war
Python|Flask realizes login function
Python custom function basics
Join function in Python
Python built-in function -compile()
Python function basic learning
Python data analysis-apply function
python PIL open\display\save image
Python implements image stitching
Python realizes stitching pictures
Python3 built-in function table.md
python+OpenCV realizes image stitching
Python Print print timer function
Python realizes online translation
Python realizes tank battle
Python defines a function method
Python3 realizes airplane war game
Python realizes the guessing game
Python realizes 3D map visualization
Python implements car management system
Python realizes face sign-in system
Python tornado upload file function
Python implements panoramic image stitching
Python magic function eval () learning
How Python implements FTP function
python opencv for image stitching
Python implements verification code recognition
Python realizes batch naming photos
Python high-order function usage summary!