Commit f530a77c authored by De Silva K.C.C.C's avatar De Silva K.C.C.C

Merge branch 'IT19161334' into IT19114736

parents da86d1ac b7dc8f7c
import moviepy.editor as mp
clip = mp.VideoFileClip(r"video_input/text.mp4")
clip.audio.write_audiofile(r"audio_input/audio.wav")
\ No newline at end of file
import speech_recognition as sr
import subprocess
import os
import sys
PYTHONIOENCODING = "UTF-8"
FOLDER_AUDIO = "audio_input"
FOLDER_TEXT = "text_output"
LANGUAGE = "en-US"
print("starting...")
if not os.path.isdir(FOLDER_AUDIO):
os.mkdir(FOLDER_AUDIO)
if not os.path.isdir(FOLDER_TEXT):
os.mkdir(FOLDER_TEXT)
paths = [os.path.join(FOLDER_AUDIO, nome) for nome in os.listdir(FOLDER_AUDIO)]
files = [arq for arq in paths if os.path.isfile(arq)]
wav_files = [arq for arq in files if arq.lower().endswith(".wav")]
for filename in wav_files:
r = sr.Recognizer()
with sr.AudioFile(filename) as source:
audio = r.record(source)
command = r.recognize_google(audio, language='en-IN', show_all=True)
print(command)
print("running file {}".format(filename))
filefinal = filename.split("audio_input\\")[1].split(".wav")[0]
filefinal = '{}\\{}.txt'.format(FOLDER_TEXT, filefinal)
with open(filefinal, 'w') as arq:
arq.write(str(command))
print("create a new file {}".format(filefinal))
print("finish")
# Default ignored files
/shelf/
/workspace.xml
EduZone
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.8 (new_env)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="32">
<item index="0" class="java.lang.String" itemvalue="opencv-python" />
<item index="1" class="java.lang.String" itemvalue="cmake" />
<item index="2" class="java.lang.String" itemvalue="numpy" />
<item index="3" class="java.lang.String" itemvalue="dlib" />
<item index="4" class="java.lang.String" itemvalue="thop" />
<item index="5" class="java.lang.String" itemvalue="scikit-image" />
<item index="6" class="java.lang.String" itemvalue="opencv-contrib-python" />
<item index="7" class="java.lang.String" itemvalue="wincertstore" />
<item index="8" class="java.lang.String" itemvalue="networkx" />
<item index="9" class="java.lang.String" itemvalue="tifffile" />
<item index="10" class="java.lang.String" itemvalue="Flask-Cors" />
<item index="11" class="java.lang.String" itemvalue="PyYAML" />
<item index="12" class="java.lang.String" itemvalue="torch" />
<item index="13" class="java.lang.String" itemvalue="torchvision" />
<item index="14" class="java.lang.String" itemvalue="mysql-connector-python" />
<item index="15" class="java.lang.String" itemvalue="pandas" />
<item index="16" class="java.lang.String" itemvalue="tqdm" />
<item index="17" class="java.lang.String" itemvalue="regex" />
<item index="18" class="java.lang.String" itemvalue="mediapipe" />
<item index="19" class="java.lang.String" itemvalue="seaborn" />
<item index="20" class="java.lang.String" itemvalue="better-profanity" />
<item index="21" class="java.lang.String" itemvalue="colorama" />
<item index="22" class="java.lang.String" itemvalue="PyWavelets" />
<item index="23" class="java.lang.String" itemvalue="imutils" />
<item index="24" class="java.lang.String" itemvalue="pytz" />
<item index="25" class="java.lang.String" itemvalue="torchaudio" />
<item index="26" class="java.lang.String" itemvalue="Flask" />
<item index="27" class="java.lang.String" itemvalue="Pillow" />
<item index="28" class="java.lang.String" itemvalue="flashtext" />
<item index="29" class="java.lang.String" itemvalue="unidecode" />
<item index="30" class="java.lang.String" itemvalue="sklearn" />
<item index="31" class="java.lang.String" itemvalue="nltk" />
</list>
</value>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (new_env)" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/EduZone.iml" filepath="$PROJECT_DIR$/.idea/EduZone.iml" />
</modules>
</component>
</project>
\ No newline at end of file
from flask import Flask, request, render_template, send_file
from flask_cors import CORS
import werkzeug
import cv2
import note_generator.note as note_gen
import topics_find.audio_gen as topic_gen
import note_generator.write_word as writer
import topics_find.bert as bert
app = Flask(__name__)
CORS(app)
video_file_name = ''
pptx_file_name = ''
@app.route('/')
def index():
return render_template('index.html')
@app.route('/upload_action', methods=['GET', 'POST'])
def upload_action():
lecture_video = request.files['lecture_video']
filename_v = werkzeug.utils.secure_filename(lecture_video.filename)
print("\nReceived image File name : " + lecture_video.filename)
lecture_video.save('upload/' + filename_v)
lecture_ppt = request.files['lecture_ppt']
filename = werkzeug.utils.secure_filename(lecture_ppt.filename)
print("\nReceived image File name : " + lecture_ppt.filename)
lecture_ppt.save('upload/' + filename)
global video_file_name
global pptx_file_name
video_file_name = filename_v
pptx_file_name = filename
return render_template('upload.html', video_file_name=video_file_name, pptx_file_name=pptx_file_name)
@app.route('/generate_short_note', methods=['GET', 'POST'])
def generate_short_note():
global video_file_name
global pptx_file_name
text_from_pptx = note_gen.generate_note('upload/' + pptx_file_name)
text_list_from_video, all_text = topic_gen.split_video_file('upload/' + video_file_name)
writer.create_doc()
writer.write_note('short note from lecture video :- ')
for i in text_list_from_video:
writer.write_note(i[1])
writer.write_note('short note from lecture slide (pptx) :- ')
writer.write_note(text_from_pptx)
writer.save_note('upload/' + pptx_file_name.split('.')[0] + '.docx')
doc_filename = pptx_file_name.split('.')[0] + '.docx'
print(doc_filename)
return render_template('short_notes.html', filename=doc_filename)
@app.route('/generate_topics', methods=['GET', 'POST'])
def generate_topics():
global video_file_name
global pptx_file_name
text_list_from_video, all_text = topic_gen.split_video_file('upload/' + video_file_name)
topic_list = []
for index in text_list_from_video:
topic_list.append([index[0], index[1], bert.get_topics_new(index[1])])
return render_template('topics.html', topic_list=topic_list)
@app.route('/short_note/<name>')
def short_note(name):
doc = 'upload\\' + str(name) + '.docx'
print('request', doc)
return send_file(doc, as_attachment=True)
if __name__ == '__main__':
app.run(host="0.0.0.0", port=5200, debug=True)
import language_check
tool = language_check.LanguageTool('en-US')
text = 'A sentence with a error in the Hitchhiker’s Guide tot he Galaxy'
matches = tool.check(text)
matches[0].fromy, matches[0].fromx
matches[0].ruleId, matches[0].replacements
matches[1].fromy, matches[1].fromx
matches[1].ruleId, matches[1].replacements
print(matches[1])
language_check.correct(text, matches)
\ No newline at end of file
from pptx import Presentation
import glob
from pptx.enum.shapes import MSO_SHAPE_TYPE
import note_generator.ocr as ocr
import note_generator.write_word as writer
def iter_picture_shapes(prs):
for slide in prs.slides:
for shape in slide.shapes:
if shape.shape_type == MSO_SHAPE_TYPE.PICTURE:
yield shape
def generate_note(filename):
count = 1
prs = Presentation(filename)
# writer.create_doc()
total_string = ''
print(filename)
print("----------------------")
for slide in prs.slides:
for shape in slide.shapes:
if hasattr(shape, "text"):
print(shape.text)
# writer.write_note(shape.text)
total_string += str(shape.text) + ' '
for picture in iter_picture_shapes(Presentation(filename)):
image = picture.image
# ---get image "file" contents---
image_bytes = image.blob
# ---make up a name for the file, e.g. 'image.jpg'---
image_filename = 'note_generator/image_data/' + str(count) + '.%s' % image.ext
count += 1
with open(image_filename, 'wb') as f:
f.write(image_bytes)
# writer.write_image(image_filename)
# ocr part - this will slow down system
easy_ocr_text = ocr.get_ocr(image_filename)
if easy_ocr_text != 'Did not found any text by ocr' and easy_ocr_text != 'Unable to read by ocr':
total_string += str(easy_ocr_text) + ' '
print(easy_ocr_text)
count += 1
# writer.save_note(str(filename).split('.')[0])
return total_string
import easyocr
def get_ocr(path):
try:
reader = easyocr.Reader(['en'])
print(path)
result = reader.readtext(path)
if result[0][1] is not None:
return result[0][1]
else:
return 'Did not found any text by ocr'
except:
return 'Unable to read by ocr'
{'alternative': [{'transcript': 'two baby chicks headphone very own eggs when they would ask returned home from gathering food for 24 x 7 Pro Kabaddi final anywhere natural on what you discover the Lion treks around her to for it tracks therefore be determined the final babies', 'confidence': 0.8750093}, {'transcript': 'two baby chicks headphone very own eggs when they would ask that returned home from gathering food for 24 x 7 Pro Kabaddi final anywhere natural on what you discover the Lion treks around her to for it tracks therefore be determined to find her babies'}, {'transcript': 'water to baby chicks headphone very own eggs when they would ask that returned home from gathering food for 24 x 7 Pro Kabaddi final anywhere natural on what you discover the Lion treks around her to for it tracks therefore be determined the final babies'}, {'transcript': 'two baby chicks headphone very own eggs when they would ask returned home from gathering food for 24 x 7 Pro Kabaddi final anywhere natural on what you discover the Lion treks around her to for it tracks therefore be determined to find her babies'}, {'transcript': 'water to baby chicks headphone very own eggs when they would ask returned home from gathering food for 24 x 7 Pro Kabaddi final anywhere natural on what you discover the Lion treks around her to for it tracks therefore be determined the final babies'}], 'final': True}
\ No newline at end of file
import docx
mydoc = None
def create_doc():
global mydoc
mydoc = docx.Document()
mydoc.add_heading("Short Note", 0)
def write_heading(text):
global mydoc
mydoc.add_heading(text, 2)
def write_note(text):
global mydoc
mydoc.add_paragraph(text)
def write_image(filename):
global mydoc
mydoc.add_picture(filename, width=docx.shared.Inches(5), height=docx.shared.Inches(7))
def save_note(filename):
global mydoc
mydoc.save(filename + '.docx')
.html {
height: 100%;
}
* {box-sizing: border-box;}
.body {
margin: 0;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
background-image: url( ../images/bg.jpg )
}
.body_login {
height:50%;
width: 50%;
padding: 10px;
margin: 60px auto;
font-family: Arial, Helvetica, sans-serif;
background-image: url( ../images/bg.jpg )
}
.header {
overflow: hidden;
background-color: #e28743;
padding: 5px 10px;
}
.header a {
float: left;
color: White;
text-align: center;
padding: 12px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-radius: 4px;
}
.header a.logo {
font-size: 25px;
font-weight: bold;
}
.header a:hover {
background-color: #76b5c5;
color: black;
}
.header a.active {
background-color: #76b5c5;
color: white;
}
.header-right {
float: right;
}
@media screen and (max-width: 500px) {
.header a {
float: none;
display: block;
text-align: left;
}
.header-right {
float: none;
}
}
.global-container{
height:100%;
display: flex;
align-items: center;
justify-content: center;
float: left;
width: 100%;
}
.login-form {
opacity: 0.9;
width: 340px;
margin: 50px auto;
font-size: 15px;
}
.login-form form {
margin-bottom: 15px;
background: #f7f7f7;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
padding: 30px;
}
.login-form h2 {
margin: 0 0 15px;
}
.form-control, .btn {
min-height: 38px;
border-radius: 2px;
}
.btn {
font-size: 15px;
font-weight: bold;
}
form{
padding-top: 10px;
font-size: 14px;
margin-top: 30px;
}
.card-title{ font-weight:300; }
.card{opacity: 0.9;}
.effect7{
position:relative;
-webkit-box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}
.btn{
font-size: 14px;
margin-top:20px;
}
.login-form{
width:700px;
margin:20px;
}
.sign-up{
text-align:center;
padding:20px 0 0;
}
.alert{
margin-bottom:-30px;
font-size: 13px;
margin-top:20px;
}
.modal-dialog {
max-width: 800px;
margin: 30px auto;
}
.modal-body {
position:relative;
padding:0px;
}
.close {
position:absolute;
right:-30px;
top:0;
z-index:999;
font-size:2rem;
font-weight: normal;
color:#fff;
opacity:1;
}
.custom-file-uploader {
position: relative;
input[type='file'] {
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 5;
width: 100%;
height: 100%;
opacity: 0;
cursor: default;
}
}
\ No newline at end of file
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
\ No newline at end of file
const citymap = {
chicago: {
center: { lat: 6.9061, lng: 79.9696 },
population: 100,
}
};
function initMap() {
// Create the map.
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 15,
center: { lat: 6.9061, lng: 79.9696 },
mapTypeId: "terrain",
});
// Construct the circle for each value in citymap.
// Note: We scale the area of the circle based on the population.
for (const city in citymap) {
// Add the circle for this city to the map.
const cityCircle = new google.maps.Circle({
strokeColor: "#FF0000",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#FF0000",
fillOpacity: 0.35,
map,
center: citymap[city].center,
radius: Math.sqrt(citymap[city].population) * 100,
});
}
}
\ No newline at end of file
document.querySelectorAll(".drop-zone__input").forEach((inputElement) => {
const dropZoneElement = inputElement.closest(".drop-zone");
dropZoneElement.addEventListener("click", (e) => {
inputElement.click();
});
inputElement.addEventListener("change", (e) => {
if (inputElement.files.length) {
updateThumbnail(dropZoneElement, inputElement.files[0]);
}
});
dropZoneElement.addEventListener("dragover", (e) => {
e.preventDefault();
dropZoneElement.classList.add("drop-zone--over");
});
["dragleave", "dragend"].forEach((type) => {
dropZoneElement.addEventListener(type, (e) => {
dropZoneElement.classList.remove("drop-zone--over");
});
});
dropZoneElement.addEventListener("drop", (e) => {
e.preventDefault();
if (e.dataTransfer.files.length) {
inputElement.files = e.dataTransfer.files;
updateThumbnail(dropZoneElement, e.dataTransfer.files[0]);
}
dropZoneElement.classList.remove("drop-zone--over");
});
});
/**
* Updates the thumbnail on a drop zone element.
*
* @param {HTMLElement} dropZoneElement
* @param {File} file
*/
function updateThumbnail(dropZoneElement, file) {
let thumbnailElement = dropZoneElement.querySelector(".drop-zone__thumb");
// First time - remove the prompt
if (dropZoneElement.querySelector(".drop-zone__prompt")) {
dropZoneElement.querySelector(".drop-zone__prompt").remove();
}
// First time - there is no thumbnail element, so lets create it
if (!thumbnailElement) {
thumbnailElement = document.createElement("div");
thumbnailElement.classList.add("drop-zone__thumb");
dropZoneElement.appendChild(thumbnailElement);
}
thumbnailElement.dataset.label = file.name;
// Show thumbnail for image files
if (file.type.startsWith("image/")) {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => {
thumbnailElement.style.backgroundImage = `url('${reader.result}')`;
};
} else {
thumbnailElement.style.backgroundImage = null;
}
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<title>Index</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<style>
html {
height: 100%;
}
* {box-sizing: border-box;}
body {
margin: 0;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
background-image: url({{ url_for('static', filename='images/bg.jpg') }})
}
.header {
overflow: hidden;
background-color: #970103;
padding: 5px 10px;
}
.header a {
float: left;
color: White;
text-align: center;
padding: 12px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-radius: 4px;
}
.header a.logo {
font-size: 25px;
font-weight: bold;
}
.header a:hover {
background-color: #8a8a8a;
color: black;
}
.header a.active {
background-color: #0b0b0b;
color: white;
}
.header-right {
float: right;
}
@media screen and (max-width: 500px) {
.header a {
float: none;
display: block;
text-align: left;
}
.header-right {
float: none;
}
}
.global-container{
margin-top: 20px;
display: flex;
align-items: center;
justify-content: center;
float: left;
width: 100%;
}
form{
padding-top: 10px;
font-size: 14px;
margin-top: 30px;
margin-left: 50px;
margin-right: 50px;
}
.card-title{ font-weight:300; }
.card{opacity: 0.95;}
.effect7{
position:relative;
-webkit-box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}
.login-form{
width:1175px;
margin:20px;
}
.drop-zone {
max-width: 300px;
height: 300px;
padding: 25px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-family: "Quicksand", sans-serif;
font-weight: 500;
font-size: 20px;
cursor: pointer;
color: #cccccc;
border: 4px dashed #345BDE;
border-radius: 10px;
}
.drop-zone--over {
border-style: solid;
}
.drop-zone__input {
display: none;
}
.drop-zone__thumb {
width: 100%;
height: 100%;
border-radius: 10px;
overflow: hidden;
background-color: #cccccc;
background-size: cover;
position: relative;
}
.drop-zone__thumb::after {
content: attr(data-label);
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 5px 0;
color: #ffffff;
background: rgba(0, 0, 0, 0.75);
font-size: 14px;
text-align: center;
}
</style>
<body>
<div class="global-container">
<br>
<br>
<br>
<div class="card login-form effect7">
<div class="card-body">
<center>
<h3>Please Upload Lecture and Slides</h3>
</center>
<form action="upload_action" method="post" enctype="multipart/form-data">
<div class="form-group">
<h5>Please Select Lecture</h5>
<input type="file" name="lecture_video" class="form" accept="video/mp4,video/x-m4v,video/*"
required>
</div>
<div class="form-group">
<h5>Please Select Slides</h5>
<input type="file" name="lecture_ppt" class="form" accept=".ppt, .pptx" required>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">upload</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Short Note</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<style>
html {
height: 100%;
}
* {box-sizing: border-box;}
body {
margin: 0;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
background-image: url({{ url_for('static', filename='images/bg.jpg') }})
}
.header {
overflow: hidden;
background-color: #970103;
padding: 5px 10px;
}
.header a {
float: left;
color: White;
text-align: center;
padding: 12px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-radius: 4px;
}
.header a.logo {
font-size: 25px;
font-weight: bold;
}
.header a:hover {
background-color: #8a8a8a;
color: black;
}
.header a.active {
background-color: #0b0b0b;
color: white;
}
.header-right {
float: right;
}
@media screen and (max-width: 500px) {
.header a {
float: none;
display: block;
text-align: left;
}
.header-right {
float: none;
}
}
.global-container{
margin-top: 20px;
display: flex;
align-items: center;
justify-content: center;
float: left;
width: 100%;
}
form{
padding-top: 10px;
font-size: 14px;
margin-top: 50px;
margin-left: 50px;
margin-right: 50px;
}
.card-title{ font-weight:300; }
.card{
opacity: 0.95;
}
.card-body{
margin-top: 100px;
}
.effect7{
position:relative;
-webkit-box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}
.login-form{
width:1175px;
margin:20px;
}
</style>
<body>
<div class="global-container">
<br>
<br>
<br>
<div class="card login-form effect7">
<div class="card-body">
<center>
<h2>Short Note Ready</h2>
<a href="/short_note/{{filename}}" style="color:red;">Download as doc file</a>
</center>
</div>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Topics</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<style>
html {
height: 100%;
}
* {box-sizing: border-box;}
body {
margin: 0;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
background-image: url({{ url_for('static', filename='images/bg.jpg') }})
}
.header {
overflow: hidden;
background-color: #970103;
padding: 5px 10px;
}
.header a {
float: left;
color: White;
text-align: center;
padding: 12px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-radius: 4px;
}
.header a.logo {
font-size: 25px;
font-weight: bold;
}
.header a:hover {
background-color: #8a8a8a;
color: black;
}
.header a.active {
background-color: #0b0b0b;
color: white;
}
.header-right {
float: right;
}
@media screen and (max-width: 500px) {
.header a {
float: none;
display: block;
text-align: left;
}
.header-right {
float: none;
}
}
.global-container{
margin-top: 20px;
display: flex;
align-items: center;
justify-content: center;
float: left;
width: 100%;
}
form{
padding-top: 10px;
font-size: 14px;
margin-top: 50px;
margin-left: 50px;
margin-right: 50px;
}
.card-title{ font-weight:300; }
.card{
opacity: 0.95;
}
.card-body{
margin-top: 100px;
}
.effect7{
position:relative;
-webkit-box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}
.login-form{
width:1175px;
margin:20px;
}
</style>
<body>
<div class="global-container">
<br>
<br>
<br>
<div class="card login-form effect7">
<div class="card-body">
<center>
<h2>Topics Ready</h2>
</center>
<table class="table" id="table">
<thead>
<tr>
<th>Index</th>
<th>Key Points ( Topics )</th>
</tr>
</thead>
<tbody>
{% for row in topic_list %}
<tr>
<td>{{row[0]}}</td>
<td>{{row[2]}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Upload</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<style>
html {
height: 100%;
}
* {box-sizing: border-box;}
body {
margin: 0;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
background-image: url({{ url_for('static', filename='images/bg.jpg') }})
}
.header {
overflow: hidden;
background-color: #970103;
padding: 5px 10px;
}
.header a {
float: left;
color: White;
text-align: center;
padding: 12px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-radius: 4px;
}
.header a.logo {
font-size: 25px;
font-weight: bold;
}
.header a:hover {
background-color: #8a8a8a;
color: black;
}
.header a.active {
background-color: #0b0b0b;
color: white;
}
.header-right {
float: right;
}
@media screen and (max-width: 500px) {
.header a {
float: none;
display: block;
text-align: left;
}
.header-right {
float: none;
}
}
.global-container{
margin-top: 20px;
display: flex;
align-items: center;
justify-content: center;
float: left;
width: 100%;
}
form{
padding-top: 10px;
font-size: 14px;
margin-top: 50px;
margin-left: 50px;
margin-right: 50px;
}
.card-title{ font-weight:300; }
.card{
opacity: 0.95;
}
.card-body{
margin-top: 100px;
}
.effect7{
position:relative;
-webkit-box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
box-shadow:0 1px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}
.login-form{
width:1175px;
margin:20px;
}
</style>
<body>
<div class="global-container">
<br>
<br>
<br>
<div class="card login-form effect7">
<div class="card-body">
<center>
<h2>File uploaded successfully</h2>
<h4 style="color:red;">Note generation and topic analysing will take some time</h4>
</center>
<form>
<h4>Lecture Video File : {{video_file_name}}</h4>
<h4>Lecture Slide File (pptx) : {{pptx_file_name}}</h4>
<div class="form-group">
<a href="/generate_short_note" class="btn btn-primary btn-block">Generate Short Note</a>
</div>
<div class="form-group">
<a href="/generate_topics" class="btn btn-primary btn-block">Analyse Topics</a>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
import moviepy.editor as mp
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
from moviepy.editor import VideoFileClip
import os
from topics_find import text_gen
def convert_video_to_audio(filename):
clip = mp.VideoFileClip(r"" + filename)
audio_file_name = str(filename).split('/')[-1].replace('.mp4', '.wav')
clip.audio.write_audiofile(r"topics_find/audio_input/" + audio_file_name)
return text_gen.convert_audio_to_text("topics_find/audio_input/" + audio_file_name)
def split_video_file(filename):
return_list = []
all_text = ''
required_video_file = filename
files = os.listdir('topics_find/video_input')
for filename in files:
os.remove('topics_find/video_input/' + filename)
total_length = VideoFileClip(required_video_file).duration
print(total_length)
no_of_slices = int(total_length / 50) + 1
time_grid = []
for i in range(0, no_of_slices):
time_grid.append(i * 50)
for i in range(no_of_slices):
if i == len(time_grid) - 1:
# ffmpeg_extract_subclip(required_video_file, time_grid[i], total_length - time_grid[i],
# targetname='videos/' + str(i) + ".mp4")
pass
else:
ffmpeg_extract_subclip(required_video_file, time_grid[i], time_grid[i + 1],
targetname='topics_find/video_input' + str(i) + ".mp4")
text = convert_video_to_audio('topics_find/video_input' + str(i) + ".mp4")
all_text += text + ' '
return_list.append([i, text])
return return_list, all_text
import nltk
import topics_find.question_generator as q_gen
# nltk.download('words')
# from bertopic import BERTopic
from nltk.corpus import words
# model = BERTopic(verbose=True)
def get_topics(file):
topics_outputs = []
docs = []
with open(file) as file:
for line in file:
docs.append(line.rstrip())
topics, probabilities = model.fit_transform(docs)
#
print(model.get_topic_freq())
#
print('done')
#
# model.get_topic_freq().head(11)
print(model.get_topics())
for i in model.get_topic(0):
if i[0] in words.words():
pass
else:
print(i[0])
topics_outputs.append(i[0])
return topics_outputs
def get_topics_new(text):
topics = q_gen.get_keywords(text, q_gen.summarizer(text))
print(topics)
return topics
from textwrap3 import wrap
import torch
from transformers import T5ForConditionalGeneration, T5Tokenizer
import random
import numpy as np
import nltk
# nltk.download('punkt')
# nltk.download('brown')
# nltk.download('wordnet')
# nltk.download('stopwords')
from nltk.corpus import wordnet as wn
from nltk.tokenize import sent_tokenize
from nltk.corpus import stopwords
import string
import pke
import traceback
from flashtext import KeywordProcessor
summary_model = T5ForConditionalGeneration.from_pretrained('t5-base')
summary_tokenizer = T5Tokenizer.from_pretrained('t5-base')
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
summary_model = summary_model.to(device)
def set_seed(seed: int):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
def postprocesstext(content):
final = ""
for sent in sent_tokenize(content):
sent = sent.capitalize()
final = final + " " + sent
return final
def summarizer(text, model=summary_model, tokenizer=summary_tokenizer):
text = text.strip().replace("\n", " ")
text = "summarize: " + text
# print (text)
max_len = 512
encoding = tokenizer.encode_plus(text, max_length=max_len, pad_to_max_length=False, truncation=True,
return_tensors="pt").to(device)
input_ids, attention_mask = encoding["input_ids"], encoding["attention_mask"]
outs = model.generate(input_ids=input_ids,
attention_mask=attention_mask,
early_stopping=True,
num_beams=3,
num_return_sequences=1,
no_repeat_ngram_size=2,
min_length=75,
max_length=300)
dec = [tokenizer.decode(ids, skip_special_tokens=True) for ids in outs]
summary = dec[0]
summary = postprocesstext(summary)
summary = summary.strip()
return summary
def get_nouns_multipartite(content):
out = []
try:
extractor = pke.unsupervised.MultipartiteRank()
extractor.load_document(input=content)
# not contain punctuation marks or stopwords as candidates.
pos = {'PROPN', 'NOUN'}
# pos = {'PROPN','NOUN'}
stoplist = list(string.punctuation)
stoplist += ['-lrb-', '-rrb-', '-lcb-', '-rcb-', '-lsb-', '-rsb-']
stoplist += stopwords.words('english')
extractor.candidate_selection(pos=pos, stoplist=stoplist)
# 4. build the Multipartite graph and rank candidates using random walk,
# alpha controls the weight adjustment mechanism, see TopicRank for
# threshold/method parameters.
extractor.candidate_weighting(alpha=1.1,
threshold=0.75,
method='average')
keyphrases = extractor.get_n_best(n=15)
for val in keyphrases:
out.append(val[0])
except:
out = []
traceback.print_exc()
return out
def get_keywords(originaltext, summarytext):
keywords = get_nouns_multipartite(originaltext)
print("keywords unsummarized: ", keywords)
keyword_processor = KeywordProcessor()
for keyword in keywords:
keyword_processor.add_keyword(keyword)
keywords_found = keyword_processor.extract_keywords(summarytext)
keywords_found = list(set(keywords_found))
print("keywords_found in summarized: ", keywords_found)
important_keywords = []
for keyword in keywords:
if keyword in keywords_found:
important_keywords.append(keyword)
return important_keywords[:4]
question_model = T5ForConditionalGeneration.from_pretrained('ramsrigouthamg/t5_squad_v1')
question_tokenizer = T5Tokenizer.from_pretrained('ramsrigouthamg/t5_squad_v1')
question_model = question_model.to(device)
def get_question(context, answer, model, tokenizer):
text = "context: {} answer: {}".format(context, answer)
encoding = tokenizer.encode_plus(text, max_length=384, pad_to_max_length=False, truncation=True,
return_tensors="pt").to(device)
input_ids, attention_mask = encoding["input_ids"], encoding["attention_mask"]
outs = model.generate(input_ids=input_ids,
attention_mask=attention_mask,
early_stopping=True,
num_beams=5,
num_return_sequences=1,
no_repeat_ngram_size=2,
max_length=72)
dec = [tokenizer.decode(ids, skip_special_tokens=True) for ids in outs]
Question = dec[0].replace("question:", "")
Question = Question.strip()
return Question
def generate_questions_and_answers(text):
set_seed(42)
summarized_text = summarizer(text, summary_model, summary_tokenizer)
imp_keywords = get_keywords(text, summarized_text)
question_and_answer_list = []
for answer in imp_keywords:
ques = get_question(summarized_text, answer, question_model, question_tokenizer)
question_and_answer_list.append([ques, answer.capitalize()])
return question_and_answer_list
# xxx = """Elon Musk has shown again he can influence the digital currency market with just his tweets. After saying that his electric vehicle-making company
# Tesla will not accept payments in Bitcoin because of environmental concerns, he tweeted that he was working with developers of Dogecoin to improve
# system transaction efficiency. Following the two distinct statements from him, the world's largest cryptocurrency hit a two-month low, while Dogecoin
# rallied by about 20 percent. The SpaceX CEO has in recent months often tweeted in support of Dogecoin, but rarely for Bitcoin. In a recent tweet,
# Musk put out a statement from Tesla that it was “concerned” about the rapidly increasing use of fossil fuels for Bitcoin (price in India) mining and
# transaction, and hence was suspending vehicle purchases using the cryptocurrency. A day later he again tweeted saying, “To be clear, I strongly
# believe in crypto, but it can't drive a massive increase in fossil fuel use, especially coal”. It triggered a downward spiral for Bitcoin value but
# the cryptocurrency has stabilised since. A number of Twitter users welcomed Musk's statement. One of them said it's time people started realising
# that Dogecoin “is here to stay” and another referred to Musk's previous assertion that crypto could become the world's future currency."""
# print(generate_questions_and_answers(xxx))
#
# x = generate_questions_and_answers(xxx)
#
# for i in x:
# print(i[0])
# print(i[1])
import glob
from pptx import Presentation
import math
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize, sent_tokenize
import textract
import os.path
def create_sumall(abc, ratio):
if abc:
filename = abc
stop_word = ['is', 'a', 'and', 'the']
# Function to create Text summarization
def create_summ(text):
stopWords = set(stopwords.words("english"))
words = word_tokenize(text)
freqTable = dict()
for word in words:
word = word.lower()
if word in stopWords:
continue
if word in freqTable:
freqTable[word] += 1
else:
freqTable[word] = 1
sentences = sent_tokenize(text)
sentenceValue = dict()
for sentence in sentences:
for word, freq in freqTable.items():
if word in sentence.lower():
if sentence in sentenceValue:
sentenceValue[sentence] += freq
else:
sentenceValue[sentence] = freq
sumValues = 0
for sentence in sentenceValue:
sumValues += sentenceValue[sentence]
lensenvalu = len(sentenceValue)
if lensenvalu == 0:
lensenvalu = 1
average = int(sumValues / lensenvalu)
else:
average = int(sumValues / lensenvalu)
summary = ''
for sentence in sentences:
if (sentence in sentenceValue) and (sentenceValue[sentence] > (
ratio * average)):
summary += " " + sentence
return summary
def read_full_pptxe(filename):
sentences = []
b = []
a = 0
for eachfile in glob.glob(filename):
prs = Presentation(eachfile)
for slide in prs.slides:
a = a + 1
for shape in slide.shapes:
if hasattr(shape, "text"):
s = create_summ(shape.text.replace("\n", " "))
s = str(s)
if (len(s)) >= 1:
f = ["Slide " + str(a) + "-" + s]
sentences.append(f)
return sentences
def read_full_docx(filename):
sentences = []
text = textract.process(filename)
temp = text.split(".")
for t in temp:
sentences.append(t.replace("\n", " "))
return sentences
extension = os.path.splitext(filename)[1]
if extension == 'docx':
read_full_docx(filename)
else:
read_full_pptxe(filename)
def Convert(string):
li = list(string.split(" "))
return li
def Convert2(string):
li = list(string.split("\n"))
return li
def read_slide3(filename):
a = 1
for eachfile in glob.glob(filename):
prs = Presentation(eachfile)
for slide in prs.slides:
a = a + 1
for shape in slide.shapes:
if hasattr(shape, "text"):
if a == 4 and shape.shape_id == 3:
s3 = str(shape.text)
return s3
def read_full_pptx(filename, sss):
numberslide = []
numberslide.append(sss)
a = 0
for eachfile in glob.glob(filename):
prs = Presentation(eachfile)
for slide in prs.slides:
a = a + 1
for shape in slide.shapes:
if hasattr(shape, "text"):
if shape.shape_id != 2:
s = shape.text.replace("\n", " ")
s = str(s)
if (len(s)) >= 20 and a != 3 and a != 1 and a != 2:
lo_1 = [a for a in new_l1 if a in s.lower()]
f_lo_l = round((len(lo_1) / len_of_l1) * 100)
if f_lo_l >= 50:
f = "Slide " + str(a)
numberslide.append(f)
return numberslide
loooo = Convert2(read_slide3(filename))
abc = []
for i in loooo:
l1 = Convert(i.lower())
new_l1 = [w for w in l1 if w not in stop_word]
len_of_l1 = len(new_l1)
read_full_pptx(filename, i)
abc.append(read_full_pptx(filename, i))
return (read_full_pptxe(filename), abc)
else:
print('error')
from flask import Flask, request, url_for, redirect, render_template
from flask_cors import CORS
import werkzeug
import topics_find.summary as summarizeed
import json
import textract
from pptx import Presentation
import os
app = Flask(__name__)
CORS(app)
@app.route('/summerize', methods=['GET', 'POST'])
def summerize():
file = request.files['file']
ratio = float(request.form['ratio'])
filename = werkzeug.utils.secure_filename(file.filename)
print("\nReceived image File name : " + file.filename)
file.save('upload/' + filename)
f, file_extension = os.path.splitext('upload/' + filename)
print(file_extension)
if file_extension == '.docx':
text = textract.process('upload/' + filename)
arr = str(text).replace("\\n", "")
arr = arr.replace("\\t", "")
arr = arr.replace("\\", "")
prs = Presentation()
lyt = prs.slide_layouts[0] # choosing a slide layout
for x in range(0, 3):
if x == 2:
slide = prs.slides.add_slide(lyt) # adding a slide
title = slide.shapes.title # assigning a title
subtitle = slide.placeholders[1] # placeholder for subtitle
subtitle.text = arr
else:
slide = prs.slides.add_slide(lyt) # adding a slide
title = slide.shapes.title # assigning a title
subtitle = slide.placeholders[1] # placeholder for subtitle
title.text = "ignore" # title
subtitle.text = "ignore" # subtitle
prs.save("upload/slide3.pptx") # saving file
print('file saved')
res = summarizeed.create_sumall('upload/slide3.pptx', ratio)
else:
res = summarizeed.create_sumall('upload/' + filename, ratio)
rr = []
for r in res[0]:
rr.append(r[0].replace('"', ''))
return_str = '{ "result" : ['
for i in range(len(rr)):
if i == len(rr) - 1:
return_str += '"' + rr[i] + '"'
else:
return_str += '"' + rr[i] + '"' + ','
return_str += ']}'
print(return_str)
return json.loads(return_str)
if __name__ == '__main__':
app.run(host="0.0.0.0", port=5005, debug=True)
import speech_recognition as sr
import subprocess
import os
import sys
PYTHONIOENCODING = "UTF-8"
FOLDER_AUDIO = "audio_input"
FOLDER_TEXT = "text_output"
LANGUAGE = "en-US"
# print("starting...")
#
# if not os.path.isdir(FOLDER_AUDIO):
# os.mkdir(FOLDER_AUDIO)
#
# if not os.path.isdir(FOLDER_TEXT):
# os.mkdir(FOLDER_TEXT)
#
# paths = [os.path.join(FOLDER_AUDIO, nome) for nome in os.listdir(FOLDER_AUDIO)]
# files = [arq for arq in paths if os.path.isfile(arq)]
# wav_files = [arq for arq in files if arq.lower().endswith(".wav")]
#
# for filename in wav_files:
# r = sr.Recognizer()
# with sr.AudioFile(filename) as source:
# audio = r.record(source)
#
# command = r.recognize_google(audio, language='en-IN', show_all=True)
# print(command)
#
# print("running file {}".format(filename))
#
# filefinal = filename.split("audio_input/")[1].split(".wav")[0]
# filefinal = '{}/{}.txt'.format(FOLDER_TEXT, filefinal)
# with open(filefinal, 'w') as arq:
# arq.write(str(command))
#
# print("create a new file {}".format(filefinal))
#
# print("finish")
def convert_audio_to_text(filename):
r = sr.Recognizer()
with sr.AudioFile(filename) as source:
audio = r.record(source)
try:
command = r.recognize_google(audio, language='en-IN', show_all=True)
print(command["alternative"][0]["transcript"])
return command["alternative"][0]["transcript"]
except:
return 'did not convert'
# convert_audio_to_text('audio_input/3.wav')
{'alternative': [{'transcript': 'type of diffusion is an IR module that making waves right now open source machine many more than the Legend images from text free ridiculously well with the engine is the ability to fusion took 256 180 hours and hours to train at market price that 612 and pigments', 'confidence': 0.88088202}, {'transcript': 'type of diffusion is an IR module that making waves right now open source machine many more than the Legend images from text free ridiculously well with the engine is the ability to fusion took 256 150 hours and hours to train at market price that 612 and pigments'}, {'transcript': 'type of diffusion is an IR module that making waves right now open source machine many more than the Legend images from text free ridiculously well with the engine is the ability to fusion took 256 180 days and hours to train at market price that 612 and pigments'}, {'transcript': 'type of diffusion is an IR module that making waves right now kitchen open source machine many more than the Legend images from text free ridiculously well with the engine is the ability to fusion took 256 150 hours and hours to train at market price that 612 and pigments'}, {'transcript': 'type of diffusion is an IR module that making waves right now open source machine many more than the Legend images from text free ridiculously well with the engine is the ability to fusion Tuk 256 150 hours and hours to train at market price that 612 and pigments'}], 'final': True}
\ No newline at end of file
{'alternative': [{'transcript': 'two baby chicks headphone very own eggs when they would ask returned home from gathering food for 24 x 7 Pro Kabaddi final anywhere natural on what you discover the Lion treks around her to for it tracks therefore be determined the final babies', 'confidence': 0.87500781}, {'transcript': 'two baby chicks headphone very own eggs when they would ask that returned home from gathering food for 24 x 7 Pro Kabaddi final anywhere natural on what you discover the Lion treks around her to for it tracks therefore be determined to find her babies'}, {'transcript': 'water to baby chicks headphone very own eggs when they would ask that returned home from gathering food for 24 x 7 Pro Kabaddi final anywhere natural on what you discover the Lion treks around her to for it tracks therefore be determined the final babies'}, {'transcript': 'two baby chicks headphone very own eggs when they would ask returned home from gathering food for 24 x 7 Pro Kabaddi final anywhere natural on what you discover the Lion treks around her to for it tracks therefore be determined to find her babies'}, {'transcript': 'water to baby chicks headphone very own eggs when they would ask returned home from gathering food for 24 x 7 Pro Kabaddi final anywhere natural on what you discover the Lion treks around her to for it tracks therefore be determined the final babies'}], 'final': True}
\ No newline at end of file
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
content="Web site created using create-react-app" content="Web site created using create-react-app"
/> />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
crossorigin="anonymous">
<!-- <!--
manifest.json provides metadata used when your web app is installed on a manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
...@@ -29,6 +33,7 @@ ...@@ -29,6 +33,7 @@
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div> <div id="root"></div>
<!-- <!--
This HTML file is a template. This HTML file is a template.
If you open it directly in the browser, you will see an empty page. If you open it directly in the browser, you will see an empty page.
...@@ -39,5 +44,9 @@ ...@@ -39,5 +44,9 @@
To begin the development, run `npm start` or `yarn start`. To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`. To create a production bundle, use `npm run build` or `yarn build`.
--> -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4"
crossorigin="anonymous">
</script>
</body> </body>
</html> </html>
import React, { Component } from 'react';
import './style/classNotes.css';
class ClassNotes extends Component {
render() {
return (
<div className="background-material">
<div className="container mt-4 shadow p-3 mb-5 bg-body rounded">
<div>
<p3>UPLOAD THE VIDEO</p3>
<div className="container mt-4 p-3 mb-5 bg-body rounded">
<form
className="row g-3">
<div className="form-group files">
<input
type="file"
className="form-control"
id="lessonURL"
name="lessonURL"
multiple=""
required
/>
</div>
<div className="row g-3">
<button className="button2-submit button-submit">UPLOAD</button>
</div>
</form>
</div>
</div>
</div>
</div>
);
}
}
export default ClassNotes;
\ No newline at end of file
p3 {
font-size: xx-large;
padding-left: 10px;
color: #793179;
font-family: bold;
}
.background-material .h2 {
font-family: bold;
font-weight: normal;
text-align: left;
padding-top: 5px;
}
.background-material .h5{
font-family: bold;
font-weight: bold;
padding-top: 10px;
}
.background-material .h6{
font-family: bold;
font-weight: bold;
padding-top: 10px;
}
.label{
color: #793179;
}
.form{
padding-top: 10px;
}
.background-material .label{
color: black;
}
.background-material .form{
padding-top: 0px;
padding-left: 50px;
padding-right: 50px;
}
.background-material .card-body{
color: #3F71AE;
}
.background-material li {
font-weight: bold;
font-family: inter;
}
.background-material .button {
background-color: #7a067a;
}
.background-material img{
position: absolute;
right: 100px;
width: 180px;
}
.background-material card{
color: #8f9296;
}
.background-view--material .top{
position: absolute;
right: 0px;
width: 190px;
}
.background h1{
color: #793179;
font-weight: bold;
}
.background h5{
color: #803480;
font-weight: bold;
}
.background i{
color: #7a067a;
}
.background label{
color: #6b556b;
}
.files input {
outline: 2px dashed #92b0b3;
outline-offset: -10px;
-webkit-transition: outline-offset .15s ease-in-out, background-color .15s linear;
transition: outline-offset .15s ease-in-out, background-color .15s linear;
padding: 120px 0px 85px 35%;
text-align: center !important;
margin: 0;
width: 100% !important;
}
.files input:focus{ outline: 2px dashed #92b0b3; outline-offset: -10px;
-webkit-transition: outline-offset .15s ease-in-out, background-color .15s linear;
transition: outline-offset .15s ease-in-out, background-color .15s linear; border:1px solid #92b0b3;
}
.files{ position:relative}
.files:after { pointer-events: none;
position: absolute;
top: 60px;
left: 0;
width: 50px;
right: 0;
height: 56px;
content: "";
background-image: url(https://image.flaticon.com/icons/png/128/109/109612.png);
display: block;
margin: 0 auto;
background-size: 100%;
background-repeat: no-repeat;
}
.color input{ background-color:#f1f1f1;}
.files:before {
position: absolute;
bottom: 10px;
left: 0; pointer-events: none;
width: 100%;
right: 0;
height: 57px;
content: " or drag it here. ";
display: block;
margin: 0 auto;
color: #2ea591;
font-weight: 600;
text-transform: capitalize;
text-align: center;
}
.button-submit{
border: none;
padding: 6px 30px;
text-align: center;
display: inline-block;
font-size: 16px;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
cursor: pointer;
font-size: 17px;
}
.button2-submit {
background-color: rgba(0, 40, 83, 1);
color: white;
font-weight: bold;
border: 2px solid rgba(0, 40, 83, 1);
}
.button2-submit:hover {
background-color: rgb(2, 54, 110);
color: #ffffff;
border: 2px solid rgb(1, 58, 119);
transform: scale(1.01);
}
...@@ -29,6 +29,7 @@ const Navbar = () => { ...@@ -29,6 +29,7 @@ const Navbar = () => {
<p><Link style={isActive(history, '/')} to="/">Home</Link></p> <p><Link style={isActive(history, '/')} to="/">Home</Link></p>
<p><Link style={isActive(history, '#')} to="#">Video summarizer</Link></p> <p><Link style={isActive(history, '#')} to="#">Video summarizer</Link></p>
<p><Link style={isActive(history, '#')} to="#">Digital human</Link></p> <p><Link style={isActive(history, '#')} to="#">Digital human</Link></p>
<p><Link style={isActive(history, '/class-notes')} to="/class-notes">Class notes</Link></p>
<p><Link style={isActive(history, '/about-us')} to="/about-us">About us</Link></p> <p><Link style={isActive(history, '/about-us')} to="/about-us">About us</Link></p>
<p><Link style={isActive(history, '/contact-us')} to="/contact-us">Contact us</Link></p> <p><Link style={isActive(history, '/contact-us')} to="/contact-us">Contact us</Link></p>
</div> </div>
...@@ -49,6 +50,7 @@ const Navbar = () => { ...@@ -49,6 +50,7 @@ const Navbar = () => {
<p><Link style={isActive(history, '/')} to="/">Home</Link></p> <p><Link style={isActive(history, '/')} to="/">Home</Link></p>
<p><Link style={isActive(history, '#')} to="#">Video summarizer</Link></p> <p><Link style={isActive(history, '#')} to="#">Video summarizer</Link></p>
<p><Link style={isActive(history, '#')} to="#">Digital human</Link></p> <p><Link style={isActive(history, '#')} to="#">Digital human</Link></p>
<p><Link style={isActive(history, '/class-notes')} to="/class-notes">Class notes</Link></p>
<p><Link style={isActive(history, '/about-us')} to="/about-us">About us</Link></p> <p><Link style={isActive(history, '/about-us')} to="/about-us">About us</Link></p>
<p><Link style={isActive(history, '/contact-us')} to="/contact-us">Contact us</Link></p> <p><Link style={isActive(history, '/contact-us')} to="/contact-us">Contact us</Link></p>
</div> </div>
......
...@@ -8,6 +8,7 @@ import AboutUs from '../main/AboutUs/aboutUs'; ...@@ -8,6 +8,7 @@ import AboutUs from '../main/AboutUs/aboutUs';
import SignUp from '../main/SignUp/signUp'; import SignUp from '../main/SignUp/signUp';
import Login from '../main/Login/login'; import Login from '../main/Login/login';
import ContactUs from '../main/ContactUs/contactUs'; import ContactUs from '../main/ContactUs/contactUs';
import ClassNotes from '../classNotes/classNotes';
function PageRoutes() { function PageRoutes() {
return ( return (
...@@ -21,6 +22,7 @@ function PageRoutes() { ...@@ -21,6 +22,7 @@ function PageRoutes() {
<Route path="/contact-us" component={ContactUs}/> <Route path="/contact-us" component={ContactUs}/>
<Route path="/register" component={SignUp}/> <Route path="/register" component={SignUp}/>
<Route path="/login" component={Login}/> <Route path="/login" component={Login}/>
<Route path="/class-notes" component={ClassNotes}/>
</Switch> </Switch>
</section> </section>
</Router> </Router>
......
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