Skip to content

Commit

Permalink
Fix PIL 10 compatibility (#705)
Browse files Browse the repository at this point in the history
* address moviepy bug

* fix for PIL>=10.0
  • Loading branch information
lanpa committed Jul 9, 2023
1 parent 7693d1a commit d75a89b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
python-version: 3.9
- name: Run examples
run: |
pip install six tensorboard pytest matplotlib torchvision protobuf==4.22.3 moviepy==1.0.3 imageio==2.27 pillow==9.5.0
pip install six tensorboard pytest matplotlib torchvision protobuf==4.22.3 moviepy==1.0.3 imageio==2.27
python examples/demo.py
python examples/demo_graph.py
python examples/demo_embedding.py
Expand Down
2 changes: 1 addition & 1 deletion examples/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
except ImportError:
skip_audio = True

resnet18 = models.resnet18(False)
resnet18 = models.resnet18(weights=None)
writer = SummaryWriter()
sample_rate = 44100
freqs = [262, 294, 330, 349, 392, 440, 440, 440, 440, 440, 440]
Expand Down
3 changes: 2 additions & 1 deletion tensorboardX/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def _draw_single_box(image, xmin, ymin, xmax, ymax, display_str, color='black',
if display_str:
text_bottom = bottom
# Reverse list and print from bottom to top.
text_width, text_height = font.getsize(display_str)
l, t, r, b = font.getbbox(display_str)
text_width, text_height = r - l, b - t
margin = np.ceil(0.05 * text_height)
draw.rectangle(
[(left, text_bottom - text_height - 2 * margin),
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ soundfile
visdom
onnx
pytest-cov
imageio==2.27
imageio==2.27 # moviepy bug

0 comments on commit d75a89b

Please sign in to comment.