付费改一个Chevereto的鉴黄代码 [已经搞定]

搬瓦工机场JMS

update 2019-11-19  22:00
***************************************
已经搞定, 先运行一段时间看看,
带来的问题当然是上传频率下降了, 因为有个API要反馈回来.

########################################

现在用的不理想, 想moderatecontent试试的
要求鉴定黄图后自动删除.

如果方便, 最好再自动封ip (非必要)

这里有相关参考
https://chevereto.com/community/threads/auto-detect-adult-content-and-hide.10869/
https://chevereto.com/community/threads/amazon-rekognition-for-nudity-detection-tagging-and-more.10046/

哪位大佬可以试试呢?

测试可以用Chevereto free

广西网友:

  1. <!–JH Start–>
  2. <?php
  3.         $image_url = get_image()[‘medium’] ? get_image()[‘medium’][‘url’] : get_image()[‘url’];
  4.         $links=’https://www.moderatecontent.com/api/v2?face=true&key=你的API KEY&url=’.$image_url.”;
  5.         $file_get_contents=file_get_contents($links);
  6.         $parse=json_decode($file_get_contents);
  7.         $rating=$parse->rating_label;
  8.         $predictionss=$parse->predictions;
  9.         $teenfs=$predictionss->teen;
  10.         $everyonefs=$predictionss->everyone;
  11.         $adultfs=$predictionss->adult;
  12.         if ($rating === "adult"){
  13.                 //$link = mysqli_connect("localhost", "DBuser", "DBuserpass", "DBname");
  14.                 //$image_title= get_image()[‘id_encoded’];
  15.                 //mysqli_query($link,"UPDATE chv_images SET image_nsfw=’1′ WHERE image_title=’$image_title’") or die(mysql_error());
  16.                 //配置数据库再取消上面的注释
  17.         }
  18.        
  19. ?>
  20. <style type="text/css">
  21. .tg  {border-collapse:collapse;border-spacing:0;margin-left:auto;margin-right:auto;}
  22. .tg td{font-family:Arial, sans-serif;font-size:12px;padding:2px 2px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
  23. .tg th{font-family:Arial, sans-serif;font-size:12px;font-weight:normal;padding:2px 2px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
  24. .tg .tg-1ydw{border-color:#efefef;text-align:center;vertical-align:middle;background-color:#efefef}
  25. .tg .tg-ly6r{border-color:#efefef;text-align:center;vertical-align:middle}
  26. </style>
  27. <table class="tg">
  28.   <tbody><tr>
  29.     <th class="tg-1ydw" colspan="5"><i>AT9.CC – Automatic Content Checker</i></th>
  30.   </tr>
  31.   <tr>
  32.     <th class="tg-ly6r" rowspan="2">
  33.                         <img src="https://ae01.alicdn.com/kf/U636caf26ce094b66a688d4c6064e0860R.png&quot; width="50px"<?php if ($rating === "everyone"){echo ”;} else {echo ‘style="opacity: 0.15;filter: alpha(opacity=15);"’;}?>>
  34.                         <img src="https://ae01.alicdn.com/kf/Ub937d917d851429b9ef923c9f3a0f508i.png&quot; width="50px"<?php if ($rating === "teen"){echo ”;} else {echo ‘style="opacity: 0.15;filter: alpha(opacity=15);"’;}?>>
  35.                         <img src="https://ae01.alicdn.com/kf/Udd3a26447a1841da9ac5bfec7da49bbaE.png&quot; width="50px"<?php if ($rating === "adult"){echo ”;} else {echo ‘style="opacity: 0.15;filter: alpha(opacity=15);"’;}?>>
  36.                 </th>
  37.     <th width="50px" class="tg-ly6r"><b>Everyone</b></th>
  38.     <th width="50px" class="tg-ly6r"><b>Teenager</b></th>
  39.     <th width="50px" class="tg-ly6r"><b>Adult</b></th>
  40.   </tr>
  41.   <tr>
  42.     <td class="tg-ly6r"><?php echo round($teenfs,2)."%" ?></td>
  43.     <td class="tg-ly6r"><?php echo round($everyonefs,2)."%" ?></td>
  44.     <td class="tg-ly6r"><?php echo round($adultfs,2)."%" ?></td>
  45.   </tr>
  46. </tbody></table>
  47. <!–JH End–>

复制代码将上面内容添加到:/app/themes/Peafowl/views/image.php,第134行,
以下代码之下:

  1.         <h1 class="viewer-title" data-text="image-title"><?php echo nl2br(get_image_safe_html()[‘title’]); ?></h1>
  2.         <?php
  3.         }
  4.     ?>

复制代码瞎改了改,修改完成后跟楼主提供的一样,样例:https://at9.cc/image/n11e.n94X

内蒙古网友:估计人工的肾不太够用
重庆网友:为啥不直接用imgurl
西藏网友:测试图片

https://images.guru/i/1ntPc
https://images.guru/i/1nR9K

香港网友:老牛你不是人工剑皇吗
陕西网友:mk一下
山西网友:看了下moderatecontent的api还行。你的预算多少?
澳门网友:接口费也不便宜吧
辽宁网友:打算用moderatecontent 免费的.
如果有其他方案也可以试试.

湖南网友:打算用moderatecontent 免费的.
如果有其他方案也可以试试.

广东网友:厉害!!!
福建网友:老总, 想问问怎么样把设置NSFW改为直接删除?
黑龙江网友:这些鉴黄的api准确率真不行我有个大胆的想法,图床图上传到qiniu 然后有qiniu进行鉴黄,通过后在保存到存储服务器
云南网友:改的好
贵州网友: 我上传一个ultraedit面板截图,居然说不要上传低俗** 并且IP已被记录。
香港网友:
有老总帮忙搞定了, 先测试一段时间


辽宁网友:我觉得把黄图对外隐藏仅管理员可见比较好
澳门网友:那么多黄站, 哪有闲心在图床后台看啊
内蒙古网友:就服你

未经允许不得转载:美国VPS_搬瓦工CN2 GIA VPS » 付费改一个Chevereto的鉴黄代码 [已经搞定]

赞 (0) 打赏

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