Spaces:
Running
on
Zero
Running
on
Zero
File size: 2,995 Bytes
29d49a9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
"""Test the Processor class."""
import unittest
from PIL import Image
from controlnet_aux.processor import Processor
class TestProcessor(unittest.TestCase):
def test_hed(self):
processor = Processor('hed')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_midas(self):
processor = Processor('midas')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_mlsd(self):
processor = Processor('mlsd')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_openpose(self):
processor = Processor('openpose')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_pidinet(self):
processor = Processor('pidinet')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_normalbae(self):
processor = Processor('normalbae')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_lineart(self):
processor = Processor('lineart')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_lineart_coarse(self):
processor = Processor('lineart_coarse')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_lineart_anime(self):
processor = Processor('lineart_anime')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_canny(self):
processor = Processor('canny')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_content_shuffle(self):
processor = Processor('content_shuffle')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_zoe(self):
processor = Processor('zoe')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
def test_mediapipe_face(self):
processor = Processor('mediapipe_face')
image = Image.open('test_image.png')
processed_image = processor(image)
self.assertIsInstance(processed_image, bytes)
if __name__ == '__main__':
unittest.main() |