On January 3, 2018, Wang Sicong was forced to use his Weibo to advertise an app that was born less than 10 days ago, "Every day I give out bonuses, and tonight at 9:00 I'll give out 100,000". For him, this day's Weibo is not a birthday party, but a battlefield. Wang Sicong's microblogging opened the road to the popularity of the "national quiz" app.
For a while, live giants have followed the rhythm of "President Wang", "Punch Top Conference", "Cheese Superman" under Yingke, "Million Heroes" under Today's headlines and "Million Battle" under Huajiao Live have appeared. "Million Heroes" and pepper live under the "million combat" have appeared, every day wildly spread millions of cash.
Knowledge quiz games such as "Punching Conference", "Cheese Superman" and "Million Heroes" have caught fire, and the amount of prize money has risen from the initial RMB 50,000 or 100,000 to 1 million, 1.01 million.
In order to be able to answer all 12 questions correctly and share such a huge prize pool, contestants started to find ways to improve their correctness.
As introduced by the host of the program, many respondents started to look for friends around them to answer the questions together in order to cover more types of knowledge and improve their chances of passing.
Various WeChat and QQ quiz groups are born, and everyone shares what they think is the correct answer in the group chat.
What you wouldn't guess is that quiz games actually have plug-ins!
In order to be able to answer all 12 questions correctly and share such a huge prize pool, contestants started to find ways to improve their correctness.
Programmers have designed "helper programs" to retrieve answers quickly.
This program in Python trims and recognizes the text content (questions and options) in the image, then searches the number of times the keyword appears through Baidu, and finally displays the statistics. In this way, the answerer can choose the appropriate answer based on the statistics, greatly improving the correctness of the answer.
So how exactly should programmers play?
First of all, we use WDA to get screenshots, which is an iOS testing framework developed by Facebook, and a few days ago, I saw that it was used as a plugin for WeChat's "Jump", so I went to learn more about it, and I found that it can be used in the Punching Conference as well.
After crop out the location of the title (may need to adapt the phone screen), then call the open OCR interface to read out the text text, and finally call the search engine, you can achieve the effect of the previous gif. This environment is iOS + Mac, if it is Android there should be a more convenient way.
In fact, the initial idea is to hope that the search + select the answer to all automated, the idea is to OCR the question and the candidate answer, composed of three combinations thrown to Baidu or Google search, and then which combination of the results of the highest number of times to choose which. Tried a few questions and found that this is not the case, for example, the above picture of the "camel's hump is to store what?" Most people will probably think it's water, so it appears the most often, but it's actually the wrong answer.
There are two final pain points:
The free OCR interface is called a limited number of times, so you can't go all the way to screenshot recognition, you can only run the program when the topic comes up.
Officially, it's also very condescending, and there are questions that can't be searched. Like this one:
The code is attached at the end:
# python3 import wda import io import import webbrowser import requests import time import base64 from PIL import Image c = () # Baidu OCR API api_key = '' api_secret = '' token = '' while True: (0.5) ('') im = ("./") region = ((75, 315, 1167, 789)) # iPhone 7P imgByteArr = () (imgByteArr, format='PNG') image_data = () base64_data = base64.b64encode(image_data) r = ('/rest/2.0/ocr/v1/general_basic', params={'access_token': token}, data={'image': base64_data}) result = '' for i in ()['words_result']: result += i['words'] result = (result) ('/s?wd='+result) break
(Code source: /blog/204)
This is the whole content of this article.