mirror of
https://github.com/modelscope/modelscope.git
synced 2026-02-24 04:01:10 +01:00
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:
3
data/test/images/image_smokefire_detection.jpg
Normal file
3
data/test/images/image_smokefire_detection.jpg
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:713082e6967760d5a0d1ae07af62ecc58f9b8b0ab418394556dc5c6c31c27056
|
||||
size 63761
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user