Skip to content

Commit 99f66cb

Browse files
committed
fix display bug for bit=8,16
1 parent 471fc54 commit 99f66cb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

inference/indexer.py

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def read_log_path(self):
4545
self.config = json.load(open(self.log_path + '/config.json'))
4646
self.nbit = self.config['arch_kwargs']['nbit']
4747
self.nclass = self.config['arch_kwargs']['nclass']
48+
assert self.nbit % 8 == 0, 'Number of bit must be multiple of 8'
4849

4950
def load_model(self):
5051
model_path = os.path.join(self.log_path, 'models', 'best.pth')

inference/web.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def process_query(f, indexer: Indexer):
3737

3838
time_string = f'Time taken: {(end_time - start_time):.3f}s\n'
3939
code_string = "".join(str(np.unpackbits(query_code)).split())[1:-2]
40-
code_string = '\n'.join(code_string[i:i + 32] for i in range(0, len(code_string), 32))
40+
code_string = '\n'.join(code_string[i:i + 8] for i in range(0, len(code_string), 8))
4141
return dist, img_paths, code_string, encoded_img_data, img_, time_string
4242

4343

0 commit comments

Comments
 (0)