zhizeng115's picture
Complete four-task dataset and portable code release
7e7a152 verified
Raw History Blame Contribute Delete
1.12 kB
"""Frozen common-v3 evaluation runner with a dedicated stereo actor factory."""
import sys,json
from pathlib import Path
R=Path(__file__).resolve().parents[2];sys.path[:0]=[str(R),str(R/'tools')]
from evaluation.fourtask_common_v3.registry import MODELS
from training.hvs_audio_fourtask_v2.data import sha
cfg=json.loads(Path(__file__).with_name('config.json').read_text())
for parent in cfg['parents']:
for stage in ['sft','idm']:
name=f'stereo_{parent}_{stage}'
MODELS[name]=dict(kind='stereo_backbone',parent=str(Path(cfg['output_root'])/parent/stage),path=MODELS[parent]['path'],audio=True,native_audio_track='vision_stereo',base=parent,stage=stage,adapter_sha256=sha(Path(__file__).with_name('model.py')),training_config=cfg,python=sys.executable)
def actor(name,out,max_pixels=65536):
from training.stereo_backbones_v1.model import StereoActor
p=MODELS[name];a=StereoActor(p['base'],out,cfg,Path(p['parent'])/'final.safetensors');a.model.requires_grad_(False);a.model.eval();return a
if __name__=='__main__':
import training.stereo_backbones_v1.eval_runner as runner
runner.Actor=actor
runner.main()