Add permission to the application which run this code. In this case, the code is running under the Code (Visual Studio code), and the Code has to be checked for capturing screens as follows.
Code
from PIL import ImageGrab
import os
import time
def screenGrab():
box = (0, 0, 1920, 1080)
im = ImageGrab.grab(box)
im.save(os.getcwd() + '\\screenshot_' + str(int(time.time())) + '.png', 'PNG')
def main():
screenGrab()
if __name__ == '__main__':
main()
import cv2
import pafy
# Tokyo Station
url = 'https://youtu.be/6YRUWrkV2R4'
video = pafy.new(url)
streams = video.streams
for i in streams:
print(i)
# get best resolution regardless of format
best = video.getbest()
# start the video
cap = cv2.VideoCapture(best.url)
while (True):
ret, frame = cap.read()
cv2.imshow('frame', frame)
if cv2.waitKey(20) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
After adding DatePicker, set properties and compile, and then the following error message was reported.
/Users/*****/Main.storyboard:1:1: Internal error. Please file a bug at feedbackassistant.apple.com and attach “/var/folders/gm/t2l4p33d1r9gpqzscb8kdggw0000gn/T/IB-agent-diagnostics_2020-12-13_14-22-11_398000”.
Cause
Unknown.
In my case, I added DatePicker with count down timer for macCatalyst. And added a few lines of code to change properties. Then, suddenly the error came up. After removing the DatePicker control and then it was solved. I guess it would be a Xcode bug.
Solution
Clean build and rebuild did not work.
Close and reopen the project did not work.
Restart Xcode did not work.
Removed the DatePicker control and rebuild, then it worked.
U^2-Net for human portrait drawing is so cool. I’m just curious that the Style Transfer could do the similar conversion or not. Here is the evaluation result.
Train Image
I used the following partial image from the U2-Net sample image as a training style image.
Parameters
Use Case: Video
Iterations: 400
Other Parameters: Default
Result
I implemented the human portrait drawing by the Style Transfer with Create ML. Here is the result.