Commit f288dac3 authored by Manoj Kumar's avatar Manoj Kumar

Merge branch 'amashi_dev' into 'master'

Linked textToSign.html file with python backend

See merge request !60
parents 281617e0 24026302
......@@ -18,31 +18,30 @@ app.config["DEBUG"] = True
def testApi():
return "<h1>The API is working</h1>"
##DATAQ
# DATAQ
# route to redirect Home page
@app.route('/')
def home():
return render_template('homePage.html')
@app.route('/cam')
def openCam():
os.system('python dataq\detect.py')
## END DATAQ
# END DATAQ
# route to redirect About Us page
@app.route('/about')
def about():
return render_template('about.html')
# route to redirect Text Translation page
@app.route('/tts')
def textToSignLanguage():
return render_template('index.html')
# route to display GIF image to the user
@app.route('/tts/response/', methods=['POST'])
def response():
......@@ -67,7 +66,7 @@ def clearoutputfolder():
# route to redirect Sign Translation page
@app.route('/textToSign')
@app.route('/tts')
def textToSignEngine():
return render_template('textToSign.html')
......
# This file is for Frontends ###################33
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('homePage.html')
@app.route('/about')
def about():
return render_template('about.html')
@app.route('/signToText')
def signToTextEngine():
return render_template('signToText.html')
@app.route('/textToSign')
def textToSignEngine():
return render_template('textToSign.html')
@app.route('/textToSign/response/', methods=['POST'])
def response():
return render_template('about.html')
@app.route('/contactUs')
def contactUs():
return render_template('contactUs.html')
if __name__ == "__main__":
app.run(debug=True)
#from reveng.processInput import processInput
from reveng.processSentence import processCommonSentence
from reveng.processWord import processWord
#from reveng.processWord import processWord
from reveng.getImages import getImagesCommonSentence
from reveng.getImages import getImagesCommonWord
from reveng.getImages import getImagesRareWord
......
###
# This file is used as a main file for the user-inputs which have same words/sentences
# This file is used as a main file for the user-inputs which have same words/sentences
# appears in common.json file
# @author Amashi Bastiansz | IT17143950
# @version 1.2
# @since 2020-07-30
# @since 2020-07-30
###
import json
import os
from reveng.processWord import processWord
#from reveng.processWord import processWord
from reveng.processSentence import processCommonSentence, processRareSentence
REVENG = os.path.dirname(os.path.abspath(__file__))
......@@ -19,10 +19,10 @@ jsonPath = os.path.join(REVENG, 'common.json')
def checkInJson(message):
###
# This method is used to create a GIF image for the user-input which is similar
# This method is used to create a GIF image for the user-input which is similar
# with a sentence appears in common.json file
# Also, this method is used to create a GIF image for the user-input which is similar
# Also, this method is used to create a GIF image for the user-input which is similar
# with a word appears in common.json file
###
......
###
# This file is used to display the created GIF to user
# This file is still at TESTING PHASE
# @author Amashi Bastiansz | IT17143950
......@@ -34,7 +34,7 @@ def allowed_file(filename):
@app.route('/', methods=['POST'])
def upload_image():
###
# This method is used upload the selected file to the exact folder
# This method is used upload the selected file to the exact folder
# after checking whether the extensions are matched.
# @return redirect to upload.html
......@@ -64,7 +64,7 @@ def display_image(filename):
# @return display the file in the interface
###
return redirect(url_for('static', filename='uploads/' + filename), code=301)
......
###
# This file is used to display the created GIF to the user on the interface
# Still in TESTING phase
# @author Amashi Bastiansz | IT17143950
# @version 1.5
# @since 2020-10-01
# @since 2020-10-01
###
from flask import Flask
......
......@@ -69,7 +69,7 @@
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="signToText">SSL to English Translator</a>
<a class="dropdown-item" href="textToSign">English to SSL Translator</a>
<a class="dropdown-item" href="tts">English to SSL Translator</a>
</div>
</li>
<li class="nav-item @@contact">
......
......@@ -70,7 +70,7 @@
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="signToText">SSL to English Translator</a>
<a class="dropdown-item" href="textToSign">English to SSL Translator</a>
<a class="dropdown-item" href="tts">English to SSL Translator</a>
</div>
</li>
<li class="nav-item active">
......
......@@ -70,7 +70,7 @@
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="signToText">SSL to English Translator</a>
<a class="dropdown-item" href="textToSign">English to SSL Translator</a>
<a class="dropdown-item" href="tts">English to SSL Translator</a>
</div>
</li>
<li class="nav-item active">
......@@ -120,7 +120,7 @@
<div class="col-md-8">
<h1 class="text-white" data-animation-out="fadeOutDown" data-delay-out="5" data-duration-in=".3" data-animation-in="fadeInUp" data-delay-in=".1">You can learn sign language by your own!</h1>
<p class="text-muted mb-4" data-animation-out="fadeOutDown" data-delay-out="5" data-duration-in=".3" data-animation-in="fadeInUp" data-delay-in=".4">We are offering you a chance to learn sign language easily through our translator</p>
<a href="textToSign" class="btn btn-primary" data-animation-out="fadeOutDown" data-delay-out="5" data-duration-in=".3" data-animation-in="zoomIn" data-delay-in=".7">Let's Learn Sign Language</a>
<a href="tts" class="btn btn-primary" data-animation-out="fadeOutDown" data-delay-out="5" data-duration-in=".3" data-animation-in="zoomIn" data-delay-in=".7">Let's Learn Sign Language</a>
</div>
</div>
</div>
......
......@@ -71,7 +71,7 @@
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="signToText">SSL to English Translator</a>
<a class="dropdown-item" href="textToSign">English to SSL Translator</a>
<a class="dropdown-item" href="tts">English to SSL Translator</a>
</div>
</li>
<li class="nav-item @@contact">
......
......@@ -69,7 +69,7 @@
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="signToText">SSL to English Translator</a>
<a class="dropdown-item" href="textToSign">English to SSL Translator</a>
<a class="dropdown-item" href="tts">English to SSL Translator</a>
</div>
</li>
<li class="nav-item @@contact">
......@@ -89,7 +89,7 @@
<div class="row">
<div class="col-md-8">
<ul class="list-inline custom-breadcrumb">
<li class="list-inline-item"><a class="h2 text-primary font-secondary" href="textToSign">English to SSL Translator</a></li>
<li class="list-inline-item"><a class="h2 text-primary font-secondary" href="tts">English to SSL Translator</a></li>
</ul>
<br/>
<p class="text-lighten">Now you can translate any English text to SSL only by entering it here!!</p>
......@@ -111,11 +111,11 @@
</p>
</div>
<br/>
<form id="userForm" class="justify-content-center">
<form id="form" class="justify-content-center" method="POST">
<div class="form-row align-items-center">
<div class="col-auto" id="userInput">
<label class="sr-only" for="userTextInput">Enter Your Text</label>
<input type="text" class="form-control-mb-2" id="userTextInput" placeholder="Enter any text" style="height: 80%; width:100%"/>
<input type="text" class="form-control-mb-2" id="userTextInput" placeholder="Enter any text" style="height: 80%; width:100%" name="msg"/>
</div>
<div class="col-auto">
<button type="submit" class="btn btn-primary mb-2" id="userButtonInput" style="height: 75%;">Translate to Sign</button>
......@@ -184,11 +184,12 @@
//getResponseSign();
});
$("#userForm").on("submit", function (e) {
var message = $("#textInput").val();
$("#form").on("submit", function (e) {
var message = $("#userTextInput").val();
e.preventDefault();
$.ajax({
url: "http://127.0.0.1:5000/textToSign/response/",
//url: "http://127.0.0.1:5000/tts/response/",
url: "http://localhost:3000/tts/response/",
data: JSON.stringify({ message: message }),
method: "POST",
contentType: "application/json",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment