未验证 提交 63cf3ba4 编写于 作者: L littletomatodonkey 提交者: GitHub

fix imread (#824)

* fix imread

* rm unused decode

* rm decode
上级 a59ac4fb
...@@ -64,6 +64,9 @@ DataLoader: ...@@ -64,6 +64,9 @@ DataLoader:
image_root: "./dataset/iCartoonFace" image_root: "./dataset/iCartoonFace"
cls_label_path: "./dataset/iCartoonFace/train_list.txt" cls_label_path: "./dataset/iCartoonFace/train_list.txt"
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- RandCropImage: - RandCropImage:
size: 224 size: 224
- RandFlipImage: - RandFlipImage:
...@@ -90,6 +93,9 @@ DataLoader: ...@@ -90,6 +93,9 @@ DataLoader:
image_root: "./dataset/iCartoonFace" image_root: "./dataset/iCartoonFace"
cls_label_path: "./dataset/iCartoonFace/query.txt" cls_label_path: "./dataset/iCartoonFace/query.txt"
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
resize_short: 256 resize_short: 256
- CropImage: - CropImage:
...@@ -105,8 +111,8 @@ DataLoader: ...@@ -105,8 +111,8 @@ DataLoader:
drop_last: False drop_last: False
shuffle: False shuffle: False
loader: loader:
num_workers: 6 num_workers: 8
use_shared_memory: False use_shared_memory: True
Gallery: Gallery:
dataset: dataset:
...@@ -114,6 +120,9 @@ DataLoader: ...@@ -114,6 +120,9 @@ DataLoader:
image_root: "./dataset/iCartoonFace" image_root: "./dataset/iCartoonFace"
cls_label_path: "./dataset/iCartoonFace/gallery.txt" cls_label_path: "./dataset/iCartoonFace/gallery.txt"
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
resize_short: 256 resize_short: 256
- CropImage: - CropImage:
...@@ -129,8 +138,8 @@ DataLoader: ...@@ -129,8 +138,8 @@ DataLoader:
drop_last: False drop_last: False
shuffle: False shuffle: False
loader: loader:
num_workers: 6 num_workers: 8
use_shared_memory: False use_shared_memory: True
Metric: Metric:
Train: Train:
......
...@@ -49,6 +49,9 @@ DataLoader: ...@@ -49,6 +49,9 @@ DataLoader:
image_root: ./dataset/ILSVRC2012/ image_root: ./dataset/ILSVRC2012/
cls_label_path: ./dataset/ILSVRC2012/train_list.txt cls_label_path: ./dataset/ILSVRC2012/train_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- RandCropImage: - RandCropImage:
size: 224 size: 224
- RandFlipImage: - RandFlipImage:
...@@ -76,6 +79,9 @@ DataLoader: ...@@ -76,6 +79,9 @@ DataLoader:
image_root: ./dataset/ILSVRC2012/ image_root: ./dataset/ILSVRC2012/
cls_label_path: ./dataset/ILSVRC2012/val_list.txt cls_label_path: ./dataset/ILSVRC2012/val_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
resize_short: 256 resize_short: 256
- CropImage: - CropImage:
......
...@@ -50,6 +50,9 @@ DataLoader: ...@@ -50,6 +50,9 @@ DataLoader:
image_root: ./dataset/ILSVRC2012/ image_root: ./dataset/ILSVRC2012/
cls_label_path: ./dataset/ILSVRC2012/train_list.txt cls_label_path: ./dataset/ILSVRC2012/train_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- RandCropImage: - RandCropImage:
size: 224 size: 224
- RandFlipImage: - RandFlipImage:
...@@ -76,6 +79,9 @@ DataLoader: ...@@ -76,6 +79,9 @@ DataLoader:
image_root: ./dataset/ILSVRC2012/ image_root: ./dataset/ILSVRC2012/
cls_label_path: ./dataset/ILSVRC2012/val_list.txt cls_label_path: ./dataset/ILSVRC2012/val_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
resize_short: 256 resize_short: 256
- CropImage: - CropImage:
......
...@@ -65,6 +65,9 @@ DataLoader: ...@@ -65,6 +65,9 @@ DataLoader:
image_root: "dataset/LogoDet-3K-crop/train/" image_root: "dataset/LogoDet-3K-crop/train/"
cls_label_path: "dataset/LogoDet-3K-crop/LogoDet-3K+train.txt" cls_label_path: "dataset/LogoDet-3K-crop/LogoDet-3K+train.txt"
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- RandFlipImage: - RandFlipImage:
...@@ -95,6 +98,9 @@ DataLoader: ...@@ -95,6 +98,9 @@ DataLoader:
image_root: "dataset/LogoDet-3K-crop/val/" image_root: "dataset/LogoDet-3K-crop/val/"
cls_label_path: "LogoDet-3K-crop/LogoDet-3K+query.txt" cls_label_path: "LogoDet-3K-crop/LogoDet-3K+query.txt"
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
...@@ -108,8 +114,8 @@ DataLoader: ...@@ -108,8 +114,8 @@ DataLoader:
drop_last: False drop_last: False
shuffle: False shuffle: False
loader: loader:
num_workers: 10 num_workers: 8
use_shared_memory: False use_shared_memory: True
Gallery: Gallery:
# TOTO: modify to the latest trainer # TOTO: modify to the latest trainer
...@@ -118,6 +124,9 @@ DataLoader: ...@@ -118,6 +124,9 @@ DataLoader:
image_root: "dataset/LogoDet-3K-crop/train/" image_root: "dataset/LogoDet-3K-crop/train/"
cls_label_path: "dataset/LogoDet-3K-crop/LogoDet-3K+gallery.txt" cls_label_path: "dataset/LogoDet-3K-crop/LogoDet-3K+gallery.txt"
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
...@@ -131,8 +140,8 @@ DataLoader: ...@@ -131,8 +140,8 @@ DataLoader:
drop_last: False drop_last: False
shuffle: False shuffle: False
loader: loader:
num_workers: 10 num_workers: 8
use_shared_memory: False use_shared_memory: True
Metric: Metric:
Eval: Eval:
......
...@@ -60,6 +60,9 @@ DataLoader: ...@@ -60,6 +60,9 @@ DataLoader:
image_root: ./dataset/Aliproduct/ image_root: ./dataset/Aliproduct/
cls_label_path: ./dataset/Aliproduct/train_list.txt cls_label_path: ./dataset/Aliproduct/train_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- RandFlipImage: - RandFlipImage:
...@@ -85,6 +88,9 @@ DataLoader: ...@@ -85,6 +88,9 @@ DataLoader:
image_root: ./dataset/Aliproduct/ image_root: ./dataset/Aliproduct/
cls_label_path: ./dataset/Aliproduct/val_list.txt cls_label_path: ./dataset/Aliproduct/val_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
resize_short: 256 resize_short: 256
- CropImage: - CropImage:
......
...@@ -74,6 +74,9 @@ DataLoader: ...@@ -74,6 +74,9 @@ DataLoader:
image_root: ./dataset/Inshop/ image_root: ./dataset/Inshop/
cls_label_path: ./dataset/Inshop/train_list.txt cls_label_path: ./dataset/Inshop/train_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- RandFlipImage: - RandFlipImage:
...@@ -106,6 +109,9 @@ DataLoader: ...@@ -106,6 +109,9 @@ DataLoader:
image_root: ./dataset/Inshop/ image_root: ./dataset/Inshop/
cls_label_path: ./dataset/Inshop/query_list.txt cls_label_path: ./dataset/Inshop/query_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
...@@ -128,6 +134,9 @@ DataLoader: ...@@ -128,6 +134,9 @@ DataLoader:
image_root: ./dataset/Inshop/ image_root: ./dataset/Inshop/
cls_label_path: ./dataset/Inshop/gallery_list.txt cls_label_path: ./dataset/Inshop/gallery_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
......
...@@ -73,6 +73,9 @@ DataLoader: ...@@ -73,6 +73,9 @@ DataLoader:
image_root: ./dataset/Stanford_Online_Products/ image_root: ./dataset/Stanford_Online_Products/
cls_label_path: ./dataset/Stanford_Online_Products/train_list.txt cls_label_path: ./dataset/Stanford_Online_Products/train_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- RandFlipImage: - RandFlipImage:
...@@ -105,6 +108,9 @@ DataLoader: ...@@ -105,6 +108,9 @@ DataLoader:
image_root: ./dataset/Stanford_Online_Products/ image_root: ./dataset/Stanford_Online_Products/
cls_label_path: ./dataset/Stanford_Online_Products/test_list.txt cls_label_path: ./dataset/Stanford_Online_Products/test_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
...@@ -127,6 +133,9 @@ DataLoader: ...@@ -127,6 +133,9 @@ DataLoader:
image_root: ./dataset/Stanford_Online_Products/ image_root: ./dataset/Stanford_Online_Products/
cls_label_path: ./dataset/Stanford_Online_Products/test_list.txt cls_label_path: ./dataset/Stanford_Online_Products/test_list.txt
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
......
...@@ -71,6 +71,9 @@ DataLoader: ...@@ -71,6 +71,9 @@ DataLoader:
bbox_crop: True bbox_crop: True
cls_label_path: "/work/dataset/CompCars/train_test_split/classification/train_label.txt" cls_label_path: "/work/dataset/CompCars/train_test_split/classification/train_label.txt"
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- RandFlipImage: - RandFlipImage:
...@@ -96,18 +99,21 @@ DataLoader: ...@@ -96,18 +99,21 @@ DataLoader:
drop_last: False drop_last: False
shuffle: True shuffle: True
loader: loader:
num_workers: 6 num_workers: 8
use_shared_memory: False use_shared_memory: True
Eval: Eval:
# TOTO: modify to the latest trainer # TOTO: modify to the latest trainer
dataset: dataset:
name: "CompCars" name: "CompCars"
image_root: "/work/dataset/CompCars/image/" image_root: ".dataset/CompCars/image/"
label_root: "/work/dataset/CompCars/label/" label_root: "./dataset/CompCars/label/"
cls_label_path: "/work/dataset/CompCars/train_test_split/classification/test_label.txt" cls_label_path: "./dataset/CompCars/train_test_split/classification/test_label.txt"
bbox_crop: True bbox_crop: True
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
...@@ -121,8 +127,8 @@ DataLoader: ...@@ -121,8 +127,8 @@ DataLoader:
drop_last: False drop_last: False
shuffle: False shuffle: False
loader: loader:
num_workers: 6 num_workers: 8
use_shared_memory: False use_shared_memory: True
Infer: Infer:
infer_imgs: "docs/images/whl/demo.jpg" infer_imgs: "docs/images/whl/demo.jpg"
......
...@@ -69,6 +69,9 @@ DataLoader: ...@@ -69,6 +69,9 @@ DataLoader:
image_root: "/work/dataset/VeRI-Wild/images/" image_root: "/work/dataset/VeRI-Wild/images/"
cls_label_path: "/work/dataset/VeRI-Wild/train_test_split/train_list_start0.txt" cls_label_path: "/work/dataset/VeRI-Wild/train_test_split/train_list_start0.txt"
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- RandFlipImage: - RandFlipImage:
...@@ -104,6 +107,9 @@ DataLoader: ...@@ -104,6 +107,9 @@ DataLoader:
image_root: "/work/dataset/VeRI-Wild/images" image_root: "/work/dataset/VeRI-Wild/images"
cls_label_path: "/work/dataset/VeRI-Wild/train_test_split/test_3000_id_query.txt" cls_label_path: "/work/dataset/VeRI-Wild/train_test_split/test_3000_id_query.txt"
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
...@@ -127,6 +133,9 @@ DataLoader: ...@@ -127,6 +133,9 @@ DataLoader:
image_root: "/work/dataset/VeRI-Wild/images" image_root: "/work/dataset/VeRI-Wild/images"
cls_label_path: "/work/dataset/VeRI-Wild/train_test_split/test_3000_id.txt" cls_label_path: "/work/dataset/VeRI-Wild/train_test_split/test_3000_id.txt"
transform_ops: transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage: - ResizeImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
......
...@@ -63,8 +63,8 @@ class CommonDataset(Dataset): ...@@ -63,8 +63,8 @@ class CommonDataset(Dataset):
def __getitem__(self, idx): def __getitem__(self, idx):
try: try:
img = cv2.imread(self.images[idx]) with open(self.images[idx], 'rb') as f:
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) img = f.read()
if self._transform_ops: if self._transform_ops:
img = transform(img, self._transform_ops) img = transform(img, self._transform_ops)
img = img.transpose((2, 0, 1)) img = img.transpose((2, 0, 1))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册