python - <<'PY'
p='/workspace/scratch/fellfinal.py';s=open(p).read();s=s.replace("cv2.imwrite('/workspace/scratch/fell_proposed.png',old)","for xa,xb in [(292,340),(418,614),(686,796)]:\n old[oy+400:oy+478,ox+xa:ox+xb]=np.minimum(old[oy+400:oy+478,ox+xa:ox+xb],np.rint(al[oy+400:oy+478,ox+xa:ox+xb]*255).astype('uint8'))\ncv2.imwrite('/workspace/scratch/fell_proposed.png',old)");open(p,'w').write(s)
PY
OPENBLAS_NUM_THREADS=1 python /workspace/scratch/fellfinal.py
python - <<'PY'
from PIL import Image
import cv2,json
s='HH-8285';m=cv2.imread('/workspace/scratch/fell_proposed.png',0);cv2.imwrite('/workspace/scratch/finalmasks/'+s+'.png',m)
x0,y0,x1,y1=json.load(open('/workspace/scratch/assetmeta.json'))[s]['crop'];p='/workspace/output/assets/'+s+'.png';im=Image.open(p);icc=im.info['icc_profile'];im.putalpha(Image.fromarray(m[y0:y1,x0:x1]));im.save(p,icc_profile=icc,dpi=(300,300),compress_level=6)
PY
OPENBLAS_NUM_THREADS=1 python /workspace/scratch/layout.py > /workspace/scratch/layout_final.log
QT_QPA_PLATFORM=offscreen scribus -g -ns -py /workspace/scratch/build.py > /workspace/scratch/build.log 2>&1
python /workspace/scratch/patchsla.py
QT_QPA_PLATFORM=offscreen scribus -g -ns -py /workspace/scratch/export.py > /workspace/scratch/export.log 2>&1
QT_QPA_PLATFORM=offscreen scribus -g -ns -py /workspace/scratch/reopen_check.py > /workspace/scratch/reopen.log 2>&1
python /workspace/scratch/check_integrity.py > /workspace/scratch/integrity_final.log
cat /workspace/scratch/build_overflows.json; tail -4 /workspace/scratch/integrity_final.log