import json import numpy as np from tqdm import tqdm from pathlib import Path from infer_utils import run_inference_single # For the purposes of an experiment, change the infer_utils to: # from infer_utils_mod import run_inference_single def run_aid_fmow_ucmerced_inference( model, dataset_path, processor, tokenizer, conv_mode, use_video_data=False, open_prompt=None, repeat_frames=None, prompt_strategy="interleave", chronological_prefix=True, data_frac=1, data_size=None, delete_system_prompt=False, last_image=False, print_prompt=False, **kwargs ): for k, v in kwargs.items(): print("WARNING: Unused argument:", k, v) try: with open(dataset_path) as f: data = json.load(f) except: data = [] with open(dataset_path) as f: for line in f: question = json.loads(line) question["id"] = question["question_id"] question["conversations"] = [ {"value": "This is a satellite image: