Carica file su 'src/templates'

This commit is contained in:
Paolo Bolettieri 2022-06-22 16:16:51 +02:00
parent 0491140a94
commit 13aed1a3bd
5 changed files with 359 additions and 0 deletions

48
src/templates/index.html Normal file
View File

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Deep Image Search</title>
<link rel="icon" href="{{ url_for('static',filename='img/favicon.ico') }}"/>
<script src="{{ url_for('static',filename='js/ui.js') }}"></script>
</head>
<body>
<div align="center" id="header"><br>
<div style="margin-bottom: 10px; vertical-align: middle;"><img class="header" src="{{ url_for('static',filename='img/deepImgSearch.png') }}" style="max-width: 100%; height: auto; width: auto\9;" alt=""></div>
<table>
<tr>
<td colspan="3">
<div id="searchForm" style="">
<span id="urlText" style="display: none;"><b>Paste image URL</b></span>
<a href="#" id="urlLink" onclick="changeQueryBySampleMod('url')">Paste image URL</a>
<span id="uploadText"><b>Upload an image</b></span>
<a href="#" id="uploadLink" onclick="changeQueryBySampleMod('upload')" style="display: none;">Upload an image</a>
<form id="searchbar" method="POST" enctype="multipart/form-data" name="form1" action="./searchByImg">
<table cellspacing="1" cellpadding="1" border="0">
<tr>
<td valign="top">
<input type="hidden" value="" name="" id="objId">
<input type="hidden" value="tohtml" name="tohtml" id="tohtml">
<input style="display: none;" id="urlToUpload" name="url" type="text" size="49" onclick="" onchange="document.getElementById('queryImage').value=''">
<input id="imageToUpload" name="image" type="file" size="38" onclick="" onchange="document.getElementById('queryImage').value=''">
</td>
<td valign="top">
<input type="image" src="{{ url_for('static',filename='img/Search.png') }}" value="Search" title="Search" onclick="if (trim(document.getElementById('urlToUpload').value)=='' && trim(document.getElementById('imageToUpload').value)=='')return false;">
</td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
<div>
</body>
</html>

47
src/templates/index2.html Normal file
View File

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Deep Image Search</title>
<link rel="icon" href="{{ url_for('static',filename='img/favicon.ico') }}"/>
<script src="{{ url_for('static',filename='js/ui.js') }}"></script>
</head>
<body>
<div align="center" id="header"><br>
<div style="margin-bottom: 10px; vertical-align: middle;"><img class="header" src="{{ url_for('static',filename='img/deepImgSearch.png') }}" style="max-width: 100%; height: auto; width: auto\9;" alt=""></div>
<table>
<tr>
<td colspan="3">
<div id="searchForm" style="">
<span id="urlText" style="display: none;"><b>Paste image URL</b></span>
<a href="#" id="urlLink" onclick="changeQueryBySampleMod('url')">Paste image URL</a>
<span id="uploadText"><b>Upload an image</b></span>
<a href="#" id="uploadLink" onclick="changeQueryBySampleMod('upload')" style="display: none;">Upload an image</a>
<form id="searchbar" method="POST" enctype="multipart/form-data" name="form1" action="./searchByImg">
<table cellspacing="1" cellpadding="1" border="0">
<tr>
<td valign="top">
<input type="hidden" value="" name="" id="objId">
<input style="display: none;" id="urlToUpload" name="url" type="text" size="49" onclick="" onchange="document.getElementById('queryImage').value=''">
<input id="imageToUpload" name="image" type="file" size="38" onclick="" onchange="document.getElementById('queryImage').value=''">
</td>
<td valign="top">
<input type="image" src="{{ url_for('static',filename='img/Search.png') }}" value="Search" title="Search" onclick="if (trim(document.getElementById('urlToUpload').value)=='' && trim(document.getElementById('imageToUpload').value)=='')return false;">
</td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
<div>
</body>
</html>

View File

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Deep Image Search</title>
<link rel="icon" href="{{ url_for('static',filename='img/favicon.ico') }}" />
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/polaroidStyle.css') }}">
<script src= "{{ url_for('static',filename='js/ui.js') }}"></script>
</head>
<body>
<div align="center" id="header"><br>
<div style="margin-bottom: 10px; vertical-align: middle;"><img class="header"
src="{{ url_for('static',filename='img/deepImgSearch.png') }}" style="max-width: 100%; height: auto; width: auto\9;" alt=""></div>
<table>
<tr>
<td colspan="3">
<div id="searchForm" style="">
<span id="urlText" style="display: none;"><b>Paste image URL</b></span>
<a href="#" id="urlLink" onclick="changeQueryBySampleMod('url')" >Paste image URL</a>
<span id="uploadText"><b>Upload an image</b></span>
<a href="#" id="uploadLink" onclick="changeQueryBySampleMod('upload')" style="display: none;">Upload an image</a>
<form id="searchbar" method="POST" enctype="multipart/form-data" name="form1" action="./searchByImg">
<table cellspacing="1" cellpadding="1" border="0">
<tr>
<td valign="top">
<input type="hidden" value="" name="" id="objId">
<input type="hidden" value="true" name="tohtml">
<input type="hidden" value="false" name="rescorer">
<input style="display: none;" id="urlToUpload" name="url" type="text" size="49" onclick="" onchange="document.getElementById('queryImage').value=''">
<input id="imageToUpload" name="image" type="file" size="38" onclick="" onchange="document.getElementById('queryImage').value=''">
</td>
<td valign="top">
<input type="image" src="{{ url_for('static',filename='img/Search.png') }}" value="Search" title="Search" onclick="if (trim(document.getElementById('urlToUpload').value)=='' && trim(document.getElementById('imageToUpload').value)=='')return false;">
</td>
</tr>
</table>
</form></div>
</td>
</tr>
</table>
{%
set css_classes = ["", "large polaroid img1","polaroid img2","small polaroid img3","medium polaroid img4","polaroid img5","polaroid img6","polaroid img7","small polaroid img8","medium polaroid img9","polaroid img10","small polaroid img11","small polaroid img12","small polaroid img13","small polaroid img14","polaroid img15"]
%}
<div align="center" class="photo-album">
{% for i in range(0, 15) %}
{% set id = random_ids[i] %}
{% set objectUrlSmall = id + ".jpg"%}
{% set title = id.split("/")[0] %}
<a href="searchById?tohtml=true&rescorer=false&bw=false&id={%print(id)%}" title="Click To Search" class="{%print(css_classes[i%15+1])%}"><img src="{%print(objectUrlSmall)%}" border="0">
</a>
{% endfor %}
</div>
<div align="center" style="padding-top: 40px;">
<a href="./" title="more random images"><img src="{{ url_for('static',filename='img/refresh.png') }}" width=45></a>
</div>
</body>
</html>

79
src/templates/search.html Normal file
View File

@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Deep Image Search</title>
<link rel="icon" href="{{ url_for('static',filename='img/favicon.ico') }}" />
<script src= "{{ url_for('static',filename='js/ui.js') }}"></script>
</head>
<body>
<div>
<table>
<tr>
<td><a href="." title="Home"><img
src="{{ url_for('static',filename='img/deepImgSearch.png') }}" border="0" align="bottom"
width="160"></a></td>
<td><img id="queryImage" src="{{query_url}}" alt=""
width="80" align="middle"></td>
</table>
<table>
<tr>
<td colspan="3">
<div id="searchForm">
<span id="urlText" style="display: none;"><b>Paste image URL</b></span>
<a href="#" id="urlLink" onclick="changeQueryBySampleMod('url')" >Paste image URL</a>
<span id="uploadText"><b>Upload an image</b></span>
<a href="#" id="uploadLink" onclick="changeQueryBySampleMod('upload')" style="display: none;">Upload an image</a>
<form id="searchbar" method="POST" enctype="multipart/form-data" name="form1" action="./searchByImg">
<table cellspacing="1" cellpadding="1" border="0">
<tr>
<td valign="top">
<input type="hidden" value="" name="" id="objId">
<input type="hidden" value="true" name="tohtml">
<input style="display: none;" id="urlToUpload" name="url" type="text" size="49" onclick="" onchange="document.getElementById('queryImage').value=''">
<input id="imageToUpload" name="image" type="file" size="38" onclick="" onchange="document.getElementById('queryImage').value=''">
</td>
<td valign="top">
<input type="image" src="{{ url_for('static',filename='img/Search.png') }}" value="Search" title="Search" onclick="if (trim(document.getElementById('urlToUpload').value)=='' && trim(document.getElementById('imageToUpload').value)=='')return false;">
</td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
</div>
<div align="center">
<table width="800">
{% set columns = 0 %}
{% for idx in range(results|length) %}
{% if idx% 6 == 0 %}
<tr>
{% endif %}
{% set id = results[idx][0] %}
{% set objectUrlSmall = id + ".jpg"%}
{% set title = id.split("/")[0] %}
<td>
<div>
<img title={{results[idx][1]}} style="width: 160px;" src="{%print(objectUrlSmall)%}" border="0">
<br> <span style="font-size: x-small;">{%print(title)%}</span><br>
</div>
</td>
{% set columns = columns + 1 %}
{% endfor %}
</table>
</div>
</body>
</html>

