add smoke and fire detection model using damoyolo

新增垂域目标检测模型-基于DAMO_YOLO的烟火检测模型

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/11880693
This commit is contained in:
qize.yqz
2023-03-09 01:25:06 +08:00
committed by wenmeng.zwm
parent a5b9d3378f
commit 0efc892196
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:713082e6967760d5a0d1ae07af62ecc58f9b8b0ab418394556dc5c6c31c27056
size 63761

View File

@@ -196,6 +196,28 @@ class TinynasObjectDetectionTest(unittest.TestCase, DemoCompatibilityCheck):
OutputKeys.LABELS in result) and (OutputKeys.BOXES in result)
print('results: ', result)
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
def test_smokefire_detection_damoyolo(self):
tinynas_object_detection = pipeline(
Tasks.domain_specific_object_detection,
model='damo/cv_tinynas_object-detection_damoyolo_smokefire')
result = tinynas_object_detection(
'data/test/images/image_smokefire_detection.jpg')
assert result and (OutputKeys.SCORES in result) and (
OutputKeys.LABELS in result) and (OutputKeys.BOXES in result)
print('results: ', result)
@unittest.skipUnless(test_level() >= 1, 'skip test in current test level')
def test_smokefire_detection_damoyolo_with_image(self):
tinynas_object_detection = pipeline(
Tasks.domain_specific_object_detection,
model='damo/cv_tinynas_object-detection_damoyolo_smokefire')
img = Image.open('data/test/images/image_smokefire_detection.jpg')
result = tinynas_object_detection(img)
assert result and (OutputKeys.SCORES in result) and (
OutputKeys.LABELS in result) and (OutputKeys.BOXES in result)
print('results: ', result)
if __name__ == '__main__':
unittest.main()