Skip to content

Commit

Permalink
clean respository commit for anonymized submission
Browse files Browse the repository at this point in the history
  • Loading branch information
prasoonpatidar committed Feb 8, 2024
1 parent 5e09c02 commit 09c9e68
Show file tree
Hide file tree
Showing 74 changed files with 8,392 additions and 58 deletions.
69 changes: 12 additions & 57 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__pycache__/
*.py[cod]
*$py.class

*.DS_Store
# C extensions
*.so

Expand All @@ -20,7 +20,6 @@ parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
Expand All @@ -39,17 +38,14 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -59,7 +55,6 @@ cover/
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -72,49 +67,16 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
.python-version

# celery beat schedule file
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
Expand All @@ -140,21 +102,14 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
compose/input

# pytype static type analyzer
.pytype/
# idea folder
.idea/

# Cython debug symbols
cython_debug/
# tmp folder
tmp/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# cache folder
cache/
**.csv
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# edulyze
# Edulyze
A analytics system that combines data from various classroom sensing systems to generate analytical insights for relevant pedagogical questions and presents a unified schema to structure processed classroom data.

Coming soon...
Empty file added analytics/__init__.py
Empty file.
Empty file added analytics/audio/__init__.py
Empty file.
105 changes: 105 additions & 0 deletions analytics/audio/audio_analysis_wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
"""
Author: Anonymized
Created: Anonymized
This file contains wrapper function to run end to end analysis on audio data
"""

# Import python library functions
import logging
from datetime import datetime

# Import project level functions and classes
from configs.constants import exitStatus
from utils.time_utils import time_diff
from analytics.audio.silence_detection import run_silence_detection_module
from analytics.audio.object_noise_detection import run_object_noise_detection_module
from analytics.audio.teacher_speech_detection import run_teacher_speaking_module
from analytics.audio.single_speaker_detection import run_single_speaker_module


def audio_analysis_wrapper(session_input_object, session_output_object, logger_pass):
"""
This is main wrapper function to run all audio modules
Parameters:
session_input_object(dict) : Dictionary containing all required inputs for session analytics
session_output_object(dict) : Dictionary to collect all outputs for session analytics
logger_pass(logger) : The parent logger from which to derive the logger for this function
Returns:
session_output_object(dict) : Dictionary to collect all outputs for session analytics
"""
# Initialize the logger

logger_pass = dict(logger_pass)
logger_base = logger_pass.get('logger_base').getChild('audio_analysis')
logger = logging.LoggerAdapter(logger_base, logger_pass.get('logging_dict'))
logger_pass['logger_base'] = logger_base

t_audio_analysis_start = datetime.now()

# Initialize audio module

session_output_object['audio'] = {
'second': dict(),
'block': dict(),
'session': dict(),
'debug': dict()
}

# Run silence detection modules at second, block and session level

silence_detection_info, run_status = run_silence_detection_module(session_input_object, session_output_object,
logger_pass)

if not (run_status == exitStatus.SUCCESS):
logger.warning("Silence module did not execute successfully")
else:
session_output_object['audio']['second'].update(silence_detection_info['second'])
session_output_object['audio']['block'].update(silence_detection_info['block'])
session_output_object['audio']['session'].update(silence_detection_info['session'])
session_output_object['audio']['debug'].update(silence_detection_info['debug'])

# Run object noise detection module at second, block and session level

object_noise_detection_info, run_status = run_object_noise_detection_module(session_input_object,
session_output_object, logger_pass)

if not (run_status == exitStatus.SUCCESS):
logger.warning("Object noise detection module did not execute successfully")
else:
session_output_object['audio']['second'].update(object_noise_detection_info['second'])
session_output_object['audio']['block'].update(object_noise_detection_info['block'])
session_output_object['audio']['session'].update(object_noise_detection_info['session'])

# Run teacher speech detection module at second, block and session level

teacher_speech_detection_info, run_status = run_teacher_speaking_module(session_input_object, session_output_object,
logger_pass)

if not (run_status == exitStatus.SUCCESS):
logger.warning("Teacher speech detection module did not execute successfully")
else:
session_output_object['audio']['second'].update(teacher_speech_detection_info['second'])
session_output_object['audio']['block'].update(teacher_speech_detection_info['block'])
session_output_object['audio']['session'].update(teacher_speech_detection_info['session'])

# Run single speaker detection module at second, block and session level

single_speaker_detection_info, run_status = run_single_speaker_module(session_input_object, session_output_object,
logger_pass)

if not (run_status == exitStatus.SUCCESS):
logger.warning("Single Speaker detection module did not execute successfully")
else:
session_output_object['audio']['second'].update(single_speaker_detection_info['second'])
session_output_object['audio']['block'].update(single_speaker_detection_info['block'])
session_output_object['audio']['session'].update(single_speaker_detection_info['session'])

t_audio_analysis_end = datetime.now()

logger.info("Audio Analysis took | %.3f secs.",
time_diff(t_audio_analysis_start, t_audio_analysis_end))

return session_output_object
Loading

0 comments on commit 09c9e68

Please sign in to comment.