Post

Replies

Boosts

Views

Activity

Take the screenshot of the WKView with embedded video
Hi All, I am from a data science background and a newbie to swift programming. I would like to take the screenshot of the Webview containing a video. As of now I am able to take the screenshot of the WebView without the video. apparently the video part is shown in the black colour. Below is the code snippet to take the screenshot    func getScreenshot() -> UIImage? {     //creates new image context with same size as view     // UIGraphicsBeginImageContextWithOptions (scale=0.0) for high res capture     UIGraphicsBeginImageContextWithOptions(view.frame.size, true, 0.0)     // renders the view's layer into the current graphics context     if let context = UIGraphicsGetCurrentContext() { view.layer.render(in: context) }     // creates UIImage from what was drawn into graphics context     let screenshot: UIImage? = UIGraphicsGetImageFromCurrentImageContext()     // clean up newly created context and return screenshot     UIGraphicsEndImageContext()     return screenshot   } Simulator: screenshot of the simulator: My aim is to take the screenshot of the view and feed it to the Core ML models to get the predictions. is it possible to take the screenshots of the Web view? If yes, could you please give me some inputs to implement it in the app? Best, Veeresh
1
0
1.1k
Sep ’22
Core ML image classification on videos
Hi, I am from the data science domain and I would like to perform an image classification task on each frame of the video. I have the video available locally and how do I achieve this? In the official Core ML examples, I could see examples on the live camera feed but not from the local video files available on the phone. any starting pointers are really appreciated! Best, Veeresh
2
0
1.6k
Aug ’22