function ShowAnnotation

load hoi_label.mat;
image_num = numel(hoi_label);
part_num = 11;

for i = 1 : image_num
    im = imread(hoi_label(i).fname);
    imshow(im);
    hold on;
    
    for p = 1 : part_num
        if hoi_label(i).part(p).width < 0  % this part is invisible
            continue;
        end
        
        center_x = hoi_label(i).part(p).center_x;
        center_y = hoi_label(i).part(p).center_y;
        width = hoi_label(i).part(p).width;
        height = hoi_label(i).part(p).height;
        angle = hoi_label(i).part(p).angle;
        
        rot_matrix = [cos(angle) -sin(angle); sin(angle)  cos(angle)];
        pul = rot_matrix * [-width / 2; -height / 2] + [center_x; center_y];
        pur = rot_matrix * [width / 2; -height / 2] + [center_x; center_y];
        plr = rot_matrix * [width / 2; height / 2] + [center_x; center_y];
        pll = rot_matrix * [-width / 2; height / 2] + [center_x; center_y];
        
        if p == 1 || p == 2
            line_color = [1,0,1];
        end
        if p == 3 || p == 4 || p == 5 || p == 6
                line_color = [0,1,0];
        end
        if p == 7 || p == 8 || p == 9 || p == 10
                line_color = [0,1,1];
        end
        if p == 11
            line_color = [1,0,0];
        end
        
        if p == 11
            line_width = 5;
        else
            line_width = 3;
        end
        
        plot([pul(1) pur(1)], [pul(2) pur(2)], 'color', line_color, 'linewidth', line_width);
        plot([pur(1) plr(1)], [pur(2) plr(2)], 'color', line_color, 'linewidth', line_width);
        plot([plr(1) pll(1)], [plr(2) pll(2)], 'color', line_color, 'linewidth', line_width);
        plot([pll(1) pul(1)], [pll(2) pul(2)], 'color', line_color, 'linewidth', line_width);
    end
    
    pause();
    hold off;
end