Skip to content

Commit

Permalink
make pkg work with python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
cuicaihao committed Jan 16, 2022
1 parent b52ba12 commit 2171214
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ on:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8.10
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.8.10
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ create_environment:
ifeq (True,$(HAS_CONDA))
@echo ">>> Detected conda, creating conda environment."
ifeq (3,$(findstring 3,$(PYTHON_INTERPRETER)))
conda create --name $(PROJECT_NAME) python=3
conda create --name $(PROJECT_NAME) python=3.8
else
conda create --name $(PROJECT_NAME) python=2.7
endif
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Provide good support for deep learning and computer vision tasks by creating a t

Here is a sample image pairs, the size of RGB and GT are 1000-by-1000 large. The `SplitRaster` package successfully generate 16 256x256 images tiles with automatic padding on the edges. You can adjust the tile size and the overlap of the tiles for your own applications.


## Update Log
- 2022-Jan-16 Fix bugs to make package suitable for python 3.7. Publish new version at(https://pypi.org/project/splitraster/0.3.2/) .


![Sample Image](docs/split_raster_sample.png)

## Use the packages
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# GDAL==3.3.1
# tqdm>=4.40.0
# scikit-image>=0.18.0
splitraster==0.3.1
splitraster==0.3.2
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path
setup(
name='splitraster',
version='0.3.1',
version='0.3.2',
author='Chris Cui',
author_email='',
description='Provide good support for deep learning and computer vision tasks by creating a tiled output from an input raster dataset.',
Expand Down
2 changes: 1 addition & 1 deletion src/splitraster/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def split_image(img_path, save_path, crop_size, repetition_rate=0, overwrite=Tru
print(f"Input Image File Shape (H, W, D):{ img.shape}")

stride = int(crop_size*(1-repetition_rate))
print(f"{crop_size=}, {stride=}")
print(f"crop_size = {crop_size}, stride = {stride}")

padded_img = padding_image(img, stride)
H = padded_img.shape[0]
Expand Down

0 comments on commit 2171214

Please sign in to comment.