Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
503 views
in Technique[技术] by (71.8m points)

pyautogui - How to automate image screenshotting process in python?

I'm working on a project that intends to develop a deep neural network that can detect birds in photographs. Firstly, I am supposed to collect data from a live youtube feed but I am still facing challenges with automating the process of taking screenshots from the livefeed. My code requires continuous manual rerun and I would like to have an automated function:

Here is my code

import  pyautogui, time
time.sleep(20)
screeshot = pyautogui.screenshot()
screeshot.save('image2.png')
print('screenshot taken')
question from:https://stackoverflow.com/questions/65829181/how-to-automate-image-screenshotting-process-in-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Whats the problem? Is it that you want it to keep taking screenshots while your ai is running? if so then just use multiprocessing or threading. or if you just want it to keep running use a loop.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...