-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
205 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Porn Image Recognition</title> | ||
{# {% load static %}#} | ||
<script src="https://code.jquery.com/jquery-3.2.1.js"></script> | ||
<link rel="stylesheet" | ||
href="http://cdn.amazeui.org/amazeui/2.7.2/css/amazeui.min.css"> | ||
<link rel="icon" type="image/png" sizes="192x192" href="/static/favicon.ico"> | ||
<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.min.js"></script> | ||
<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.ie8polyfill.min.js"></script> | ||
<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.widgets.helper.min.js"></script> | ||
</head> | ||
<body> | ||
<h2 align="center">Porn Image Recognition</h2> | ||
<div align="center"> | ||
<form enctype="multipart/form-data">{% csrf_token %} | ||
<div class="am-form-group am-form-file"> | ||
<button type="button" class="am-btn am-btn-danger am-btn-sm"> | ||
<i class="am-icon-cloud-upload"></i> Choose Image | ||
<input type="file" placeholder="upload image" name="image"> | ||
{# <input id="doc-form-file" type="file" multiple>#} | ||
</button> | ||
</div> | ||
<input type="button" value="detect" id='upload-btn' | ||
class="am-btn am-btn-success" onclick="upload()"> | ||
</form> | ||
<img class="am-img-responsive" alt="" src="" style="max-height: 320px; | ||
margin-top: 5px"/> | ||
</div> | ||
<div align="center"> | ||
<p>The image is <span id="desc" style="color: | ||
red"></span>, AI takes | ||
<span id="time" style="color: red">0</span> seconds! | ||
</p> | ||
</div> | ||
|
||
<footer style="text-align: center"> | ||
Powered by <a href="http://www.lucasx.top:8001/cv/mcloud" target="_blank">MCloud</a> | ||
Supported by <a href="https://www.zhihu.com/people/xulu-0620/activities" | ||
target="_blank">LucasX</a> | ||
</footer> | ||
|
||
<script> | ||
function upload() { | ||
var src = $("input[name='image']").val(); | ||
var imgName = src.split("\\")[src.split('\\').length - 1]; | ||
var data = new FormData($('form').get(0)); | ||
|
||
$.ajax({ | ||
url: 'nsfw', | ||
type: 'POST', | ||
data: data, | ||
cache: false, | ||
processData: false, | ||
contentType: false, | ||
success: function (data) { | ||
console.log('success'); | ||
var result = eval('(' + data + ')'); | ||
$('#desc').text(result.results[0].type); | ||
$('#time').text(result.elapse); | ||
$('img').attr('src', '../../../static/ImgCensorUpload/' + imgName); | ||
} | ||
}); | ||
|
||
return false; | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters