Skip to content

Commit

Permalink
fixed fastai/fastprogress, libpng dylib issues, one step closer to di…
Browse files Browse the repository at this point in the history
…stributable
  • Loading branch information
bpops committed Jun 24, 2020
1 parent d32f934 commit 8aaa01f
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 4 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ python timeslide.py

- timeslide is very preliminary; lots of ideas on features to add
- image size and aspect ratio in window are just for display; the saved image will be correct resolution and proportions
- tested so far only on macOS, Python 3.8
- fasti must be installed (via pip) with no dependencies (i.e., `pip install --no-deps fastai`)
- tested so far only on macOS, Python 3.7
4 changes: 4 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ wget https://www.dropbox.com/s/mwjep3vyqk5mkjc/ColorizeStable_gen.pth -O ./model
git clone https://github.com/idealo/image-super-resolution.git isr_repo
wget https://github.com/idealo/image-super-resolution/raw/master/weights/sample_weights/rdn-C6-D20-G64-G064-x2/PSNR-driven/rdn-C6-D20-G64-G064-x2_PSNR_epoch086.hdf5 -O ./models/

# python venv
rm -fr venv
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

6 changes: 6 additions & 0 deletions bundle_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# timeslide macOS bundler

source ./venv/bin/activate
rm -fr dist build
pyinstaller -F timeslide.spec
Binary file added hooks/__pycache__/hook-fastprogress.cpython-37.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions hooks/hook-fastprogress.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# credit: https://justcode.nimbco.com/Classifying-bears-as-a-desktop-app/

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('fastprogress')
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ torchvision==0.6.0
numpy==1.18.4
requests==2.23.0
scipy==1.4.1
fastai==1.0.51
ffmpeg==1.4
ipython==7.15.0
Pillow==7.1.2
tensorboardX==2.0
tensorboardX==2.0
fastai==1.0.51
3 changes: 3 additions & 0 deletions timeslide.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# a beautifully simple gui to slide old photographs into TODAY
#

# required for pyinstaller: pytorch
os.environ["PYTORCH_JIT"] = "0"

# set up delodify
from deoldify import device
from deoldify.device_id import DeviceId
Expand Down
34 changes: 34 additions & 0 deletions timeslide.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- mode: python ; coding: utf-8 -*-

block_cipher = None


a = Analysis(['timeslide.py'],
pathex=['.'],#'~/repos/timeslide'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=['hooks'],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
a.binaries = a.binaries - TOC([('libpng16.16.dylib',None,None)])
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='timeslide',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True )

0 comments on commit 8aaa01f

Please sign in to comment.