Table of Contents
1. OCR recognition
2. Get ingredient details
Home Technology peripherals AI OCR+ChatGPT is a tough job in identifying food ingredients!

OCR+ChatGPT is a tough job in identifying food ingredients!

May 02, 2023 pm 05:22 PM
chatgpt ocr Identify food

Hello, everyone.

I have shared with you an ingredient list identification program before. This time we use ChatGPT to transform it.

OCR+ChatGPT is a tough job in identifying food ingredients!

The general idea before was to use OCR to identify the text of the ingredient list, and then develop a crawler to crawl the detailed information of each ingredient (crawl Baidu Encyclopedia).

There are two differences in this program. First, the ingredient details are obtained by calling ChatGPT, which eliminates the need for crawling and results in more accurate results.

Second, the web development framework uses gradient. Gradio is similar to streamlit, both of which are designed to facilitate AI personnel to quickly build a framework for web apps.

The source code has been packaged, please see the end of the article.

Simply paste the core code

1. OCR recognition

OCR recognition uses paddle

def __init__(self):
self.paddle_ocr = PaddleOCR(use_angle_cls=False, lang="ch")

def ocr(self, img):
result = self.paddle_ocr.ocr(img, cls=True)
Copy after login

ocr can directly use the pre-trained model, or you can train it yourself A text recognition model. It has been introduced before and will not be repeated here.

OCR+ChatGPT is a tough job in identifying food ingredients!

2. Get ingredient details

Use the drop-down list to display the identified ingredients

OCR+ChatGPT is a tough job in identifying food ingredients!

Click For each ingredient, call ChatGPT's api to obtain ingredient details

OCR+ChatGPT is a tough job in identifying food ingredients!

You can also create an additional dialog box to support further communication with ChatGPT

OCR+ChatGPT is a tough job in identifying food ingredients!

Using ChatGPT also requires magic and api key, everyone needs to solve it by themselves.

The above is the detailed content of OCR+ChatGPT is a tough job in identifying food ingredients!. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

ChatGPT now allows free users to generate images by using DALL-E 3 with a daily limit ChatGPT now allows free users to generate images by using DALL-E 3 with a daily limit Aug 09, 2024 pm 09:37 PM

DALL-E 3 was officially introduced in September of 2023 as a vastly improved model than its predecessor. It is considered one of the best AI image generators to date, capable of creating images with intricate detail. However, at launch, it was exclus

The perfect combination of ChatGPT and Python: creating an intelligent customer service chatbot The perfect combination of ChatGPT and Python: creating an intelligent customer service chatbot Oct 27, 2023 pm 06:00 PM

The perfect combination of ChatGPT and Python: Creating an Intelligent Customer Service Chatbot Introduction: In today’s information age, intelligent customer service systems have become an important communication tool between enterprises and customers. In order to provide a better customer service experience, many companies have begun to turn to chatbots to complete tasks such as customer consultation and question answering. In this article, we will introduce how to use OpenAI’s powerful model ChatGPT and Python language to create an intelligent customer service chatbot to improve

How to install chatgpt on mobile phone How to install chatgpt on mobile phone Mar 05, 2024 pm 02:31 PM

Installation steps: 1. Download the ChatGTP software from the ChatGTP official website or mobile store; 2. After opening it, in the settings interface, select the language as Chinese; 3. In the game interface, select human-machine game and set the Chinese spectrum; 4 . After starting, enter commands in the chat window to interact with the software.

How to develop an intelligent chatbot using ChatGPT and Java How to develop an intelligent chatbot using ChatGPT and Java Oct 28, 2023 am 08:54 AM

In this article, we will introduce how to develop intelligent chatbots using ChatGPT and Java, and provide some specific code examples. ChatGPT is the latest version of the Generative Pre-training Transformer developed by OpenAI, a neural network-based artificial intelligence technology that can understand natural language and generate human-like text. Using ChatGPT we can easily create adaptive chats

Can chatgpt be used in China? Can chatgpt be used in China? Mar 05, 2024 pm 03:05 PM

chatgpt can be used in China, but cannot be registered, nor in Hong Kong and Macao. If users want to register, they can use a foreign mobile phone number to register. Note that during the registration process, the network environment must be switched to a foreign IP.

How to build an intelligent customer service robot using ChatGPT PHP How to build an intelligent customer service robot using ChatGPT PHP Oct 28, 2023 am 09:34 AM

How to use ChatGPTPHP to build an intelligent customer service robot Introduction: With the development of artificial intelligence technology, robots are increasingly used in the field of customer service. Using ChatGPTPHP to build an intelligent customer service robot can help companies provide more efficient and personalized customer services. This article will introduce how to use ChatGPTPHP to build an intelligent customer service robot and provide specific code examples. 1. Install ChatGPTPHP and use ChatGPTPHP to build an intelligent customer service robot.

How to use ChatGPT and Python to implement user intent recognition function How to use ChatGPT and Python to implement user intent recognition function Oct 27, 2023 am 09:04 AM

How to use ChatGPT and Python to implement user intent recognition function Introduction: In today's digital era, artificial intelligence technology has gradually become an indispensable part in various fields. Among them, the development of natural language processing (Natural Language Processing, NLP) technology enables machines to understand and process human language. ChatGPT (Chat-GeneratingPretrainedTransformer) is a kind of

How to develop an AI-based voice assistant using ChatGPT and Java How to develop an AI-based voice assistant using ChatGPT and Java Oct 27, 2023 pm 06:09 PM

How to use ChatGPT and Java to develop an artificial intelligence-based voice assistant. The rapid development of artificial intelligence (Artificial Intelligence, AI for short) has entered various fields, among which voice assistants are one of the popular applications. In this article, we will introduce how to develop an artificial intelligence-based voice assistant using ChatGPT and Java. ChatGPT is an open source project for interaction through natural language, proposed by OpenAI, an AI research institution.

See all articles