Commit be5a7f55 authored by 吴升宇's avatar 吴升宇

merge tem update

parent 99d13fb8
...@@ -29,3 +29,4 @@ dist/ ...@@ -29,3 +29,4 @@ dist/
/datasets /datasets
/models /models
/output /output
local_config.py
\ No newline at end of file
...@@ -61,7 +61,10 @@ def img_to_three_color_map(source_path, target_path): ...@@ -61,7 +61,10 @@ def img_to_three_color_map(source_path, target_path):
masks_per_dim=args.masks_per_dim, masks_per_dim=args.masks_per_dim,
min_image_size=args.min_image_size, min_image_size=args.min_image_size,
) )
source_path = source_path[3:]
target_path = target_path[3:]
print(target_path)
print(source_path)
img = cv2.imread(source_path) img = cv2.imread(source_path)
composite = coco_demo.run_on_opencv_image(img) composite = coco_demo.run_on_opencv_image(img)
if composite is not None: if composite is not None:
......
...@@ -13,18 +13,23 @@ def write_redis(source_path, target_path): ...@@ -13,18 +13,23 @@ def write_redis(source_path, target_path):
def main(): def main():
rs = os.walk('../fashionbase/images/dataset_0520/weiyi') rs = os.walk('../../fashionbase/images/dataset_0520/xifu')
for a, b, files in rs: for a, b, files in rs:
print(a)
for file in files: for file in files:
dir = source_path.replace('dataset_0520', 'dataset_0520_10000') dir = '../../fashionbase/images/dataset_0520/xifu'.replace('dataset_0520', 'dataset_0520_10000')
fold = os.exit(dir) fold = os.path.exists(dir)
if not fold: if not fold:
os.mkdir(dir) os.mkdir(dir)
source_path = '../fashionbase/images/dataset_0520/weiyi/' + file source_path = '../../fashionbase/images/dataset_0520/xifu/' + file
target_path = source_path.replace('dataset_0520', 'dataset_0520_10000') target_path = source_path.replace('dataset_0520', 'dataset_0520_10000')
# source_path = source_path[3:]
# target_path = target_path[3:]
print(source_path) print(source_path)
print(target_path) print(target_path)
#write_redis(source_path, target_path) # img_reproce.delay(source_path, target_path)
write_redis(source_path, target_path)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -63,8 +63,9 @@ def all_gather(data): ...@@ -63,8 +63,9 @@ def all_gather(data):
tensor = torch.ByteTensor(storage).to("cuda") tensor = torch.ByteTensor(storage).to("cuda")
# obtain Tensor size of each rank # obtain Tensor size of each rank
local_size = torch.IntTensor([tensor.numel()]).to("cuda") local_size = torch.LongTensor([tensor.numel()]).to("cuda")
size_list = [torch.IntTensor([0]).to("cuda") for _ in range(world_size)] size_list = [torch.LongTensor([0]).to("cuda") for _ in range(world_size)]
dist.all_gather(size_list, local_size) dist.all_gather(size_list, local_size)
size_list = [int(size.item()) for size in size_list] size_list = [int(size.item()) for size in size_list]
max_size = max(size_list) max_size = max(size_list)
......
...@@ -10,4 +10,9 @@ CELERY_RESULT_SERIALIZER = 'json' # 读取任务结果一般性能要求不高 ...@@ -10,4 +10,9 @@ CELERY_RESULT_SERIALIZER = 'json' # 读取任务结果一般性能要求不高
CELERY_TASK_RESULT_EXPIRES = 60 * 60 * 24 # 任务过期时间,不建议直接写86400,应该让这样的magic数字表述更明显 CELERY_TASK_RESULT_EXPIRES = 60 * 60 * 24 # 任务过期时间,不建议直接写86400,应该让这样的magic数字表述更明显
CELERY_ACCEPT_CONTENT = ['json', 'msgpack'] # 指定接受的内容类型 CELERY_ACCEPT_CONTENT = ['json', 'msgpack'] # 指定接受的内容类型
\ No newline at end of file
try:
from .config_local import * # noqa
except ImportError:
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment