Browse Source

[to #42322933] remove revision usage for face detection

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10507910

    * [to #42322933] remove revision usage for face detection
master
yingda.chen mulin.lyh 3 years ago
parent
commit
de7b6a06e9
3 changed files with 4 additions and 6 deletions
  1. +1
    -1
      modelscope/pipelines/cv/face_recognition_pipeline.py
  2. +2
    -4
      tests/pipelines/test_face_detection.py
  3. +1
    -1
      tests/trainers/test_face_detection_scrfd_trainer.py

+ 1
- 1
modelscope/pipelines/cv/face_recognition_pipeline.py View File

@@ -49,7 +49,7 @@ class FaceRecognitionPipeline(Pipeline):
# face detect pipeline
det_model_id = 'damo/cv_resnet_facedetection_scrfd10gkps'
self.face_detection = pipeline(
Tasks.face_detection, model=det_model_id, model_revision='v2')
Tasks.face_detection, model=det_model_id)

def _choose_face(self,
det_result,


+ 2
- 4
tests/pipelines/test_face_detection.py View File

@@ -28,8 +28,7 @@ class FaceDetectionTest(unittest.TestCase, DemoCompatibilityCheck):
input_location = ['data/test/images/face_detection2.jpeg']

dataset = MsDataset.load(input_location, target='image')
face_detection = pipeline(
Tasks.face_detection, model=self.model_id, model_revision='v2')
face_detection = pipeline(Tasks.face_detection, model=self.model_id)
# note that for dataset output, the inference-output is a Generator that can be iterated.
result = face_detection(dataset)
result = next(result)
@@ -37,8 +36,7 @@ class FaceDetectionTest(unittest.TestCase, DemoCompatibilityCheck):

@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
def test_run_modelhub(self):
face_detection = pipeline(
Tasks.face_detection, model=self.model_id, model_revision='v2')
face_detection = pipeline(Tasks.face_detection, model=self.model_id)
img_path = 'data/test/images/face_detection2.jpeg'

result = face_detection(img_path)


+ 1
- 1
tests/trainers/test_face_detection_scrfd_trainer.py View File

@@ -28,7 +28,7 @@ def _setup():
val_root = val_dir + '/' + os.listdir(val_dir)[0] + '/'
max_epochs = 1 # run epochs in unit test

cache_path = snapshot_download(model_id, revision='v2')
cache_path = snapshot_download(model_id)

tmp_dir = tempfile.TemporaryDirectory().name
if not os.path.exists(tmp_dir):


Loading…
Cancel
Save