Skip to content

Commit

Permalink
Update compress_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pmephin authored May 30, 2023
1 parent 397d972 commit 08f2031
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions compress_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,11 @@ def assign_chunks_to_var(chunk_index,img_slices,Indices):
def slice_image(image,r=4,c=4):

rows,cols = image.shape[:2]
while True:
if (rows%r==0 or rows%r>1) : #making sure there arent any 1x1 chunks
break
else: r+=1

while True:
if cols%c==0 or cols%c>1 :
break
else: c+=1
while rows % r == 1:
r += 1 #making sure there arent any 1x1 chunks

while cols % c == 1:
c += 1

indices=np.arange(0,rows*cols).reshape(rows,cols)
l=[];m=0;n=0;I=[]
Expand Down

0 comments on commit 08f2031

Please sign in to comment.