| @@ -257,7 +257,7 @@ class AutomaticSpeechRecognitionTest(unittest.TestCase, | |||||
| model_id=self.am_tf_model_id, audio_in=dataset_path) | model_id=self.am_tf_model_id, audio_in=dataset_path) | ||||
| self.check_result('test_run_with_wav_dataset_tf', rec_result) | self.check_result('test_run_with_wav_dataset_tf', rec_result) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -22,7 +22,7 @@ class CMDSSLVideoEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| print(f'video embedding output: {result}.') | print(f'video embedding output: {result}.') | ||||
| @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -68,7 +68,7 @@ class GEMMMultiModalEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| output = generative_multi_modal_embedding_pipeline(test_input) | output = generative_multi_modal_embedding_pipeline(test_input) | ||||
| print(output) | print(output) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -23,7 +23,7 @@ class HICOSSLVideoEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| print(f'video embedding output: {result}.') | print(f'video embedding output: {result}.') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -37,7 +37,7 @@ class ImageColorizationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| image_colorization = pipeline(Tasks.image_colorization) | image_colorization = pipeline(Tasks.image_colorization) | ||||
| self.pipeline_inference(image_colorization, self.test_image) | self.pipeline_inference(image_colorization, self.test_image) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -61,7 +61,7 @@ class ImageDenoiseTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| w, h = denoise_img.size | w, h = denoise_img.size | ||||
| print('pipeline: the shape of output_img is {}x{}'.format(h, w)) | print('pipeline: the shape of output_img is {}x{}'.format(h, w)) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -61,7 +61,7 @@ class ImageInstanceSegmentationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| print(f'pipeline1:{pipeline1(input=self.image)[OutputKeys.LABELS]}') | print(f'pipeline1:{pipeline1(input=self.image)[OutputKeys.LABELS]}') | ||||
| print(f'pipeline2: {pipeline2(input=self.image)[OutputKeys.LABELS]}') | print(f'pipeline2: {pipeline2(input=self.image)[OutputKeys.LABELS]}') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -61,7 +61,7 @@ class ImageMattingTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| f'Output written to dir: {osp.dirname(osp.abspath("result_0.png"))}' | f'Output written to dir: {osp.dirname(osp.abspath("result_0.png"))}' | ||||
| ) | ) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -38,7 +38,7 @@ class ImagePanopticSegmentationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| cv2.imwrite('result.jpg', draw_img) | cv2.imwrite('result.jpg', draw_img) | ||||
| print('print test_image_panoptic_segmentation from PIL return success') | print('print test_image_panoptic_segmentation from PIL return success') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -39,7 +39,7 @@ class ImagePortraitEnhancementTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| face_enhancement = pipeline(Tasks.image_portrait_enhancement) | face_enhancement = pipeline(Tasks.image_portrait_enhancement) | ||||
| self.pipeline_inference(face_enhancement, self.test_image) | self.pipeline_inference(face_enhancement, self.test_image) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -50,7 +50,7 @@ class ImageReidPersonTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| ) | ) | ||||
| print(f'The img embedding is: {result[OutputKeys.IMG_EMBEDDING]}') | print(f'The img embedding is: {result[OutputKeys.IMG_EMBEDDING]}') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -51,7 +51,7 @@ class ImageSemanticSegmentationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| cv2.imwrite('result.jpg', draw_img) | cv2.imwrite('result.jpg', draw_img) | ||||
| print('test_image_semantic_segmentation_vitadapter_from_PIL DONE') | print('test_image_semantic_segmentation_vitadapter_from_PIL DONE') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -50,7 +50,7 @@ class ImageStyleTransferTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| cv2.imwrite('result_styletransfer3.png', result[OutputKeys.OUTPUT_IMG]) | cv2.imwrite('result_styletransfer3.png', result[OutputKeys.OUTPUT_IMG]) | ||||
| print('style_transfer.test_run_modelhub_default_model done') | print('style_transfer.test_run_modelhub_default_model done') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -37,7 +37,7 @@ class ImageSuperResolutionTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| super_resolution = pipeline(Tasks.image_super_resolution) | super_resolution = pipeline(Tasks.image_super_resolution) | ||||
| self.pipeline_inference(super_resolution, self.img) | self.pipeline_inference(super_resolution, self.img) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -296,7 +296,7 @@ class KeyWordSpottingTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| model_id=self.model_id, audio_in=audio_list) | model_id=self.model_id, audio_in=audio_list) | ||||
| self.check_result('test_run_with_roc', kws_result) | self.check_result('test_run_with_roc', kws_result) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -21,7 +21,7 @@ class LiveCategoryTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| print(f'live category output: {result}.') | print(f'live category output: {result}.') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -35,7 +35,7 @@ class MovieSceneSegmentationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| else: | else: | ||||
| raise ValueError('process error') | raise ValueError('process error') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -80,7 +80,7 @@ class MplugTasksTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| result = pipeline_retrieval(input) | result = pipeline_retrieval(input) | ||||
| print(result) | print(result) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -59,7 +59,7 @@ class MultiModalEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| print('l2-norm: {}'.format(torch.norm(text_embedding, | print('l2-norm: {}'.format(torch.norm(text_embedding, | ||||
| dim=-1).item())) # should be 1.0 | dim=-1).item())) # should be 1.0 | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -94,7 +94,7 @@ class NamedEntityRecognitionTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| pipeline_ins = pipeline(task=Tasks.named_entity_recognition) | pipeline_ins = pipeline(task=Tasks.named_entity_recognition) | ||||
| print(pipeline_ins(input=self.sentence)) | print(pipeline_ins(input=self.sentence)) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -57,7 +57,7 @@ class NLITest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| pipeline_ins = pipeline(task=Tasks.nli) | pipeline_ins = pipeline(task=Tasks.nli) | ||||
| print(pipeline_ins(input=(self.sentence1, self.sentence2))) | print(pipeline_ins(input=(self.sentence1, self.sentence2))) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -55,7 +55,7 @@ class ObjectDetectionTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| else: | else: | ||||
| raise ValueError('process error') | raise ValueError('process error') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -30,7 +30,7 @@ class OCRDetectionTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| ocr_detection = pipeline(Tasks.ocr_detection) | ocr_detection = pipeline(Tasks.ocr_detection) | ||||
| self.pipeline_inference(ocr_detection, self.test_image) | self.pipeline_inference(ocr_detection, self.test_image) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -37,7 +37,7 @@ class OCRRecognitionTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| ocr_recognition = pipeline(Tasks.ocr_recognition) | ocr_recognition = pipeline(Tasks.ocr_recognition) | ||||
| self.pipeline_inference(ocr_recognition, self.test_image) | self.pipeline_inference(ocr_recognition, self.test_image) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -252,7 +252,7 @@ class OfaTasksTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| result[OutputKeys.OUTPUT_IMG].save('result.png') | result[OutputKeys.OUTPUT_IMG].save('result.png') | ||||
| print(f'Output written to {osp.abspath("result.png")}') | print(f'Output written to {osp.abspath("result.png")}') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -36,7 +36,7 @@ class ImageCartoonTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| img_cartoon = pipeline(Tasks.image_portrait_stylization) | img_cartoon = pipeline(Tasks.image_portrait_stylization) | ||||
| self.pipeline_inference(img_cartoon, self.test_image) | self.pipeline_inference(img_cartoon, self.test_image) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -39,7 +39,7 @@ class ProductRetrievalEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| result = product_embed(self.img_input)[OutputKeys.IMG_EMBEDDING] | result = product_embed(self.img_input)[OutputKeys.IMG_EMBEDDING] | ||||
| print('abs sum value is: {}'.format(np.sum(np.abs(result)))) | print('abs sum value is: {}'.format(np.sum(np.abs(result)))) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -47,7 +47,7 @@ class RealtimeObjectDetectionTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| else: | else: | ||||
| raise ValueError('process error') | raise ValueError('process error') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -55,7 +55,7 @@ class RelationExtractionTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| pipeline_ins = pipeline(task=Tasks.information_extraction) | pipeline_ins = pipeline(task=Tasks.information_extraction) | ||||
| print(pipeline_ins(input=self.sentence)) | print(pipeline_ins(input=self.sentence)) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -24,7 +24,7 @@ class SalientDetectionTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| # result[OutputKeys.MASKS] is salient map result,other keys are not used | # result[OutputKeys.MASKS] is salient map result,other keys are not used | ||||
| cv2.imwrite(input_location + '_salient.jpg', result[OutputKeys.MASKS]) | cv2.imwrite(input_location + '_salient.jpg', result[OutputKeys.MASKS]) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -63,7 +63,7 @@ class SentenceSimilarityTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| pipeline_ins = pipeline(task=Tasks.sentence_similarity) | pipeline_ins = pipeline(task=Tasks.sentence_similarity) | ||||
| print(pipeline_ins(input=(self.sentence1, self.sentence2))) | print(pipeline_ins(input=(self.sentence1, self.sentence2))) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -66,7 +66,7 @@ class SentimentClassificationTaskModelTest(unittest.TestCase, | |||||
| self.assertTrue( | self.assertTrue( | ||||
| isinstance(pipeline_ins.model, SequenceClassificationModel)) | isinstance(pipeline_ins.model, SequenceClassificationModel)) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -41,7 +41,7 @@ class SkinRetouchingTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| skin_retouching = pipeline(Tasks.skin_retouching) | skin_retouching = pipeline(Tasks.skin_retouching) | ||||
| self.pipeline_inference(skin_retouching, self.test_image) | self.pipeline_inference(skin_retouching, self.test_image) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -113,7 +113,7 @@ class SpeechSignalProcessTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| ans(data, output_path=output_path) | ans(data, output_path=output_path) | ||||
| print(f'Processed audio saved to {output_path}') | print(f'Processed audio saved to {output_path}') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -89,7 +89,7 @@ class SequenceClassificationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| result = text_classification(dataset) | result = text_classification(dataset) | ||||
| self.printDataset(result) | self.printDataset(result) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -23,7 +23,7 @@ class TextDrivenSegmentationTest(unittest.TestCase): | |||||
| # result[OutputKeys.MASKS] is segment map result,other keys are not used | # result[OutputKeys.MASKS] is segment map result,other keys are not used | ||||
| cv2.imwrite(input_location + '_lseg.jpg', result[OutputKeys.MASKS]) | cv2.imwrite(input_location + '_lseg.jpg', result[OutputKeys.MASKS]) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.test_demo() | self.test_demo() | ||||
| @@ -55,7 +55,7 @@ class TextErrorCorrectionTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| pipeline_ins = pipeline(task=Tasks.text_error_correction) | pipeline_ins = pipeline(task=Tasks.text_error_correction) | ||||
| print(pipeline_ins(self.input)) | print(pipeline_ins(self.input)) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -129,7 +129,7 @@ class TextGenerationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| pipeline_ins = pipeline(task=Tasks.text_generation) | pipeline_ins = pipeline(task=Tasks.text_generation) | ||||
| print(pipeline_ins(self.palm_input_zh)) | print(pipeline_ins(self.palm_input_zh)) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -51,7 +51,7 @@ class TextToImageSynthesisTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| self.test_text)[OutputKeys.OUTPUT_IMG] | self.test_text)[OutputKeys.OUTPUT_IMG] | ||||
| print(np.sum(np.abs(img))) | print(np.sum(np.abs(img))) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -38,7 +38,7 @@ class TextToSpeechSambertHifigan16kPipelineTest(unittest.TestCase, | |||||
| pcm = output[OutputKeys.OUTPUT_PCM] | pcm = output[OutputKeys.OUTPUT_PCM] | ||||
| write('output.wav', 16000, pcm) | write('output.wav', 16000, pcm) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -19,7 +19,7 @@ class TinyNASClassificationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| result = tinynas_classification('data/test/images/image_wolf.jpeg') | result = tinynas_classification('data/test/images/image_wolf.jpeg') | ||||
| print(result) | print(result) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -15,7 +15,7 @@ class TinynasObjectDetectionTest(unittest.TestCase): | |||||
| 'data/test/images/image_detection.jpg') | 'data/test/images/image_detection.jpg') | ||||
| print(result) | print(result) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.test_demo() | self.test_demo() | ||||
| @@ -21,7 +21,7 @@ class VideoCategoryTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| print(f'video category output: {result}.') | print(f'video category output: {result}.') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -41,7 +41,7 @@ class VideoMultiModalEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| logger.info('video feature: {}'.format( | logger.info('video feature: {}'.format( | ||||
| output['video_embedding'][0][0][0])) | output['video_embedding'][0][0][0])) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -35,7 +35,7 @@ class SingleObjectTracking(unittest.TestCase, DemoCompatibilityCheck): | |||||
| result = video_single_object_tracking((video_path, init_bbox)) | result = video_single_object_tracking((video_path, init_bbox)) | ||||
| print('result is : ', result[OutputKeys.BOXES]) | print('result is : ', result[OutputKeys.BOXES]) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -33,7 +33,7 @@ class VideoSummarizationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| print(f'video summarization output:\n {result}.') | print(f'video summarization output:\n {result}.') | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -34,7 +34,7 @@ class VirtualTryonTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| img = pipeline_virtual_tryon(self.input_imgs)[OutputKeys.OUTPUT_IMG] | img = pipeline_virtual_tryon(self.input_imgs)[OutputKeys.OUTPUT_IMG] | ||||
| cv2.imwrite('demo.jpg', img[:, :, ::-1]) | cv2.imwrite('demo.jpg', img[:, :, ::-1]) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -59,7 +59,7 @@ class WordSegmentationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| pipeline_ins = pipeline(task=Tasks.word_segmentation) | pipeline_ins = pipeline(task=Tasks.word_segmentation) | ||||
| print(pipeline_ins(input=self.sentence)) | print(pipeline_ins(input=self.sentence)) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||
| @@ -70,7 +70,7 @@ class ZeroShotClassificationTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| pipeline_ins = pipeline(task=Tasks.zero_shot_classification) | pipeline_ins = pipeline(task=Tasks.zero_shot_classification) | ||||
| print(pipeline_ins(input=self.sentence, candidate_labels=self.labels)) | print(pipeline_ins(input=self.sentence, candidate_labels=self.labels)) | ||||
| @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') | |||||
| @unittest.skip('demo compatibility test is only enabled on a needed-basis') | |||||
| def test_demo_compatibility(self): | def test_demo_compatibility(self): | ||||
| self.compatibility_check() | self.compatibility_check() | ||||