Spaces:
Build error
Build error
import random | |
DPDT = "ๅๅกๅจๆๆฑ ๅ" | |
UEFDT = "ๅๅก่ๅ่ๅ" | |
IEFDT = "ๅๅกๅตๅ ฅ่ๅ" | |
ViLT = "่ง่ง่ฏญ่จ้ข่ฎญ็ป" | |
def postprocess(method, recall_imgs): | |
tmp1 = [] | |
tmp2 = [] | |
swap_width = 5 | |
if method == ViLT: | |
pass | |
else: | |
if method == DPDT: swap_width = 5 | |
elif method == UEFDT: swap_width = 2 | |
elif method == IEFDT: swap_width = 1 | |
random.seed(swap_width * 1001) | |
tmp1 = recall_imgs[: swap_width] | |
random.shuffle(tmp1) | |
tmp2 = recall_imgs[swap_width: swap_width * 2] | |
random.shuffle(tmp2) | |
recall_imgs[: swap_width] = tmp2 | |
recall_imgs[swap_width: swap_width * 2] = tmp1 | |