Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Video Scanning Features #29

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

shashankrxj
Copy link

Index.html
• I have added a new div for video input and a div upon I have shown scan result of video.

test.nude.js
• Added functionality to track the last scan time to ensure scans occur at least 5 seconds apart.
• Implemented an event listener for the 'play' event on the video element to trigger scanning.
• Defined a scanFrame function to check if the video is playing and if sufficient time has elapsed since the last scan.
• Within scanFrame, draws the current video frame onto a canvas and converts it to ImageData.
• Utilized nude.scanVideo to scan the video frame for nudity, passing the ImageData.
• Incremented the scanCount variable to keep track of the number of scans performed.
• Updated the displayResultOnVideoContainer function to display the scan results on the webpage.
• Set up a scan interval to execute scanFrame every second.
• Implemented a 'ended' event listener on the video to stop scanning when the video ends.

nude.js
• Added a scanVideo function to directly scan provided image data, enabling scanning without requiring a canvas element.
• Implemented communication with a web worker (worker.nude.js) for parallel processing of image data.
• Created a terminateWorker function to terminate the web worker after processing each image.
• Enhanced the init function to append a script tag for noworker.nude.js if web workers are not supported, here I have replaced
unescape by decodeURIComponent as unescape was depricated.
•Updated the scanImage function to utilize the web worker for image processing, improving performance by offloading
computation.

All other commits are made for changing compressed js file and I have also changed Readme file accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant