mirror of
https://github.com/modelscope/modelscope.git
synced 2026-07-13 22:08:46 +02:00
video depth estimation support cpu mode
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/11442862
This commit is contained in:
@@ -52,7 +52,8 @@ class DROEstimation(TorchModel):
|
||||
if torch.cuda.is_available():
|
||||
model_wrapper = self.model_wrapper.to('cuda')
|
||||
else:
|
||||
raise RuntimeError('cuda is not available')
|
||||
model_wrapper = self.model_wrapper
|
||||
print('cuda is not available, use cpu')
|
||||
|
||||
# Set to eval mode
|
||||
model_wrapper.eval()
|
||||
|
||||
@@ -15,8 +15,8 @@ class VideoDepthEstimationTest(unittest.TestCase, DemoCompatibilityCheck):
|
||||
self.task = 'video-depth-estimation'
|
||||
self.model_id = 'damo/cv_dro-resnet18_video-depth-estimation_indoor'
|
||||
|
||||
@unittest.skipUnless(test_level() >= 3, 'skip test in current test level')
|
||||
def test_image_depth_estimation(self):
|
||||
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
|
||||
def test_video_depth_estimation(self):
|
||||
input_location = 'data/test/videos/video_depth_estimation.mp4'
|
||||
estimator = pipeline(Tasks.video_depth_estimation, model=self.model_id)
|
||||
result = estimator(input_location)
|
||||
|
||||
Reference in New Issue
Block a user