-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Petar Veličković
committed
Jan 20, 2018
1 parent
2d3fc00
commit e1fcd68
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|