112
src/templates/searchv1.html Normal file
View File

@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Deep Image Search</title>
<link rel="icon" href="{{ url_for('static',filename='img/favicon.ico') }}" />
<script src= "{{ url_for('static',filename='js/ui.js') }}"></script>
<!-- <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet">-->
</head>
<body style="align: center;">
<div class="wrapper" style="align: center; min-height: 900px;">
<table>
<tr>
<td><a href="." title="Home"><img
src="{{ url_for('static',filename='img/deepImgSearch.png') }}" border="0" align="bottom"
width="160"></a></td>
<td><img id="queryImage" src="{{query_url}}" alt=""
width="80" align="middle"></td>
</table>
<table>
<table>
<tr>
<td colspan="3">
<div id="searchForm" style="">
<span id="urlText" style="display: none;"><b>Paste image URL</b></span>
<a href="#" id="urlLink" onclick="changeQueryBySampleMod('url')" >Paste image URL</a>
<span id="uploadText"><b>Upload an image</b></span>
<a href="#" id="uploadLink" onclick="changeQueryBySampleMod('upload')" style="display: none;">Upload an image</a>
<form id="searchbar" method="POST" enctype="multipart/form-data" name="form1" action="./searchByImg">
<table cellspacing="1" cellpadding="1" border="0">
<tr>
<td valign="top">
<input type="hidden" value="" name="" id="objId">
<input style="display: none;" id="urlToUpload" name="url" type="text" size="49" onclick="" onchange="document.getElementById('queryImage').value=''">
<input id="imageToUpload" name="image" type="file" size="38" onclick="" onchange="document.getElementById('queryImage').value=''">
</td>
<td valign="top">
<input type="image" src="{{ url_for('static',filename='img/Search.png') }}" value="Search" title="Search" onclick="if (trim(document.getElementById('urlToUpload').value)=='' && trim(document.getElementById('imageToUpload').value)=='')return false;">
</td>
</tr>
</table>
</form></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div
style="background-color: rgb(240, 247, 255); border-top-color: rgb(107, 144, 218); border-top-style: solid; border-top-width: 1px; padding: 0 5px 0 5px; margin: 10px 0 0 0">
<!--<div style="float: left;">
<span>
{% if guessed | count > 0%}
{%set comma = ""%}
<span style="font-weight: bold; font-size: medium; color: navy;">Guessed classes:</span>
{%for guess in guessed%}
{%set score = guess[1]%}
{%set label = guess[0]%}
<span style="font-weight: bold; font-size: medium; color: navy;">{%print(comma)%}&nbsp;</span>
<span style="color:#AB5E17;" title="score: {%print(score)%}">{%print(label)%}</span>
{%set comma = ","%}
{% endfor %}
</span>
{% else %}
<span style="font-weight: bold; font-size: medium; color: navy;">:-( </span> <span style="color:#AB5E17;">Sorry, I'm unable to recognize your image </span>
{% endif %}
</div>-->
<div style="clear: both"></div>
</div>
<table>
{% set columns = 0 %}
{% for idx in range(results|length) %}
{% if idx% 6 == 0 %}
<tr>
{% endif %}
{% set id = results[idx][0] %}
{% set objectUrlSmall = "thumbs/" + id %}
{% set title = id.split("/")[0] %}
<td>
<div>
<!-- <a href="search?id={%print(id)%}" title={{results[idx][1]}}><img style="width: 128px; max-width: 100%; height: auto; width: auto\9; border-color: #AACCE1;" src="{%print(objectUrlSmall)%}" border="0"></a>-->
<img title={{results[idx][1]}} style="width: 128px; max-width: 100%; height: auto; width: auto\9; border-color: #AACCE1;" src="{%print(objectUrlSmall)%}" border="0">
<br> <span style="font-size: 1vw; font-weight: bold;">{%print(title)%}</span><br>
</div>
</td>
{% set columns = columns + 1 %}
{% endfor %}
</table>
</body>
</html>