text
stringlengths
1
93.6k
"help": "The dropout probability used in the models"
}
)
@dataclass
class QuestionAnwseringArguments:
n_best_size: int = field(
default=20,
metadata={"help": "The total number of n-best predictions to generate when looking for an answer."},
)
max_answer_length: int = field(
default=30,
metadata={
"help": "The maximum length of an answer that can be generated. This is needed because the start "
"and end predictions are not conditioned on one another."
},
)
version_2_with_negative: bool = field(
default=False, metadata={"help": "If true, some of the examples do not have an answer."}
)
null_score_diff_threshold: float = field(
default=0.0,
metadata={
"help": "The threshold used to select the null answer: if the best answer has a score that is less than "
"the score of the null answer minus this threshold, the null answer is selected for this example. "
"Only useful when `version_2_with_negative=True`."
},
)
def get_args():
"""Parse all the args."""
parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments, QuestionAnwseringArguments))
args = parser.parse_args_into_dataclasses()
return args
# <FILESEP>
from PyQt5.QtWidgets import QApplication, QMainWindow
from pyqt_custom_titlebar_window.customTitlebarWindow import CustomTitlebarWindow
from sample.fontWidget import FontWidget
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle('Main Window')
menu = self.menuBar()
menu.addAction('File')
menu.addAction('Edit')
menu.addAction('View')
menu.addAction('Help')
self.setMenuBar(menu)
self.__fontWidget = FontWidget()
self.setCentralWidget(self.__fontWidget)
# Example menubar
def getFontWidget(self):
return self.__fontWidget
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
window = MainWindow()
customTitlebarWindow = CustomTitlebarWindow(window)
customTitlebarWindow.setMenuAsTitleBar(icon_filename='icon.svg')
customTitlebarWindow.setButtonHint(hint=['fix', 'close'])
customTitlebarWindow.setButtons()
customTitlebarWindow.show()
app.exec_()
# <FILESEP>
"""
YouTubeVOS has a label structure that is more complicated than DAVIS
Labels might not appear on the first frame (there might be no labels at all in the first frame)
Labels might not even appear on the same frame (i.e. Object 0 at frame 10, and object 1 at frame 15)
0 does not mean background -- it is simply "no-label"
and object indices might not be in order, there are missing indices somewhere in the validation set
Dealing with these makes the logic a bit convoluted here
It is not necessarily hacky but do understand that it is not as straightforward as DAVIS
Validation set only.
"""
import os
from os import path
import time
from argparse import ArgumentParser
import torch
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
import numpy as np
from PIL import Image
from model.eval_network import PropagationNetwork
from dataset.yv_test_dataset import YouTubeVOSTestDataset