Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
liaogulou committed Apr 11, 2024
1 parent 904e15d commit ae84137
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion easycv/predictors/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ def __init__(self,
model_config: config string for model to init, in json format
"""
self.predictor = Predictor(model_path)

if 'class_list' not in self.predictor.cfg and \
'CLASSES' not in self.predictor.cfg and \
label_map_path is None:
Expand Down Expand Up @@ -346,6 +345,7 @@ def predict(self, input_data_list, batch_size=-1):
input_data = self.batch(image_tensor_list)
output_prob = self.predictor.predict_batch(
input_data, mode='test')['prob'].data.cpu()

topk_prob = torch.topk(output_prob, self.topk).values.numpy()
topk_class = torch.topk(output_prob, self.topk).indices.numpy()
output_prob = output_prob.numpy()
Expand Down
1 change: 0 additions & 1 deletion tests/test_apis/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def test_export_cls_syncbn(self):
'model.backbone.norm_cfg.type': 'SyncBN',
'export.export_type': 'raw'
}

if cfg_options is not None:
cfg.merge_from_dict(cfg_options)

Expand Down

0 comments on commit ae84137

Please sign in to comment.