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
广西网友:
- <!–JH Start–>
- <?php
- $image_url = get_image()[‘medium’] ? get_image()[‘medium’][‘url’] : get_image()[‘url’];
- $links=’https://www.moderatecontent.com/api/v2?face=true&key=你的API KEY&url=’.$image_url.”;
- $file_get_contents=file_get_contents($links);
- $parse=json_decode($file_get_contents);
- $rating=$parse->rating_label;
- $predictionss=$parse->predictions;
- $teenfs=$predictionss->teen;
- $everyonefs=$predictionss->everyone;
- $adultfs=$predictionss->adult;
- if ($rating === "adult"){
- //$link = mysqli_connect("localhost", "DBuser", "DBuserpass", "DBname");
- //$image_title= get_image()[‘id_encoded’];
- //mysqli_query($link,"UPDATE chv_images SET image_nsfw=’1′ WHERE image_title=’$image_title’") or die(mysql_error());
- //配置数据库再取消上面的注释
- }
- ?>
- <style type="text/css">
- .tg {border-collapse:collapse;border-spacing:0;margin-left:auto;margin-right:auto;}
- .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;}
- .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;}
- .tg .tg-1ydw{border-color:#efefef;text-align:center;vertical-align:middle;background-color:#efefef}
- .tg .tg-ly6r{border-color:#efefef;text-align:center;vertical-align:middle}
- </style>
- <table class="tg">
- <tbody><tr>
- <th class="tg-1ydw" colspan="5"><i>AT9.CC – Automatic Content Checker</i></th>
- </tr>
- <tr>
- <th class="tg-ly6r" rowspan="2">
- <img src="https://ae01.alicdn.com/kf/U636caf26ce094b66a688d4c6064e0860R.png" width="50px"<?php if ($rating === "everyone"){echo ”;} else {echo ‘style="opacity: 0.15;filter: alpha(opacity=15);"’;}?>>
- <img src="https://ae01.alicdn.com/kf/Ub937d917d851429b9ef923c9f3a0f508i.png" width="50px"<?php if ($rating === "teen"){echo ”;} else {echo ‘style="opacity: 0.15;filter: alpha(opacity=15);"’;}?>>
- <img src="https://ae01.alicdn.com/kf/Udd3a26447a1841da9ac5bfec7da49bbaE.png" width="50px"<?php if ($rating === "adult"){echo ”;} else {echo ‘style="opacity: 0.15;filter: alpha(opacity=15);"’;}?>>
- </th>
- <th width="50px" class="tg-ly6r"><b>Everyone</b></th>
- <th width="50px" class="tg-ly6r"><b>Teenager</b></th>
- <th width="50px" class="tg-ly6r"><b>Adult</b></th>
- </tr>
- <tr>
- <td class="tg-ly6r"><?php echo round($teenfs,2)."%" ?></td>
- <td class="tg-ly6r"><?php echo round($everyonefs,2)."%" ?></td>
- <td class="tg-ly6r"><?php echo round($adultfs,2)."%" ?></td>
- </tr>
- </tbody></table>
- <!–JH End–>
复制代码将上面内容添加到:/app/themes/Peafowl/views/image.php,第134行,
以下代码之下:
- <h1 class="viewer-title" data-text="image-title"><?php echo nl2br(get_image_safe_html()[‘title’]); ?></h1>
- <?php
- }
- ?>
复制代码瞎改了改,修改完成后跟楼主提供的一样,样例: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的鉴黄代码 [已经搞定]