Commit c217af8f authored by LiniEisha's avatar LiniEisha

Integrate

parent 3820451b
...@@ -23,7 +23,7 @@ maskNet = load_model(os.path.join(settings.BASE_DIR,'face_detector/mask_detector ...@@ -23,7 +23,7 @@ maskNet = load_model(os.path.join(settings.BASE_DIR,'face_detector/mask_detector
class IPWebCam(object): class IPWebCam(object):
def __init__(self): def __init__(self):
self.url = "http://192.168.8.103:8080/shot.jpg" self.url = "http://192.168.8.100:8080/shot.jpg"
def __del__(self): def __del__(self):
cv2.destroyAllWindows() cv2.destroyAllWindows()
......
...@@ -55,6 +55,13 @@ function testAPI() { ...@@ -55,6 +55,13 @@ function testAPI() {
.then((out) => {}) .then((out) => {})
.catch((err) => alert('error: ' + err)); .catch((err) => alert('error: ' + err));
//audio
var audio_name = 'Lecture';
fetch('http://127.0.0.1:8000/summary/lecture-audio/?audio_name=' + audio_name)
then((res) => res.json())
.then((out) => {})
.catch((err) => alert('error: ' + err));
} }
var time = 'time'; var time = 'time';
function f() { function f() {
......
...@@ -12,7 +12,7 @@ def IPWebcamTest(): ...@@ -12,7 +12,7 @@ def IPWebcamTest():
# Replace the URL with your own IPwebcam shot.jpg IP:port # Replace the URL with your own IPwebcam shot.jpg IP:port
# url = 'http://192.168.2.35:8080/shot.jpg' # url = 'http://192.168.2.35:8080/shot.jpg'
url = 'http://192.168.8.103:8080/shot.jpg' url = 'http://192.168.8.100:8080/shot.jpg'
# url = 'http://192.168.1.11:8080/startvideo?force=1&tag=rec' # url = 'http://192.168.1.11:8080/startvideo?force=1&tag=rec'
# url = 'http://192.168.1.11:8080/stopvideo?force=1' # url = 'http://192.168.1.11:8080/stopvideo?force=1'
......
...@@ -12,7 +12,7 @@ def AudioRecorder(audio): ...@@ -12,7 +12,7 @@ def AudioRecorder(audio):
DESTINATION_DIR = os.path.join(BASE_DIR, "audioArray\\{}".format(audio)) DESTINATION_DIR = os.path.join(BASE_DIR, "audioArray\\{}".format(audio))
#for the audio #for the audio
LECTURE_AUDIO_DIR = os.path.join(BASE_DIR, "lectures\\{}".format(audio)) LECTURE_AUDIO_DIR = os.path.join(BASE_DIR, "lectures\\Lecture_{}".format(audio))
# Sampling frequency # Sampling frequency
...@@ -30,8 +30,8 @@ def AudioRecorder(audio): ...@@ -30,8 +30,8 @@ def AudioRecorder(audio):
# This will convert the NumPy array to an audio # This will convert the NumPy array to an audio
# file with the given sampling frequency # file with the given sampling frequency
write("recording0.wav", freq, recording) write(DESTINATION_DIR, freq, recording)
#Convert the NumPy array to audio file #Convert the NumPy array to audio file
wv.write("recording1.wav", recording, freq, sampwidth=2) wv.write(LECTURE_AUDIO_DIR, recording, freq, sampwidth=2)
\ No newline at end of file \ No newline at end of file
...@@ -27,6 +27,7 @@ class LectureAudioAPI(APIView): ...@@ -27,6 +27,7 @@ class LectureAudioAPI(APIView):
return Response(lecture_audio_serializer.data) return Response(lecture_audio_serializer.data)
class audioNoiseRemovedList(APIView): class audioNoiseRemovedList(APIView):
def get(self, request): def get(self, request):
......
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