Skip to content

Commit

Permalink
support pip install
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmittag committed Nov 20, 2023
1 parent 3d5902f commit 4d91608
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from setuptools import setup, find_namespace_packages

setup(
name='vcm',
version='0.1',
packages=find_namespace_packages(),
include_package_data=True,
package_data={
'vcm': ['video_call_mos_weights.pt'],
},
)
Empty file added vcm/__init__.py
Empty file.
8 changes: 7 additions & 1 deletion vcm/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ def _get_frame_freeze_feature(x_ref_frames):
return x, df_features

class VideoCallMosModel():
def __init__(self, checkpoint="vcm/video_call_mos_weights.pt"):
def __init__(self, checkpoint=None):
if checkpoint is None:
try:
import pkg_resources
checkpoint = pkg_resources.resource_filename('vcm', 'video_call_mos_weights.pt')
except pkg_resources.DistributionNotFound:
checkpoint = 'vcm/video_call_mos_weights.pt'
self.dev = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
print(f"Running on {self.dev}")
self.model = VcmNet()
Expand Down

0 comments on commit 4d91608

Please sign in to comment.