https://chevereto.com/community/thr...-for-nudity-detection-tagging-and-more.10046/
After See this topic, i wrote a sample code using Realtime Image Moderation API of https://www.moderatecontent.com/
Get your key from https://www.moderatecontent.com/documentation/signup
Customize this code for your prefer and implement Api key
After create a cronjob for this file with same time interval.
That's all ๐
Also,image detecting keep 1 or 2 second per image, therefore image detecting can keep long time if you give long time interval, i think short time interval good for this
After See this topic, i wrote a sample code using Realtime Image Moderation API of https://www.moderatecontent.com/
PHP:
<?php
include('dbconnectfile.php'); //Your database config file
date_default_timezone_set('Europe/Moskov'); // Your time zone
$time=date('Y-m-d H:i:s');
$ptime=date('Y-m-d H:i:s',strtotime('-5 minute')); // You should set your time interval for which content check
$result = mysqli_query($link,"SELECT * FROM chv_images WHERE image_date BETWEEN '$ptime' AND '$time'");
$find=0;
if (mysqli_num_rows($result)>0){
while($r=mysqli_fetch_array($result))
{
$find++;
$imageid=$r["image_id"];
$imagename=$r["image_name"];
$imagex=$r["image_extension"];
$imagedate=$r["image_date"];
$times=date("Y-m-d", strtotime($imagedate));
$timesp=explode('-',$times);
$imgurl='https://i.imgyukle.com/'.$timesp[0].'/'.$timesp[1].'/'.$timesp[2].'/'.$imagename.'.'.$imagex.''; //change to your image direct link and folder type
$links='https://www.moderatecontent.com/api/v2?face=true&key=YOUR API KEY&url='.$imgurl.'';
$file_get_contents=file_get_contents($links);
$parse=json_decode($file_get_contents);
$rating=$parse->rating_label;
if ($rating === "adult"){
mysqli_query($link,"UPDATE chv_images SET image_nsfw='1' WHERE image_id='$imageid'") or die(mysql_error());
}
echo '<p>'.$rating.'</p>';
}
}
Get your key from https://www.moderatecontent.com/documentation/signup
Customize this code for your prefer and implement Api key
After create a cronjob for this file with same time interval.
That's all ๐
Also,image detecting keep 1 or 2 second per image, therefore image detecting can keep long time if you give long time interval, i think short time interval good for this