SYMBOL INDEX (183 symbols across 25 files) FILE: GOT-OCR-2.0-master/GOT/data/__init__.py class DataCollatorForSupervisedDataset (line 10) | class DataCollatorForSupervisedDataset(object): method __call__ (line 13) | def __call__(self, instances): function make_supervised_data_module (line 46) | def make_supervised_data_module(interleave, with_box, tokenizer, data_ar... FILE: GOT-OCR-2.0-master/GOT/data/base_dataset.py class BaseDataset (line 17) | class BaseDataset(Dataset): method __init__ (line 18) | def __init__( method image_processor (line 30) | def image_processor(self, image): method __len__ (line 66) | def __len__(self): method __getitem__ (line 69) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: FILE: GOT-OCR-2.0-master/GOT/data/conversation_dataset_qwen.py class ConversationDataset (line 23) | class ConversationDataset(BaseDataset): method __init__ (line 26) | def __init__(self, datasets, tokenizer, multimodal_cfg): method multimodal_processor (line 71) | def multimodal_processor(self, sources, flag_num_patches): method _tokenize_fn (line 85) | def _tokenize_fn(self, strings): method _mask_targets (line 110) | def _mask_targets(self, target, tokenized_lens, speakers): method token_processor (line 120) | def token_processor(self, sources, image_name): method __getitem__ (line 195) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: FILE: GOT-OCR-2.0-master/GOT/demo/process_results.py function svg_to_html (line 12) | def svg_to_html(svg_content, output_filename): FILE: GOT-OCR-2.0-master/GOT/demo/run_ocr_2.0.py function load_image (line 35) | def load_image(image_file): function eval_model (line 44) | def eval_model(args): FILE: GOT-OCR-2.0-master/GOT/demo/run_ocr_2.0_crop.py function load_image (line 32) | def load_image(image_file): function find_closest_aspect_ratio (line 40) | def find_closest_aspect_ratio(aspect_ratio, target_ratios, width, height... function dynamic_preprocess (line 57) | def dynamic_preprocess(image, min_num=1, max_num=6, image_size=1024, use... function eval_model (line 99) | def eval_model(args): FILE: GOT-OCR-2.0-master/GOT/eval/eval_GOT_ocr.py function load_image (line 49) | def load_image(image_file): function find_closest_aspect_ratio (line 58) | def find_closest_aspect_ratio(aspect_ratio, target_ratios, width, height... function dynamic_preprocess (line 75) | def dynamic_preprocess(image, min_num=1, max_num=6, image_size=1024, use... function split_list (line 119) | def split_list(lst, n): function get_chunk (line 125) | def get_chunk(lst, n, k): function eval_model (line 133) | def eval_model(args): FILE: GOT-OCR-2.0-master/GOT/eval/multi_hardware_eval_GOT.py function run_eval (line 8) | def run_eval(chunk_id, model_name, gtfile_path, image_path, out_path, nu... FILE: GOT-OCR-2.0-master/GOT/eval/pyevaltools/eval_ocr.py function preprocess (line 27) | def preprocess(text, predict_root_): function contain_chinese_string (line 33) | def contain_chinese_string(text): function split_text (line 43) | def split_text(pages, a_type): function nougat_per_metrics (line 64) | def nougat_per_metrics(predict_root_, pred, gt, minlen=1, heavy_mode: in... function doc_formated_text_eval (line 106) | def doc_formated_text_eval(gt_root_, predict_root_, datatype): function doc_text_eval (line 182) | def doc_text_eval(gt_root_, predict_root_, datatype): FILE: GOT-OCR-2.0-master/GOT/eval/pyevaltools/eval_ocr_format.py function preprocess (line 27) | def preprocess(text, predict_root_): function contain_chinese_string (line 33) | def contain_chinese_string(text): function split_text (line 43) | def split_text(pages, a_type): function nougat_per_metrics (line 64) | def nougat_per_metrics(predict_root_, pred, gt, minlen=1, heavy_mode: in... function doc_formated_text_eval (line 106) | def doc_formated_text_eval(gt_root_, predict_root_, datatype): function doc_text_eval (line 182) | def doc_text_eval(gt_root_, predict_root_, datatype): FILE: GOT-OCR-2.0-master/GOT/eval/pyevaltools/eval_ocr_scene.py function preprocess (line 20) | def preprocess(text, predict_root_): function contain_chinese_string (line 26) | def contain_chinese_string(text): function nougat_per_metrics (line 30) | def nougat_per_metrics(predict_root_, pred, gt, minlen=1): function doc_text_eval (line 54) | def doc_text_eval(gt_root_, predict_root_, datatype): FILE: GOT-OCR-2.0-master/GOT/eval/pyevaltools/merge_results.py function merge_outputs (line 5) | def merge_outputs(out_path): FILE: GOT-OCR-2.0-master/GOT/model/GOT_ocr_2_0.py class GOTConfig (line 15) | class GOTConfig(Qwen2Config): class GOTQwenModel (line 19) | class GOTQwenModel(Qwen2Model): method __init__ (line 22) | def __init__(self, config: Qwen2Config): method initialize_vision_modules (line 30) | def initialize_vision_modules( method forward (line 73) | def forward( class GOTQwenForCausalLM (line 208) | class GOTQwenForCausalLM(Qwen2ForCausalLM): method __init__ (line 212) | def __init__(self, config): method get_model (line 222) | def get_model(self): method forward (line 230) | def forward( method prepare_inputs_for_generation (line 304) | def prepare_inputs_for_generation( method initialize_vision_tokenizer (line 362) | def initialize_vision_tokenizer( FILE: GOT-OCR-2.0-master/GOT/model/plug/blip_process.py class BaseProcessor (line 18) | class BaseProcessor: method __init__ (line 19) | def __init__(self): method __call__ (line 23) | def __call__(self, item): class BlipImageBaseProcessor (line 35) | class BlipImageBaseProcessor(BaseProcessor): method __init__ (line 36) | def __init__(self, mean=None, std=None): function identity_func (line 48) | def identity_func(img): function autocontrast_func (line 52) | def autocontrast_func(img, cutoff=0): function equalize_func (line 85) | def equalize_func(img): function rotate_func (line 109) | def rotate_func(img, degree, fill=(0, 0, 0)): function solarize_func (line 120) | def solarize_func(img, thresh=128): function color_func (line 130) | def color_func(img, factor): function contrast_func (line 148) | def contrast_func(img, factor): function brightness_func (line 162) | def brightness_func(img, factor): function sharpness_func (line 171) | def sharpness_func(img, factor): function shear_x_func (line 192) | def shear_x_func(img, factor, fill=(0, 0, 0)): function translate_x_func (line 201) | def translate_x_func(img, offset, fill=(0, 0, 0)): function translate_y_func (line 213) | def translate_y_func(img, offset, fill=(0, 0, 0)): function posterize_func (line 225) | def posterize_func(img, bits): function shear_y_func (line 233) | def shear_y_func(img, factor, fill=(0, 0, 0)): function cutout_func (line 242) | def cutout_func(img, pad_size, replace=(0, 0, 0)): function enhance_level_to_args (line 256) | def enhance_level_to_args(MAX_LEVEL): function shear_level_to_args (line 263) | def shear_level_to_args(MAX_LEVEL, replace_value): function translate_level_to_args (line 273) | def translate_level_to_args(translate_const, MAX_LEVEL, replace_value): function cutout_level_to_args (line 283) | def cutout_level_to_args(cutout_const, MAX_LEVEL, replace_value): function solarize_level_to_args (line 291) | def solarize_level_to_args(MAX_LEVEL): function none_level_to_args (line 299) | def none_level_to_args(level): function posterize_level_to_args (line 303) | def posterize_level_to_args(MAX_LEVEL): function rotate_level_to_args (line 311) | def rotate_level_to_args(MAX_LEVEL, replace_value): class RandomAugment (line 359) | class RandomAugment(object): method __init__ (line 360) | def __init__(self, N=2, M=10, isPIL=False, augs=[]): method get_random_ops (line 369) | def get_random_ops(self): method __call__ (line 373) | def __call__(self, img): class VideoRandomAugment (line 385) | class VideoRandomAugment(object): method __init__ (line 386) | def __init__(self, N=2, M=10, p=0.0, tensor_in_tensor_out=True, augs=[]): method get_random_ops (line 396) | def get_random_ops(self): method __call__ (line 400) | def __call__(self, frames): method _aug (line 419) | def _aug(self, img, ops, apply_or_not): class BlipImageTrainProcessor (line 438) | class BlipImageTrainProcessor(BlipImageBaseProcessor): method __init__ (line 439) | def __init__( method __call__ (line 474) | def __call__(self, item): class BlipImageEvalProcessor (line 478) | class BlipImageEvalProcessor(BlipImageBaseProcessor): method __init__ (line 479) | def __init__(self, image_size=384, mean=None, std=None): method __call__ (line 492) | def __call__(self, item): FILE: GOT-OCR-2.0-master/GOT/model/vision_encoder/vary_b.py class Projector (line 24) | class Projector(nn.Module): method __init__ (line 25) | def __init__( method forward (line 45) | def forward(self, x: torch.Tensor): class MLPBlock (line 53) | class MLPBlock(nn.Module): method __init__ (line 54) | def __init__( method forward (line 65) | def forward(self, x: torch.Tensor) -> torch.Tensor: class LayerNorm2d (line 71) | class LayerNorm2d(nn.Module): method __init__ (line 72) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 78) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ImageEncoderViT (line 87) | class ImageEncoderViT(nn.Module): method __init__ (line 88) | def __init__( method forward (line 180) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Block (line 196) | class Block(nn.Module): method __init__ (line 199) | def __init__( method forward (line 243) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Attention (line 262) | class Attention(nn.Module): method __init__ (line 265) | def __init__( method forward (line 301) | def forward(self, x: torch.Tensor) -> torch.Tensor: function window_partition (line 320) | def window_partition(x: torch.Tensor, window_size: int) -> Tuple[torch.T... function window_unpartition (line 344) | def window_unpartition( function get_rel_pos (line 369) | def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torc... function add_decomposed_rel_pos (line 402) | def add_decomposed_rel_pos( class PatchEmbed (line 441) | class PatchEmbed(nn.Module): method __init__ (line 446) | def __init__( method forward (line 468) | def forward(self, x: torch.Tensor) -> torch.Tensor: function build_vary_vit_b (line 476) | def build_vary_vit_b(checkpoint=None): function _build_vary (line 486) | def _build_vary( FILE: GOT-OCR-2.0-master/GOT/train/train.py function train (line 33) | def train(): FILE: GOT-OCR-2.0-master/GOT/train/train_GOT.py function train (line 38) | def train(): FILE: GOT-OCR-2.0-master/GOT/train/train_lora.py function train (line 45) | def train(): FILE: GOT-OCR-2.0-master/GOT/train/trainer.py function unwrap_model (line 9) | def unwrap_model(model: nn.Module) -> nn.Module: class GOTTrainer (line 23) | class GOTTrainer(Trainer): method _safe_save (line 25) | def _safe_save(self, output_dir: str): method _save (line 42) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: GOT-OCR-2.0-master/GOT/train/trainer_llm_llrd.py function lr_scale_func (line 28) | def lr_scale_func(key): function get_param_groups (line 45) | def get_param_groups(model, no_weight_decay_cond, scale_lr_cond): function unwrap_model (line 104) | def unwrap_model(model: nn.Module) -> nn.Module: class GOTTrainer (line 118) | class GOTTrainer(Trainer): method _safe_save (line 120) | def _safe_save(self, output_dir: str): method _save (line 132) | def _save(self, output_dir: Optional[str] = None, state_dict=None): method create_optimizer (line 158) | def create_optimizer(self): method _wrap_model (line 193) | def _wrap_model(self, model, training=True, dataloader=None): FILE: GOT-OCR-2.0-master/GOT/train/trainer_vit_fixlr.py function unwrap_model (line 11) | def unwrap_model(model: nn.Module) -> nn.Module: class GOTTrainer (line 25) | class GOTTrainer(Trainer): method _safe_save (line 27) | def _safe_save(self, output_dir: str): method _save (line 39) | def _save(self, output_dir: Optional[str] = None, state_dict=None): method create_optimizer (line 65) | def create_optimizer(self): FILE: GOT-OCR-2.0-master/GOT/train/trainer_vit_llrd.py function lr_scale_func (line 28) | def lr_scale_func(key): function get_param_groups (line 42) | def get_param_groups(model, no_weight_decay_cond, scale_lr_cond, lr, wd): function unwrap_model (line 101) | def unwrap_model(model: nn.Module) -> nn.Module: class GOTTrainer (line 115) | class GOTTrainer(Trainer): method _safe_save (line 117) | def _safe_save(self, output_dir: str): method _save (line 129) | def _save(self, output_dir: Optional[str] = None, state_dict=None): method create_optimizer (line 155) | def create_optimizer(self): method _wrap_model (line 190) | def _wrap_model(self, model, training=True, dataloader=None): FILE: GOT-OCR-2.0-master/GOT/utils/arguments.py class ModelArguments (line 7) | class ModelArguments: class DataArguments (line 19) | class DataArguments: class TrainingArguments (line 34) | class TrainingArguments(transformers.TrainingArguments): FILE: GOT-OCR-2.0-master/GOT/utils/conversation.py class SeparatorStyle (line 6) | class SeparatorStyle(Enum): class Conversation (line 43) | class Conversation: method get_prompt (line 56) | def get_prompt(self): method append_message (line 113) | def append_message(self, role, message): method get_images (line 116) | def get_images(self, return_pil=False): method to_gradio_chatbot (line 167) | def to_gradio_chatbot(self): method copy (line 197) | def copy(self): method dict (line 207) | def dict(self): FILE: GOT-OCR-2.0-master/GOT/utils/utils.py function build_logger (line 18) | def build_logger(logger_name, logger_filename): class StreamToLogger (line 61) | class StreamToLogger(object): method __init__ (line 65) | def __init__(self, logger, log_level=logging.INFO): method __getattr__ (line 71) | def __getattr__(self, attr): method write (line 74) | def write(self, buf): method flush (line 88) | def flush(self): function disable_torch_init (line 94) | def disable_torch_init(): function violates_moderation (line 103) | def violates_moderation(text): function pretty_print_semaphore (line 124) | def pretty_print_semaphore(semaphore): class KeywordsStoppingCriteria (line 130) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 131) | def __init__(self, keywords, tokenizer, input_ids): method __call__ (line 139) | def __call__(self, output_ids: torch.LongTensor, scores: torch.FloatTe... function smart_tokenizer_and_embedding_resize (line 153) | def smart_tokenizer_and_embedding_resize(special_tokens_dict, tokenizer,... function maybe_zero_3 (line 179) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 194) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 219) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function find_all_linear_names (line 227) | def find_all_linear_names(model):