Skip to content

Commit

Permalink
refactorize slicing (#95)
Browse files Browse the repository at this point in the history
* refactorize slicing

* update dev dependencies

* minor refactorization

* update notebooks

* remove unnesessary imports

* add pil image reading

* add pillow to reqs

* refactorize slicing

* update tests
  • Loading branch information
fcakyon authored May 15, 2021
1 parent 3058da1 commit 31bc7e1
Show file tree
Hide file tree
Showing 11 changed files with 564 additions and 438 deletions.
148 changes: 105 additions & 43 deletions demo/inference.ipynb

Large diffs are not rendered by default.

54 changes: 35 additions & 19 deletions demo/slicing.ipynb

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
opencv-python>=4.2.0.32
shapely>=1.7.0
tqdm>=4.48.2
dataclasses; python_version<"3.7"
dataclasses; python_version<"3.7"
pillow>=8.2.0
5 changes: 1 addition & 4 deletions sahi/model.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# OBSS SAHI Tool
# Code written by Fatih C Akyon, 2020.

import os
import sys

import numpy as np

from sahi.prediction import ObjectPrediction, PredictionInput
from sahi.prediction import ObjectPrediction
from sahi.utils.torch import cuda_is_available, empty_cuda_cache


Expand Down
3 changes: 1 addition & 2 deletions sahi/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)
from sahi.utils.file import (
Path,
get_base_filename,
import_class,
increment_path,
list_files,
Expand Down Expand Up @@ -172,7 +171,7 @@ def get_sliced_prediction(

# create slices from full image
time_start = time.time()
slice_image_result, num_total_invalid_segmentation = slice_image(
slice_image_result = slice_image(
image=image,
slice_height=slice_height,
slice_width=slice_width,
Expand Down
Loading

0 comments on commit 31bc7e1

Please sign in to comment.