Skip to content

Commit

Permalink
Committing the Bridge class
Browse files Browse the repository at this point in the history
  • Loading branch information
Petar Veličković committed Jan 20, 2018
1 parent 2d3fc00 commit e1fcd68
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Empty file added __init__.py
Empty file.
18 changes: 18 additions & 0 deletions backend/bridge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import numpy as np
# Linking functions to be accessed by the frontend

default_db = 'backend/db/'

class Bridge:
def __init__(self, path_to_db=default_db):
self.objs = np.load(path_to_db + 'objs_db.npy')
self.plcs = np.load(path_to_db + 'plcs_db.npy')

# obj_dist: distribution of objects (shape: (1000,))
# plc_dist: distribution of places (shape: (401,))
# use_obj: whether to use objects
# use_plc: whether to use places
# Returns: a vector of shape (10,) containing volume levels
def get_sound(obj_dist, plc_dist, use_obj=True, use_plc=True):
return np.ones(10)

0 comments on commit e1fcd68

Please sign in to comment.