I am creating a chrome extension to blur specific category of images.I have the url of images.How can i blur images from websites at run time?
async function loadmodel(image){
console.log(image)
const handler = '/models/model.json';
let model;
model=await tf.loadLayersModel(handler);
const prediction = model.predict(image).dataSync()[0];
console.log(prediction);
if(prediction>=0.5) {
}};
this is one main function if the prediction value is greater than 0.5 the than that image needs to be blurred.The "image" variable has the urls.
You can use a content script to modify the style attribute of the images in the DOM and add filter: blur(5px);
(doesn't have to be 5px, adjust to your needs)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.