Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build with proper pix2pixhd pkg #91

Merged
merged 2 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ help:
@echo ""
@echo " deps Install python deps via pip"
@echo " install Install"
@echo " patch-pix2pixhd Patch pix2pixhd to trick it into thinking it was part of this mess"
@echo " ocrd_anybaseocr/pix2pixhd Checkout pix2pixhd submodule"
@echo " repo/assets Clone OCR-D/assets to ./repo/assets"
@echo " assets-clean Remove assets"
@echo " assets Setup test assets"
Expand All @@ -53,23 +53,11 @@ deps:
$(PIP_INSTALL) -r requirements.txt

# Install
install: patch-pix2pixhd
install: ocrd_anybaseocr/pix2pixhd
$(PIP_INSTALL) .
.PHONY: patch-pix2pixhd

# Patch pix2pixhd to trick it into thinking it was part of this mess
PIX2PIX_FILES = ocrd_anybaseocr/pix2pixhd/*/*.py ocrd_anybaseocr/pix2pixhd/*.py
patch-pix2pixhd: pix2pixhd
touch ocrd_anybaseocr/pix2pixhd/__init__.py
sed -i 's,^from util,from ..util,' $(PIX2PIX_FILES)
sed -i 's,^import util,import ..util,' $(PIX2PIX_FILES)
sed -i 's,^\(\s*\)from data,\1from .data,' ocrd_anybaseocr/pix2pixhd/*.py
sed -i 's,^\(\s*\)from data,\1from ..data,' ocrd_anybaseocr/pix2pixhd/*/*.py
# string exceptions, srsly y
sed -i "s,raise('\([^']*\)',raise(Exception('\1')," $(PIX2PIX_FILES)

pix2pixhd:
git submodule update --init

ocrd_anybaseocr/pix2pixhd:
git submodule update --init $@

#
# Assets
Expand Down
2 changes: 1 addition & 1 deletion ocrd_anybaseocr/pix2pixhd
Submodule pix2pixhd updated 47 files
+49 −0 .pylintrc
+148 −144 README.md
+0 −54 encode_features.py
+0 −0 pix2pixhd/__init__.py
+0 −0 pix2pixhd/data/__init__.py
+17 −17 pix2pixhd/data/aligned_dataset.py
+3 −4 pix2pixhd/data/base_data_loader.py
+11 −11 pix2pixhd/data/base_dataset.py
+2 −2 pix2pixhd/data/custom_dataset_data_loader.py
+1 −1 pix2pixhd/data/data_loader.py
+2 −2 pix2pixhd/data/image_folder.py
+60 −0 pix2pixhd/encode_features.py
+0 −0 pix2pixhd/models/__init__.py
+11 −11 pix2pixhd/models/base_model.py
+2 −2 pix2pixhd/models/models.py
+73 −73 pix2pixhd/models/networks.py
+65 −63 pix2pixhd/models/pix2pixHD_model.py
+100 −101 pix2pixhd/models/ui_model.py
+0 −0 pix2pixhd/options/__init__.py
+20 −20 pix2pixhd/options/base_options.py
+2 −2 pix2pixhd/options/test_options.py
+5 −5 pix2pixhd/options/train_options.py
+39 −0 pix2pixhd/precompute_feature_maps.py
+7 −9 pix2pixhd/run_engine.py
+19 −13 pix2pixhd/test.py
+35 −28 pix2pixhd/train.py
+0 −0 pix2pixhd/util/__init__.py
+0 −0 pix2pixhd/util/html.py
+0 −0 pix2pixhd/util/image_pool.py
+4 −4 pix2pixhd/util/util.py
+3 −5 pix2pixhd/util/visualizer.py
+0 −33 precompute_feature_maps.py
+6 −0 requirements.txt
+1 −1 scripts/test_1024p.sh
+5 −5 scripts/test_1024p_feat.sh
+4 −3 scripts/test_512p.sh
+6 −5 scripts/test_512p_feat.sh
+5 −4 scripts/train_1024p_12G.sh
+5 −4 scripts/train_1024p_24G.sh
+7 −6 scripts/train_1024p_feat_12G.sh
+7 −6 scripts/train_1024p_feat_24G.sh
+3 −2 scripts/train_512p.sh
+3 −2 scripts/train_512p_feat.sh
+3 −2 scripts/train_512p_fp16.sh
+3 −2 scripts/train_512p_fp16_multigpu.sh
+3 −2 scripts/train_512p_multigpu.sh
+34 −0 setup.py
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ shapely
tensorflow
torch>=1.1.0
torchvision >= 0.6.1
pix2pixhd # @ ./ocrd_anybaseocr/pix2pixhd