<s> from __future__ import division <EOL> import random <EOL> import unittest <EOL> import pwa <EOL> from masque . utils import implot , delaunay , draw_tri <EOL> from tests . common import read_images_and_landmarks <EOL> from tests . common import interactive , data_dir_path <EOL> class PWATest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . data_dir = data_dir_path ( ) <EOL> def tearDown ( self ) : <EOL> pass <EOL> def test_basic_pwa ( self ) : <EOL> data_tuples = read_images_and_landmarks ( self . data_dir ) <EOL> im0 , lms0 = data_tuples [ <NUM_LIT:0> ] <EOL> tri0 = delaunay ( lms0 ) <EOL> im0 = draw_tri ( im0 , lms0 , tri0 ) <EOL> im1 , lms1 = data_tuples [ <NUM_LIT:1> ] <EOL> tri1 = delaunay ( lms1 ) <EOL> im1 = draw_tri ( im1 , lms1 , tri1 ) <EOL> im1to0 = pwa . warpTriangle ( im1 , <EOL> lms1 [ : , [ <NUM_LIT:1> , <NUM_LIT:0> ] ] , lms0 [ : , [ <NUM_LIT:1> , <NUM_LIT:0> ] ] , <EOL> tri1 , im0 . shape ) <EOL> implot ( [ im0 , im1 , im1to0 ] ) </s>
