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

fix imread (#824)

* fix imread

* rm unused decode

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