@@ -90,7 +90,7 @@ def __init__(self, fname_list: list, tpu_name: str, queues: list, rebalancing_lo
9090
9191
9292 def start (self , seg_idx : int , fbytes : bytes ):
93- logging .info (f"Loading into { self .tpu_name } : { self .fname_list [seg_idx ]} " )
93+ logging .info (f"Loading { self .tpu_name } : { self .fname_list [seg_idx ]} " )
9494
9595 try :
9696 self .interpreter = edgetpu .make_interpreter (fbytes , delegate = self .delegate )
@@ -1095,8 +1095,6 @@ def _resize_and_chop_tiles(self,
10951095 m_width : int ,
10961096 m_height : int ):
10971097 """
1098- Run the image resizing in an independent process pool.
1099-
11001098 Image resizing is one of the more expensive things we're doing here.
11011099 It's expensive enough that it may take as much CPU time as inference
11021100 under some circumstances. The Lanczos resampling kernel in particular
@@ -1148,6 +1146,7 @@ def _resize_and_chop_tiles(self,
11481146 tiles = []
11491147 for x_off in range (0 , resamp_x - options .tile_overlap , m_width - options .tile_overlap ):
11501148 for y_off in range (0 , resamp_y - options .tile_overlap , m_height - options .tile_overlap ):
1149+ # Adjust contrast on a per-chunk basis; we will likely be quantizing the image during scaling
11511150 image_chunk = ImageOps .autocontrast (image .crop ((x_off ,
11521151 y_off ,
11531152 x_off + m_width ,
@@ -1160,6 +1159,10 @@ def _resize_and_chop_tiles(self,
11601159
11611160 tiles .append ((cropped_arr .astype (self .input_details ['dtype' ]), resamp_info ))
11621161
1162+ # Check again with various scales
1163+ #Image.fromarray((tiles[-1][0] + 128).astype(np.uint8)).save("test.png")
1164+
1165+
11631166 return tiles
11641167
11651168
0 commit comments