From ab6ca73b33928bd3f270a82cfca43d37719892d9 Mon Sep 17 00:00:00 2001 From: "Joshua Z. Zhang" Date: Thu, 25 Mar 2021 15:17:48 -0700 Subject: [PATCH] fix df index --- .../estimators/image_classification/image_classification.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gluoncv/auto/estimators/image_classification/image_classification.py b/gluoncv/auto/estimators/image_classification/image_classification.py index 83a97d0fdd..3632c2db3a 100644 --- a/gluoncv/auto/estimators/image_classification/image_classification.py +++ b/gluoncv/auto/estimators/image_classification/image_classification.py @@ -499,8 +499,9 @@ def _predict_feature(self, x, ctx_id=0): if isinstance(x, pd.DataFrame): assert 'image' in x.columns, "Expect column `image` for input images" df = self._predict_feature(tuple(x['image'])) + df = df.set_index(x.index) df['image'] = x['image'] - return df.reset_index(drop=True) + return df elif isinstance(x, (list, tuple)): assert isinstance(x[0], str), "expect image paths in list/tuple input" bs = self._cfg.valid.batch_size