Skip to content

Commit

Permalink
imports to top
Browse files Browse the repository at this point in the history
  • Loading branch information
Daraan committed Jan 20, 2025
1 parent 4bcb03a commit 6b45ae9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_summary.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from __future__ import absolute_import, division, print_function, unicode_literals

import io
from tensorboardX import summary
from .expect_reader import compare_proto, write_proto
import numpy as np
import pytest
import unittest
import torch

from PIL import Image, ImageSequence
# compare_proto = write_proto # massive update expect

def tensor_N(shape, dtype=float):
Expand Down Expand Up @@ -78,17 +82,13 @@ def test_image_without_channel(self):

@staticmethod
def _iter_gif(encoded_image):
import io

from PIL import Image, ImageSequence
image_io = io.BytesIO(encoded_image)
im = Image.open(image_io, )
for frame in ImageSequence.Iterator(im):
yield frame.getchannel(0)

@staticmethod
def _load_expected_test_video():
from PIL import Image, ImageSequence
with Image.open("tests/expect/test_summary.test_video.expect.gif") as im:
return list(ImageSequence.Iterator(im))

Expand Down

0 comments on commit 6b45ae9

Please sign in to comment.