current position:Home>Cannot unmarshal array into go value of type main
Cannot unmarshal array into go value of type main
2022-06-24 06:24:23【Tsingsee green rhino video】
At present, our EasyCVR Developing on AI Relevant contents of intelligent identification and Analysis , Many users are also interested in us AI I'm curious about the implementation and functions of , But this version is still in internal test and adjustment , Not online yet . We still share our thoughts about AI Implementation process of intelligent analysis , So if you are interested, you can pay attention to us .
In intelligent analysis , We use python License plate recognition , The way is to write a python http Interface , use go Detuning python License plate recognition interface , But when you get the data for conversion , The following error occurred (json: cannot unmarshal array into Go value of type main.LPRData), No information to print .
To analyze problems :
1、 Check whether the interface is invoked in the code to return the request interface code
Print data :
Explain the request http Interface success .
2、 In the json String conversion struct, The definition is as follows :
The conversion function is as follows :
3、 Let's guess if this function can't be converted , So write another function to test the transformation . The code is as follows :
The test results are as follows :
Conclusion :json.Unmarshal It can be converted into struct
4、 After research, we learned that , In the request http When you get the data , This data is an array , So the conversion is wrong , You need to change the converted code into an array .
The results can also be output on the console :
expand :
EasyCVR The intelligent video monitoring platform is based on the Internet platform , Taking digitization and informatization as the development direction , Intelligent analysis and processing of video through computer vision technology , Automatic monitoring in the whole process under unmanned conditions . If you want to know more about EasyCVR platform , Welcome to get the test account to test .
copyright notice
author[Tsingsee green rhino video],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/175/20210720183819920t.html
The sidebar is recommended
- Python simulates keyboard input and mouse operation
- Python get windows special folder path code
- Python segmented download file
- Python setting environment variables for processes
- Python uses multithreading to execute CMD command to shut down
- Python gets the number of days in the previous month
- Python generates 128 barcode (code128)
- [Python] code sharing for drawing 2D scatter diagram
- [Python] output the names of students with the highest or lowest scores and students with lower than average scores
- [Python] implement the maximum and minimum distance algorithm
guess what you like
Python parsing JSON data tutorial
Deep learning project: how to use Python and opencv for face recognition
Pychart developing Django project template common filter tutorial
Using Python to call cloud API to monitor the traffic usage of lightweight application servers
Face core app access - server Python demo
Can Python's "King" status be maintained in the next decade?
How do Python crawlers make money? Six Python crawlers make money. It's not a problem to engage in sidelines
Java or python, which is more suitable for AI development?
How to make beeps in Python for windows ECS
Three sorts (select, bubble, insert) Python version
Random recommended
- Python automatic switching environment
- Detailed explanation of python3 rounding problem
- [Master Wu's Python bakery] day 2
- [Master Wu's Python bakery] day 1
- [Master Wu's Python bakery] day 3
- [Master Wu's Python bakery] day 4
- [Master Wu's Python bakery] day 5
- [Master Wu's Python bakery] day 6
- [Master Wu's Python bakery] day 7
- [Master Wu's Python bakery] day 8
- Introduction and examples of socket programming in Python
- Python notes - permissionerror
- Python notes - deprecationwarning
- Python notes - Open Python project
- Python notes - PIL Library
- Python notes - with as statement
- How to export IPython history to Py file?
- Python multithreading combined with dataloader to load data
- Make Python not echo commands that get password input
- In c/c++ and python programming, null and none cannot be distinguished clearly
- Writing sample code for functions in Python
- Summary of operation methods of Python set (about 20 operation methods), with sample code attached
- Python -- functions
- Anonymous and recursive functions in Python
- How to query the methods (member functions) of a class or an object in Python [using the function dir()]
- Summary of operation methods of Python Dictionary (dict) (about 18 operation methods), with sample code attached
- Collect hot search lists in Python at work, which can be called a fishing artifact
- Running Django and Vue on docker
- Data classification in pandas
- About Python: docxtpl is embedded by default when inserting pictures
- How to solve the problem of CSV? (Language Python)
- Installation and use of redis (Python)
- Python implements sending mail (implements single / group mail verification code)
- On the built-in object type of Python -- number (one of the differences between py2 and PY3)
- Python God uses a problem to help you solve the problems of formal and actual parameters in Python functions
- "Project Euler Python Mini tutorial" 001-010 solution introduction
- Most beginners learn Python and web automation. In this way, they learn and give up
- Python matrices and numpy arrays
- Exciting challenge: Python crawler crawls the cover picture of station B
- After installing python3, use the yum command to report an error?