SYMBOL INDEX (2527 symbols across 220 files) FILE: a2f.py function get_part_wav (line 31) | def get_part_wav(sound, start_time, end_time, part_wav_path): function crop_wav (line 41) | def crop_wav(path, crop_len): function process_chunk (line 62) | def process_chunk(model, chunk, detect_language): function speech_recognition (line 78) | def speech_recognition(inputs, model,stream_model=False,detect_language=... function mic_audio (line 130) | def mic_audio(record_file="record.wav"): function tts_send (line 163) | async def tts_send(text,onmiverse=False,send_file='voice_dir/send_a2f.wa... function tts_a2f (line 209) | async def tts_a2f(text): function push_stream (line 228) | def push_stream(url,player,dir="voice_dir/send_omniverse.wav"): function audio_synthesis (line 246) | def audio_synthesis(gpt_replying_buffer,url,player): function process_send_stream (line 250) | def process_send_stream(gpt_replying_buffer,url,player): function receive_max (line 258) | def receive_max(q,Text): function send_stream2 (line 281) | def send_stream2(q): function audio_chatbot (line 319) | def audio_chatbot(text): FILE: app.py function toggle_operation (line 59) | def toggle_operation(flag): function sadtalker_demo (line 80) | async def sadtalker_demo(checkpoint_path,config_path,source_image, function train_visualGLM (line 104) | def train_visualGLM(name,model_size,mode,train_iters,resume_data, function start_finetuning_process (line 128) | def start_finetuning_process(gpt_option,model_args,method_type): function load_speech_model (line 186) | async def load_speech_model(asr_method,tts_method): function save_text2img_data (line 209) | def save_text2img_data(prompt,label,img_name,zh_select): function load_auto_backend_models (line 222) | async def load_auto_backend_models(lama, sam, det,tag2text,ram, trans_zh... function load_auto_backend_model (line 234) | def load_auto_backend_model(lama,sam,det,tag2text,ram,trans_zh,visual_gl... function Auto_run (line 304) | def Auto_run( function visual_chat (line 517) | def visual_chat(prompt_input, temperature, top_p, image_prompt, result_t... function clear_fn_image (line 534) | def clear_fn_image(value): function t2s (line 725) | def t2s(text,method): function s2t (line 734) | def s2t(speech_file,stream_mode=False): function fn_area_visibility (line 830) | def fn_area_visibility(a): function on_md_dropdown_changed (line 859) | def on_md_dropdown_changed(k): function on_dropdown_changed (line 900) | def on_dropdown_changed(k): function on_md_dropdown_changed (line 909) | def on_md_dropdown_changed(k): function route (line 913) | def route(request: gr.Request, k, *args, **kwargs): function auto_opentab_delay (line 937) | def auto_opentab_delay(port=7586): FILE: audio2face_pb2_grpc.py class Audio2FaceStub (line 8) | class Audio2FaceStub(object): method __init__ (line 11) | def __init__(self, channel): class Audio2FaceServicer (line 29) | class Audio2FaceServicer(object): method PushAudio (line 32) | def PushAudio(self, request, context): method PushAudioStream (line 38) | def PushAudioStream(self, request_iterator, context): function add_Audio2FaceServicer_to_server (line 45) | def add_Audio2FaceServicer_to_server(servicer, server): class Audio2Face (line 63) | class Audio2Face(object): method PushAudio (line 67) | def PushAudio( method PushAudioStream (line 96) | def PushAudioStream( FILE: audio2face_streaming_utils.py function push_audio_track (line 22) | def push_audio_track(url, audio_data, samplerate, instance_name): function push_audio_track_stream (line 50) | def push_audio_track_stream(url, audio_data, samplerate, instance_name): function push_stream (line 95) | def push_stream(url, audio_data, samplerate, instance_name): FILE: audio_segment.py function crop_audio (line 8) | def crop_audio(file_path, start_time, end_time): function split_audio_file (line 19) | def split_audio_file(file_path, output_path, segment_time=3000): function audio_processing (line 37) | def audio_processing(file_path, output_path, label): FILE: auto_label_demo.py function save_text2img_data (line 45) | def save_text2img_data(output_dir, prompt,label,img_name): function load_auto_backend_models (line 55) | def load_auto_backend_models(opt): function Auto_run (line 74) | def Auto_run(weights=ROOT / '', # model.pt path(s) function run_do (line 262) | def run_do(shared_args,process_name=0): function parse_opt (line 266) | def parse_opt(): function main (line 314) | def main(opt): FILE: crazy_functions/Langchain知识库.py function 知识库问答 (line 7) | def 知识库问答(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_promp... function 读取知识库作答 (line 77) | def 读取知识库作答(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pro... FILE: crazy_functions/Latex全文润色.py class PaperFileGroup (line 5) | class PaperFileGroup(): method __init__ (line 6) | def __init__(self): method run_file_split (line 19) | def run_file_split(self, max_token_limit=1900): method merge_result (line 37) | def merge_result(self): method write_result (line 42) | def write_result(self): method zip_result (line 50) | def zip_result(self): function 多文件润色 (line 57) | def 多文件润色(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chat... function Latex英文润色 (line 136) | def Latex英文润色(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_p... function Latex中文润色 (line 174) | def Latex中文润色(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_p... function Latex英文纠错 (line 210) | def Latex英文纠错(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_p... FILE: crazy_functions/Latex全文翻译.py class PaperFileGroup (line 5) | class PaperFileGroup(): method __init__ (line 6) | def __init__(self): method run_file_split (line 19) | def run_file_split(self, max_token_limit=1900): function 多文件翻译 (line 38) | def 多文件翻译(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chat... function Latex英译中 (line 108) | def Latex英译中(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pr... function Latex中译英 (line 145) | def Latex中译英(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pr... FILE: crazy_functions/Latex输出PDF结果.py function switch_prompt (line 10) | def switch_prompt(pfg, mode, more_requirement): function desend_to_extracted_folder_if_exist (line 38) | def desend_to_extracted_folder_if_exist(project_folder): function move_project (line 53) | def move_project(project_folder, arxiv_id=None): function arxiv_download (line 82) | def arxiv_download(chatbot, history, txt): function Latex英文纠错加PDF对比 (line 145) | def Latex英文纠错加PDF对比(txt, llm_kwargs, plugin_kwargs, chatbot, history, sy... function Latex翻译中文并重新编译PDF (line 221) | def Latex翻译中文并重新编译PDF(txt, llm_kwargs, plugin_kwargs, chatbot, history, ... FILE: crazy_functions/chatglm微调工具.py function fetch_items (line 5) | def fetch_items(list_of_items, batch_size): function string_to_options (line 9) | def string_to_options(arguments): function 微调数据集生成 (line 35) | def 微调数据集生成(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pro... function 启动微调 (line 83) | def 启动微调(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt... FILE: crazy_functions/crazy_functions_test.py function validate_path (line 9) | def validate_path(): function silence_stdout (line 43) | def silence_stdout(func): class CLI_Printer (line 56) | class CLI_Printer(): method __init__ (line 57) | def __init__(self) -> None: method print (line 60) | def print(self, buf): function test_解析一个Python项目 (line 78) | def test_解析一个Python项目(): function test_解析一个Cpp项目 (line 84) | def test_解析一个Cpp项目(): function test_Latex英文润色 (line 90) | def test_Latex英文润色(): function test_Markdown中译英 (line 96) | def test_Markdown中译英(): function test_批量翻译PDF文档 (line 102) | def test_批量翻译PDF文档(): function test_谷歌检索小助手 (line 108) | def test_谷歌检索小助手(): function test_总结word文档 (line 114) | def test_总结word文档(): function test_下载arxiv论文并翻译摘要 (line 120) | def test_下载arxiv论文并翻译摘要(): function test_联网回答问题 (line 126) | def test_联网回答问题(): function test_解析ipynb文件 (line 139) | def test_解析ipynb文件(): function test_数学动画生成manim (line 146) | def test_数学动画生成manim(): function test_Markdown多语言 (line 154) | def test_Markdown多语言(): function test_Langchain知识库 (line 163) | def test_Langchain知识库(): function test_Langchain知识库读取 (line 176) | def test_Langchain知识库读取(): function test_Latex (line 182) | def test_Latex(): function test_chatglm_finetune (line 217) | def test_chatglm_finetune(): FILE: crazy_functions/crazy_utils.py function input_clipping (line 4) | def input_clipping(inputs, history, max_token_limit): function request_gpt_model_in_new_thread_with_ui_alive (line 38) | def request_gpt_model_in_new_thread_with_ui_alive( function can_multi_process (line 133) | def can_multi_process(llm): function request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency (line 139) | def request_gpt_model_multi_threads_with_very_awesome_ui_and_high_effici... function breakdown_txt_to_satisfy_token_limit (line 306) | def breakdown_txt_to_satisfy_token_limit(txt, get_token_fn, limit): function force_breakdown (line 336) | def force_breakdown(txt, limit, get_token_fn): function breakdown_txt_to_satisfy_token_limit_for_pdf (line 345) | def breakdown_txt_to_satisfy_token_limit_for_pdf(txt, get_token_fn, limit): function read_and_clean_pdf_text (line 396) | def read_and_clean_pdf_text(fp): function get_files_from_everything (line 574) | def get_files_from_everything(txt, type): # type='.md' function Singleton (line 619) | def Singleton(cls): class knowledge_archive_interface (line 631) | class knowledge_archive_interface(): method __init__ (line 632) | def __init__(self) -> None: method get_chinese_text2vec (line 639) | def get_chinese_text2vec(self): method feed_archive (line 651) | def feed_archive(self, file_manifest, id="default"): method get_current_archive_id (line 667) | def get_current_archive_id(self): method get_loaded_file (line 670) | def get_loaded_file(self): method answer_with_archive_by_id (line 673) | def answer_with_archive_by_id(self, txt, id): function try_install_deps (line 702) | def try_install_deps(deps): class construct_html (line 715) | class construct_html(): method __init__ (line 716) | def __init__(self) -> None: method add_row (line 744) | def add_row(self, a, b): method save_file (line 757) | def save_file(self, file_name): FILE: crazy_functions/latex_fns/latex_actions.py function split_subprocess (line 15) | def split_subprocess(txt, project_folder, return_dict, opts): class LatexPaperSplit (line 80) | class LatexPaperSplit(): method __init__ (line 86) | def __init__(self) -> None: method merge_result (line 95) | def merge_result(self, arr, mode, msg, buggy_lines=[], buggy_line_surg... method split (line 135) | def split(self, txt, project_folder, opts): class LatexPaperFileGroup (line 156) | class LatexPaperFileGroup(): method __init__ (line 160) | def __init__(self): method run_file_split (line 173) | def run_file_split(self, max_token_limit=1900): method merge_result (line 191) | def merge_result(self): method write_result (line 196) | def write_result(self): function Latex精细分解与转化 (line 205) | def Latex精细分解与转化(file_manifest, project_folder, llm_kwargs, plugin_kwarg... function remove_buggy_lines (line 299) | def remove_buggy_lines(file_path, log_path, tex_name, tex_name_pure, n_f... function 编译Latex (line 326) | def 编译Latex(chatbot, history, main_file_original, main_file_modified, wo... function write_html (line 422) | def write_html(sp_file_contents, sp_file_result, chatbot, project_folder): FILE: crazy_functions/latex_fns/latex_toolbox.py class LinkedListNode (line 9) | class LinkedListNode(): method __init__ (line 13) | def __init__(self, string, preserve=True) -> None: function convert_to_linklist (line 21) | def convert_to_linklist(text, mask): function post_process (line 34) | def post_process(root): function set_forbidden_text (line 127) | def set_forbidden_text(text, mask, pattern, flags=0): function reverse_forbidden_text (line 140) | def reverse_forbidden_text(text, mask, pattern, flags=0, forbid_wrapper=... function set_forbidden_text_careful_brace (line 158) | def set_forbidden_text_careful_brace(text, mask, pattern, flags=0): function reverse_forbidden_text_careful_brace (line 178) | def reverse_forbidden_text_careful_brace(text, mask, pattern, flags=0, f... function set_forbidden_text_begin_end (line 201) | def set_forbidden_text_begin_end(text, mask, pattern, flags=0, limit_n_l... function find_main_tex_file (line 230) | def find_main_tex_file(file_manifest, mode): function rm_comments (line 268) | def rm_comments(main_file): function find_tex_file_ignore_case (line 281) | def find_tex_file_ignore_case(fp): function merge_tex_files_ (line 293) | def merge_tex_files_(project_foler, main_file, mode): function merge_tex_files (line 310) | def merge_tex_files(project_foler, main_file, mode): function mod_inbraket (line 346) | def mod_inbraket(match): function fix_content (line 359) | def fix_content(final_tex, node_string): function compile_latex_with_timeout (line 407) | def compile_latex_with_timeout(command, cwd, timeout=60): function merge_pdfs (line 421) | def merge_pdfs(pdf1_path, pdf2_path, output_path): FILE: crazy_functions/live_audio/aliyunASR.py class AliyunASR (line 4) | class AliyunASR(): method test_on_sentence_begin (line 6) | def test_on_sentence_begin(self, message, *args): method test_on_sentence_end (line 10) | def test_on_sentence_end(self, message, *args): method test_on_start (line 17) | def test_on_start(self, message, *args): method test_on_error (line 21) | def test_on_error(self, message, *args): method test_on_close (line 25) | def test_on_close(self, *args): method test_on_result_chg (line 29) | def test_on_result_chg(self, message, *args): method test_on_completed (line 35) | def test_on_completed(self, message, *args): method audio_convertion_thread (line 40) | def audio_convertion_thread(self, uuid): method get_token (line 97) | def get_token(self): FILE: crazy_functions/live_audio/audio_io.py function Singleton (line 4) | def Singleton(cls): class RealtimeAudioDistribution (line 16) | class RealtimeAudioDistribution(): method __init__ (line 17) | def __init__(self) -> None: method clean_up (line 22) | def clean_up(self): method feed (line 25) | def feed(self, uuid, audio): method read (line 35) | def read(self, uuid): function change_sample_rate (line 43) | def change_sample_rate(audio, old_sr, new_sr): FILE: crazy_functions/test_project/cpp/cppipc/buffer.cpp type ipc (line 6) | namespace ipc { class buffer::buffer_ (line 16) | class buffer::buffer_ : public pimpl { method buffer_ (line 23) | buffer_(void* p, std::size_t s, buffer::destructor_t d, void* a) function buffer (line 66) | buffer& buffer::operator=(buffer rhs) { FILE: crazy_functions/test_project/cpp/cppipc/ipc.cpp type msg_t (line 37) | struct msg_t method msg_t (line 51) | msg_t() = default; method msg_t (line 52) | msg_t(msg_id_t cc_id, msg_id_t id, std::int32_t remain, void const * d... type msg_t<0, AlignSize> (line 40) | struct msg_t<0, AlignSize> { type msg_t (line 48) | struct msg_t : msg_t<0, AlignSize> { method msg_t (line 51) | msg_t() = default; method msg_t (line 52) | msg_t(msg_id_t cc_id, msg_id_t id, std::int32_t remain, void const * d... function make_cache (line 66) | ipc::buff_t make_cache(T& data, std::size_t size) { type cache_t (line 72) | struct cache_t { method cache_t (line 76) | cache_t(std::size_t f, ipc::buff_t && b) method append (line 80) | void append(void const * data, std::size_t size) { function cc_acc (line 88) | auto cc_acc() { function IPC_CONSTEXPR_ (line 93) | IPC_CONSTEXPR_ std::size_t align_chunk_size(std::size_t size) noexcept { function IPC_CONSTEXPR_ (line 97) | IPC_CONSTEXPR_ std::size_t calc_chunk_size(std::size_t size) noexcept { type chunk_t (line 102) | struct chunk_t { type chunk_info_t (line 113) | struct chunk_info_t { function chunk_t (line 125) | chunk_t *at(std::size_t chunk_size, ipc::storage_id_t id) noexcept { class chunk_handle_t (line 132) | class chunk_handle_t { method chunk_info_t (line 136) | chunk_info_t *get_info(std::size_t chunk_size) { function chunk_info_t (line 155) | chunk_info_t *chunk_storage_info(std::size_t chunk_size) { function acquire_storage (line 171) | std::pair acquire_storage(std::size_t size, ip... function release_storage (line 199) | void release_storage(ipc::storage_id_t id, std::size_t size) { function sub_rc (line 213) | bool sub_rc(ipc::wr, function sub_rc (line 219) | bool sub_rc(ipc::wr, function recycle_storage (line 232) | void recycle_storage(ipc::storage_id_t id, std::size_t size, ipc::circ::... function clear_message (line 253) | bool clear_message(void* p) { type conn_info_head (line 268) | struct conn_info_head { method conn_info_head (line 275) | conn_info_head(char const * name) method quit_waiting (line 284) | void quit_waiting() { method acc (line 290) | auto acc() { function wait_for (line 301) | bool wait_for(W& waiter, F&& pred, std::uint64_t tm) { type queue_generator (line 318) | struct queue_generator { type conn_info_t (line 322) | struct conn_info_t : conn_info_head { method conn_info_t (line 325) | conn_info_t(char const * name) method disconnect_receiver (line 332) | void disconnect_receiver() { type detail_impl (line 343) | struct detail_impl { method conn_info_t (line 350) | constexpr static conn_info_t* info_of(ipc::handle_t h) noexcept { method queue_t (line 354) | constexpr static queue_t* queue_of(ipc::handle_t h) noexcept { method disconnect (line 360) | static void disconnect(ipc::handle_t h) { method reconnect (line 370) | static bool reconnect(ipc::handle_t * ph, bool start_to_recv) { method connect (line 392) | static bool connect(ipc::handle_t * ph, char const * name, bool start_... method destroy (line 400) | static void destroy(ipc::handle_t h) { method recv_count (line 405) | static std::size_t recv_count(ipc::handle_t h) noexcept { method wait_for_recv (line 413) | static bool wait_for_recv(ipc::handle_t h, std::size_t r_count, std::u... method send (line 424) | static bool send(F&& gen_push, ipc::handle_t h, void const * data, std... method send (line 486) | static bool send(ipc::handle_t h, void const * data, std::size_t size,... method try_send (line 507) | static bool try_send(ipc::handle_t h, void const * data, std::size_t s... method recv (line 523) | static ipc::buff_t recv(ipc::handle_t h, std::uint64_t tm) { method try_recv (line 620) | static ipc::buff_t try_recv(ipc::handle_t h) { type ipc (line 631) | namespace ipc { function buff_t (line 681) | buff_t chan_impl::recv(ipc::handle_t h, std::uint64_t tm) { function buff_t (line 691) | buff_t chan_impl::try_recv(ipc::handle_t h) { type chan_impl> (line 695) | struct chan_impl> type chan_impl> (line 698) | struct chan_impl> type chan_impl> (line 699) | struct chan_impl> FILE: crazy_functions/test_project/cpp/cppipc/policy.h function namespace (line 10) | namespace ipc { FILE: crazy_functions/test_project/cpp/cppipc/pool_alloc.cpp type ipc (line 5) | namespace ipc { type mem (line 6) | namespace mem { FILE: crazy_functions/test_project/cpp/cppipc/prod_cons.h function namespace (line 16) | namespace ipc { type elem_t (line 112) | struct elem_t { type rc_t (line 200) | enum : rc_t { type elem_t (line 206) | struct elem_t { function rc_t (line 212) | alignas(cache_line_size) rc_t epoch_ { 0 }; // only one writer type rc_t (line 298) | enum : rc_t { type elem_t (line 307) | struct elem_t { function std (line 314) | alignas(cache_line_size) std::atomic epoch_ { 0 }; FILE: crazy_functions/test_project/cpp/cppipc/queue.h function namespace (line 22) | namespace ipc { function pop (line 206) | bool pop(T& item) { FILE: crazy_functions/test_project/cpp/cppipc/shm.cpp type ipc (line 10) | namespace ipc { type shm (line 11) | namespace shm { class handle::handle_ (line 13) | class handle::handle_ : public pimpl { function handle (line 45) | handle& handle::operator=(handle rhs) { function id_t (line 93) | id_t handle::detach() { FILE: crazy_functions/test_project/cpp/cppipc/waiter.h function IPC_UNUSED_ (line 56) | IPC_UNUSED_ std::lock_guard guard {lock_}; function notify (line 66) | bool notify() noexcept { FILE: crazy_functions/test_project/cpp/libJPG/jpgd.cpp type jpgd (line 34) | namespace jpgd { function jpgd_free (line 37) | static inline void jpgd_free(void *p) { FMemory::Free(p); } type ERGBFormatJPG (line 42) | enum ERGBFormatJPG type JPEG_MARKER (line 55) | enum JPEG_MARKER type JPEG_SUBSAMPLING (line 64) | enum JPEG_SUBSAMPLING { JPGD_GRAYSCALE = 0, JPGD_YH1V1, JPGD_YH2V1, JP... type Row (line 92) | struct Row method idct (line 94) | static void idct(int* pTemp, const jpgd_block_t* pSrc) type Row<0> (line 137) | struct Row<0> method idct (line 139) | static void idct(int* pTemp, const jpgd_block_t* pSrc) type Row<1> (line 148) | struct Row<1> method idct (line 150) | static void idct(int* pTemp, const jpgd_block_t* pSrc) type Col (line 167) | struct Col method idct (line 169) | static void idct(uint8* pDst_ptr, const int* pTemp) type Col<1> (line 228) | struct Col<1> method idct (line 230) | static void idct(uint8* pDst_ptr, const int* pTemp) function idct (line 259) | void idct(const jpgd_block_t* pSrc_ptr, uint8* pDst_ptr, int block_max... function idct_4x4 (line 328) | void idct_4x4(const jpgd_block_t* pSrc_ptr, uint8* pDst_ptr) function uint (line 351) | inline uint jpeg_decoder::get_char() function uint (line 378) | inline uint jpeg_decoder::get_char(bool *pPadding_flag) function uint8 (line 411) | inline uint8 jpeg_decoder::get_octet() function uint (line 442) | inline uint jpeg_decoder::get_bits(int num_bits) function uint (line 470) | inline uint jpeg_decoder::get_bits_no_markers(int num_bits) function uint8 (line 586) | inline uint8 jpeg_decoder::clamp(int i) type DCT_Upsample (line 594) | namespace DCT_Upsample type Matrix44 (line 596) | struct Matrix44 method rows (line 603) | inline int rows() const { return NUM_ROWS; } method cols (line 604) | inline int cols() const { return NUM_COLS; } method Element_Type (line 606) | inline const Element_Type & at(int r, int c) const { return v[r][c... method Element_Type (line 607) | inline Element_Type & at(int r, int c) { return v[r][c... method Matrix44 (line 609) | inline Matrix44() { } method Matrix44 (line 611) | inline Matrix44& operator += (const Matrix44& a) method Matrix44 (line 623) | inline Matrix44& operator -= (const Matrix44& a) method Matrix44 (line 635) | inline Matrix44 operator + (const Matrix44& a, const Matrix44& b) method Matrix44 (line 648) | inline Matrix44 operator - (const Matrix44& a, const Matrix44& b) method add_and_store (line 661) | static inline void add_and_store(jpgd_block_t* pDst, const Matrix4... method sub_and_store (line 672) | static inline void sub_and_store(jpgd_block_t* pDst, const Matrix4... type P_Q (line 696) | struct P_Q method calc (line 698) | static void calc(Matrix44& P, Matrix44& Q, const jpgd_block_t* pSrc) type R_S (line 775) | struct R_S method calc (line 777) | static void calc(Matrix44& R, Matrix44& S, const jpgd_block_t* pSrc) function dequantize_ac (line 1775) | static inline int dequantize_ac(int c, int q) { c *= q; return c; } function jpgd_block_t (line 2683) | inline jpgd_block_t *jpeg_decoder::coeff_buf_getp(coeff_buf *cb, int b... FILE: crazy_functions/test_project/cpp/libJPG/jpgd.h function namespace (line 10) | namespace jpgd FILE: crazy_functions/test_project/cpp/libJPG/jpge.cpp type jpge (line 22) | namespace jpge { function jpge_free (line 25) | static inline void jpge_free(void *p) { FMemory::Free(p);; } function clear_obj (line 60) | inline void clear_obj(T &obj) { memset(&obj, 0, sizeof(obj)); } function uint8 (line 63) | static inline uint8 clamp(int i) { if (static_cast(i) > 255U) { ... function RGB_to_YCC (line 65) | static void RGB_to_YCC(uint8* pDst, const uint8 *pSrc, int num_pixels) function RGB_to_Y (line 76) | static void RGB_to_Y(uint8* pDst, const uint8 *pSrc, int num_pixels) function RGBA_to_YCC (line 82) | static void RGBA_to_YCC(uint8* pDst, const uint8 *pSrc, int num_pixels) function RGBA_to_Y (line 93) | static void RGBA_to_Y(uint8* pDst, const uint8 *pSrc, int num_pixels) function Y_to_YCC (line 99) | static void Y_to_YCC(uint8* pDst, const uint8* pSrc, int num_pixels) function DCT2D (line 125) | static void DCT2D(int32 *p) type sym_freq (line 144) | struct sym_freq { uint m_key, m_sym_index; } function sym_freq (line 147) | static inline sym_freq* radix_sort_syms(uint num_syms, sym_freq* pSyms... function calculate_minimum_redundancy (line 167) | static void calculate_minimum_redundancy(sym_freq *A, int n) function huffman_enforce_max_code_size (line 189) | static void huffman_enforce_max_code_size(int *pNum_codes, int code_li... class cfile_stream (line 904) | class cfile_stream : public output_stream method cfile_stream (line 913) | cfile_stream() : m_pFile(NULL), m_bStatus(false) { } method open (line 920) | bool open(const char *pFilename) method close (line 935) | bool close() method put_buf (line 948) | virtual bool put_buf(const void* pBuf, int64_t len) method uint (line 954) | uint get_size() const function compress_image_to_jpeg_file (line 961) | bool compress_image_to_jpeg_file(const char *pFilename, int64_t width,... class memory_stream (line 989) | class memory_stream : public output_stream method memory_stream (line 998) | memory_stream(void *pBuf, uint64_t buf_size) : m_pBuf(static_cast (line 137) | struct Row<0> method idct (line 139) | static void idct(int* pTemp, const jpgd_block_t* pSrc) type Row<1> (line 148) | struct Row<1> method idct (line 150) | static void idct(int* pTemp, const jpgd_block_t* pSrc) type Col (line 167) | struct Col method idct (line 169) | static void idct(uint8* pDst_ptr, const int* pTemp) type Col<1> (line 228) | struct Col<1> method idct (line 230) | static void idct(uint8* pDst_ptr, const int* pTemp) function idct (line 259) | void idct(const jpgd_block_t* pSrc_ptr, uint8* pDst_ptr, int block_max... function idct_4x4 (line 328) | void idct_4x4(const jpgd_block_t* pSrc_ptr, uint8* pDst_ptr) function uint (line 351) | inline uint jpeg_decoder::get_char() function uint (line 378) | inline uint jpeg_decoder::get_char(bool *pPadding_flag) function uint8 (line 411) | inline uint8 jpeg_decoder::get_octet() function uint (line 442) | inline uint jpeg_decoder::get_bits(int num_bits) function uint (line 470) | inline uint jpeg_decoder::get_bits_no_markers(int num_bits) function uint8 (line 586) | inline uint8 jpeg_decoder::clamp(int i) type DCT_Upsample (line 594) | namespace DCT_Upsample type Matrix44 (line 596) | struct Matrix44 method rows (line 603) | inline int rows() const { return NUM_ROWS; } method cols (line 604) | inline int cols() const { return NUM_COLS; } method Element_Type (line 606) | inline const Element_Type & at(int r, int c) const { return v[r][c... method Element_Type (line 607) | inline Element_Type & at(int r, int c) { return v[r][c... method Matrix44 (line 609) | inline Matrix44() { } method Matrix44 (line 611) | inline Matrix44& operator += (const Matrix44& a) method Matrix44 (line 623) | inline Matrix44& operator -= (const Matrix44& a) method Matrix44 (line 635) | inline Matrix44 operator + (const Matrix44& a, const Matrix44& b) method Matrix44 (line 648) | inline Matrix44 operator - (const Matrix44& a, const Matrix44& b) method add_and_store (line 661) | static inline void add_and_store(jpgd_block_t* pDst, const Matrix4... method sub_and_store (line 672) | static inline void sub_and_store(jpgd_block_t* pDst, const Matrix4... type P_Q (line 696) | struct P_Q method calc (line 698) | static void calc(Matrix44& P, Matrix44& Q, const jpgd_block_t* pSrc) type R_S (line 775) | struct R_S method calc (line 777) | static void calc(Matrix44& R, Matrix44& S, const jpgd_block_t* pSrc) function dequantize_ac (line 1775) | static inline int dequantize_ac(int c, int q) { c *= q; return c; } function jpgd_block_t (line 2683) | inline jpgd_block_t *jpeg_decoder::coeff_buf_getp(coeff_buf *cb, int b... FILE: crazy_functions/test_project/cpp/longcode/jpge.cpp type jpge (line 22) | namespace jpge { function jpge_free (line 25) | static inline void jpge_free(void *p) { FMemory::Free(p);; } function clear_obj (line 60) | inline void clear_obj(T &obj) { memset(&obj, 0, sizeof(obj)); } function uint8 (line 63) | static inline uint8 clamp(int i) { if (static_cast(i) > 255U) { ... function RGB_to_YCC (line 65) | static void RGB_to_YCC(uint8* pDst, const uint8 *pSrc, int num_pixels) function RGB_to_Y (line 76) | static void RGB_to_Y(uint8* pDst, const uint8 *pSrc, int num_pixels) function RGBA_to_YCC (line 82) | static void RGBA_to_YCC(uint8* pDst, const uint8 *pSrc, int num_pixels) function RGBA_to_Y (line 93) | static void RGBA_to_Y(uint8* pDst, const uint8 *pSrc, int num_pixels) function Y_to_YCC (line 99) | static void Y_to_YCC(uint8* pDst, const uint8* pSrc, int num_pixels) function DCT2D (line 125) | static void DCT2D(int32 *p) type sym_freq (line 144) | struct sym_freq { uint m_key, m_sym_index; } function sym_freq (line 147) | static inline sym_freq* radix_sort_syms(uint num_syms, sym_freq* pSyms... function calculate_minimum_redundancy (line 167) | static void calculate_minimum_redundancy(sym_freq *A, int n) function huffman_enforce_max_code_size (line 189) | static void huffman_enforce_max_code_size(int *pNum_codes, int code_li... class cfile_stream (line 904) | class cfile_stream : public output_stream method cfile_stream (line 913) | cfile_stream() : m_pFile(NULL), m_bStatus(false) { } method open (line 920) | bool open(const char *pFilename) method close (line 935) | bool close() method put_buf (line 948) | virtual bool put_buf(const void* pBuf, int64_t len) method uint (line 954) | uint get_size() const function compress_image_to_jpeg_file (line 961) | bool compress_image_to_jpeg_file(const char *pFilename, int64_t width,... class memory_stream (line 989) | class memory_stream : public output_stream method memory_stream (line 998) | memory_stream(void *pBuf, uint64_t buf_size) : m_pBuf(static_cast epoch_ { 0 }; FILE: crazy_functions/test_project/python/dqn/dqn.py class DQN (line 16) | class DQN(OffPolicyAlgorithm): method __init__ (line 58) | def __init__( method _setup_model (line 123) | def _setup_model(self) -> None: method _create_aliases (line 130) | def _create_aliases(self) -> None: method _on_step (line 134) | def _on_step(self) -> None: method train (line 145) | def train(self, gradient_steps: int, batch_size: int = 100) -> None: method predict (line 187) | def predict( method learn (line 214) | def learn( method _excluded_save_params (line 239) | def _excluded_save_params(self) -> List[str]: method _get_torch_save_params (line 242) | def _get_torch_save_params(self) -> Tuple[List[str], List[str]]: FILE: crazy_functions/test_project/python/dqn/policies.py class QNetwork (line 12) | class QNetwork(BasePolicy): method __init__ (line 24) | def __init__( method forward (line 53) | def forward(self, obs: th.Tensor) -> th.Tensor: method _predict (line 62) | def _predict(self, observation: th.Tensor, deterministic: bool = True)... method _get_constructor_parameters (line 68) | def _get_constructor_parameters(self) -> Dict[str, Any]: class DQNPolicy (line 82) | class DQNPolicy(BasePolicy): method __init__ (line 102) | def __init__( method _build (line 145) | def _build(self, lr_schedule: Schedule) -> None: method make_q_net (line 160) | def make_q_net(self) -> QNetwork: method forward (line 165) | def forward(self, obs: th.Tensor, deterministic: bool = True) -> th.Te... method _predict (line 168) | def _predict(self, obs: th.Tensor, deterministic: bool = True) -> th.T... method _get_constructor_parameters (line 171) | def _get_constructor_parameters(self) -> Dict[str, Any]: class CnnPolicy (line 191) | class CnnPolicy(DQNPolicy): method __init__ (line 209) | def __init__( FILE: crazy_functions/下载arxiv论文翻译摘要.py function download_arxiv_ (line 5) | def download_arxiv_(url_pdf): function get_name (line 67) | def get_name(_url_): function 下载arxiv论文并翻译摘要 (line 135) | def 下载arxiv论文并翻译摘要(txt, llm_kwargs, plugin_kwargs, chatbot, history, sys... FILE: crazy_functions/交互功能函数模板.py function 交互功能模板函数 (line 6) | def 交互功能模板函数(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pr... function get_image_page_by_keyword (line 52) | def get_image_page_by_keyword(keyword): FILE: crazy_functions/代码重写为全英文_多线程.py function extract_code_block_carefully (line 7) | def extract_code_block_carefully(txt): function break_txt_into_half_at_some_linebreak (line 17) | def break_txt_into_half_at_some_linebreak(txt): function 全项目切换英文 (line 26) | def 全项目切换英文(txt, llm_kwargs, plugin_kwargs, chatbot, history, sys_prompt... FILE: crazy_functions/图片生成.py function gen_image (line 6) | def gen_image(llm_kwargs, prompt, resolution="256x256"): function 图片生成 (line 47) | def 图片生成(prompt, llm_kwargs, plugin_kwargs, chatbot, history, system_pro... FILE: crazy_functions/对话历史存档.py function write_chat_to_file (line 5) | def write_chat_to_file(chatbot, history=None, file_name=None): function gen_file_preview (line 35) | def gen_file_preview(file_name): function read_file_to_chat (line 50) | def read_file_to_chat(chatbot, history, file_name): function 对话历史存档 (line 71) | def 对话历史存档(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prom... function hide_cwd (line 86) | def hide_cwd(str): function 载入对话历史存档 (line 93) | def 载入对话历史存档(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pr... function 删除所有本地对话历史记录 (line 123) | def 删除所有本地对话历史记录(txt, llm_kwargs, plugin_kwargs, chatbot, history, syste... FILE: crazy_functions/总结word文档.py function 解析docx (line 7) | def 解析docx(file_manifest, project_folder, llm_kwargs, plugin_kwargs, cha... function 总结word文档 (line 84) | def 总结word文档(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pr... FILE: crazy_functions/总结音视频.py function split_audio_file (line 4) | def split_audio_file(filename, split_duration=1000): function AnalyAudio (line 40) | def AnalyAudio(parse_prompt, file_manifest, llm_kwargs, chatbot, history): function 总结音视频 (line 133) | def 总结音视频(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_promp... FILE: crazy_functions/批量Markdown翻译.py class PaperFileGroup (line 7) | class PaperFileGroup(): method __init__ (line 8) | def __init__(self): method run_file_split (line 21) | def run_file_split(self, max_token_limit=1900): method merge_result (line 39) | def merge_result(self): method write_result (line 44) | def write_result(self, language): function 多文件翻译 (line 53) | def 多文件翻译(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chat... function get_files_from_everything (line 115) | def get_files_from_everything(txt, preference=''): function Markdown英译中 (line 154) | def Markdown英译中(txt, llm_kwargs, plugin_kwargs, chatbot, history, system... function Markdown中译英 (line 194) | def Markdown中译英(txt, llm_kwargs, plugin_kwargs, chatbot, history, system... function Markdown翻译指定语言 (line 227) | def Markdown翻译指定语言(txt, llm_kwargs, plugin_kwargs, chatbot, history, sys... FILE: crazy_functions/批量总结PDF文档.py function 解析PDF (line 9) | def 解析PDF(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chat... function 批量总结PDF文档 (line 108) | def 批量总结PDF文档(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_p... FILE: crazy_functions/批量总结PDF文档pdfminer.py function readPdf (line 7) | def readPdf(pdfPath): function 解析Paper (line 65) | def 解析Paper(file_manifest, project_folder, llm_kwargs, plugin_kwargs, ch... function 批量总结PDF文档pdfminer (line 125) | def 批量总结PDF文档pdfminer(txt, llm_kwargs, plugin_kwargs, chatbot, history, ... FILE: crazy_functions/批量翻译PDF文档_多线程.py function 批量翻译PDF文档 (line 9) | def 批量翻译PDF文档(txt, llm_kwargs, plugin_kwargs, chatbot, history, sys_prom... function 解析PDF (line 59) | def 解析PDF(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chat... class construct_html (line 162) | class construct_html(): method __init__ (line 163) | def __init__(self) -> None: method add_row (line 191) | def add_row(self, a, b): method save_file (line 204) | def save_file(self, file_name): FILE: crazy_functions/数学动画生成manim.py function inspect_dependency (line 5) | def inspect_dependency(chatbot, history): function eval_manim (line 15) | def eval_manim(code): function get_code_block (line 42) | def get_code_block(reply): function 动画生成 (line 51) | def 动画生成(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt... function examples_of_manim (line 100) | def examples_of_manim(): FILE: crazy_functions/理解PDF文档内容.py function 解析PDF (line 8) | def 解析PDF(file_name, llm_kwargs, plugin_kwargs, chatbot, history, system... function 理解PDF文档内容标准文件输入 (line 71) | def 理解PDF文档内容标准文件输入(txt, llm_kwargs, plugin_kwargs, chatbot, history, sy... FILE: crazy_functions/生成函数注释.py function 生成函数注释 (line 6) | def 生成函数注释(file_manifest, project_folder, llm_kwargs, plugin_kwargs, cha... function 批量生成函数注释 (line 37) | def 批量生成函数注释(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pr... FILE: crazy_functions/联网的ChatGPT.py function google (line 7) | def google(query, proxies): function scrape_text (line 30) | def scrape_text(url, proxies) -> str: function 连接网络回答问题 (line 58) | def 连接网络回答问题(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pr... FILE: crazy_functions/联网的ChatGPT_bing版.py function bing_search (line 8) | def bing_search(query, proxies=None): function scrape_text (line 30) | def scrape_text(url, proxies) -> str: function 连接bing搜索回答问题 (line 58) | def 连接bing搜索回答问题(txt, llm_kwargs, plugin_kwargs, chatbot, history, syste... FILE: crazy_functions/虚空终端.py function get_fn_lib (line 58) | def get_fn_lib(): function inspect_dependency (line 67) | def inspect_dependency(chatbot, history): function eval_code (line 70) | def eval_code(code, llm_kwargs, plugin_kwargs, chatbot, history, system_... function get_code_block (line 90) | def get_code_block(reply): function 终端 (line 99) | def 终端(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, ... FILE: crazy_functions/解析JupyterNotebook.py class PaperFileGroup (line 6) | class PaperFileGroup(): method __init__ (line 7) | def __init__(self): method run_file_split (line 21) | def run_file_split(self, max_token_limit=1900): function parseNotebook (line 42) | def parseNotebook(filename, enable_markdown=1): function ipynb解释 (line 67) | def ipynb解释(file_manifest, project_folder, llm_kwargs, plugin_kwargs, ch... function 解析ipynb文件 (line 118) | def 解析ipynb文件(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_p... FILE: crazy_functions/解析项目源代码.py function 解析源代码新 (line 5) | def 解析源代码新(file_manifest, project_folder, llm_kwargs, plugin_kwargs, cha... function 解析项目本身 (line 106) | def 解析项目本身(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prom... function 解析一个Python项目 (line 120) | def 解析一个Python项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, syste... function 解析一个C项目的头文件 (line 139) | def 解析一个C项目的头文件(txt, llm_kwargs, plugin_kwargs, chatbot, history, system... function 解析一个C项目 (line 159) | def 解析一个C项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pro... function 解析一个Java项目 (line 181) | def 解析一个Java项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_... function 解析一个前端项目 (line 203) | def 解析一个前端项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pr... function 解析一个Golang项目 (line 232) | def 解析一个Golang项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, syste... function 解析一个Rust项目 (line 253) | def 解析一个Rust项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_... function 解析一个Lua项目 (line 273) | def 解析一个Lua项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_p... function 解析一个CSharp项目 (line 295) | def 解析一个CSharp项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, syste... function 解析任意code项目 (line 315) | def 解析任意code项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_... FILE: crazy_functions/询问多个大语言模型.py function 同时问询 (line 5) | def 同时问询(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt... function 同时问询_指定模型 (line 34) | def 同时问询_指定模型(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_p... FILE: crazy_functions/语音助手.py class WatchDog (line 10) | class WatchDog(): method __init__ (line 11) | def __init__(self, timeout, bark_fn, interval=3, msg="") -> None: method watch (line 19) | def watch(self): method begin_watch (line 28) | def begin_watch(self): method feed (line 34) | def feed(self): function chatbot2history (line 37) | def chatbot2history(chatbot): class AsyncGptTask (line 45) | class AsyncGptTask(): method __init__ (line 46) | def __init__(self) -> None: method gpt_thread_worker (line 50) | def gpt_thread_worker(self, i_say, llm_kwargs, history, sys_prompt, ob... method add_async_gpt_task (line 61) | def add_async_gpt_task(self, i_say, chatbot_index, llm_kwargs, history... method update_chatbot (line 69) | def update_chatbot(self, chatbot): class InterviewAssistant (line 79) | class InterviewAssistant(AliyunASR): method __init__ (line 80) | def __init__(self): method __del__ (line 90) | def __del__(self): method init (line 96) | def init(self, chatbot): method no_audio_for_a_while (line 111) | def no_audio_for_a_while(self): method begin (line 117) | def begin(self, llm_kwargs, plugin_kwargs, chatbot, history, system_pr... function 语音助手 (line 172) | def 语音助手(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt... FILE: crazy_functions/读文章写摘要.py function 解析Paper (line 7) | def 解析Paper(file_manifest, project_folder, llm_kwargs, plugin_kwargs, ch... function 读文章写摘要 (line 50) | def 读文章写摘要(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prom... FILE: crazy_functions/谷歌检索小助手.py function get_meta_information (line 5) | def get_meta_information(url, chatbot, history): function 谷歌检索小助手 (line 67) | def 谷歌检索小助手(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pro... FILE: crazy_functions/辅助回答.py function 猜你想问 (line 11) | def 猜你想问(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt... FILE: crazy_functions/高级功能函数模板.py function 高阶功能模板函数 (line 5) | def 高阶功能模板函数(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pr... FILE: gradio_demo.py function auto_opentab_delay (line 41) | def auto_opentab_delay(port=7585): function load_auto_backend_models (line 50) | def load_auto_backend_models(lama,sam,det,tag2text,device): function Auto_run (line 85) | def Auto_run( function main (line 284) | def main(args): FILE: llm_cards/bridge_all.py class LazyloadTiktoken (line 28) | class LazyloadTiktoken(object): method __init__ (line 29) | def __init__(self, model): method get_encoder (line 34) | def get_encoder(model): method encode (line 40) | def encode(self, *args, **kwargs): method decode (line 44) | def decode(self, *args, **kwargs): function LLM_CATCH_EXCEPTION (line 235) | def LLM_CATCH_EXCEPTION(f): function predict_no_ui_long_connection (line 249) | def predict_no_ui_long_connection(inputs, llm_kwargs, history, sys_promp... function predict_all (line 326) | def predict_all(inputs, llm_kwargs, *args, **kwargs): function talk_all (line 340) | def talk_all(inputs, llm_kwargs, *args, **kwargs): FILE: llm_cards/bridge_chatglm.py class GetGLMHandle (line 13) | class GetGLMHandle(Process): method __init__ (line 14) | def __init__(self,quantize=None): method check_dependency (line 27) | def check_dependency(self): method ready (line 36) | def ready(self): method run (line 39) | def run(self): method stream_chat (line 95) | def stream_chat(self, **kwargs): function predict_no_ui_long_connection (line 111) | def predict_no_ui_long_connection(inputs, llm_kwargs, history=[], sys_pr... function asr_with_gpt (line 143) | def asr_with_gpt(transcriber,text_queue, llm_kwargs, plugin_kwargs, chat... function send_ui (line 171) | async def send_ui(text_queue,chatbot, history): function Talk_with_app (line 187) | def Talk_with_app(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[]... function predict (line 239) | def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], syst... FILE: llm_cards/bridge_chatgpt.py function get_full_error (line 31) | def get_full_error(chunk, stream_response): function predict_no_ui_long_connection (line 43) | def predict_no_ui_long_connection(inputs, llm_kwargs, history=[], sys_pr... function asr_with_gpt (line 111) | def asr_with_gpt(transcriber,text_queue, llm_kwargs, plugin_kwargs, chat... function Talk_with_app (line 138) | def Talk_with_app(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[]... function predict (line 191) | def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], syst... function generate_payload (line 338) | def generate_payload(inputs, llm_kwargs, history, system_prompt, stream): FILE: llm_cards/bridge_stackclaude.py class SlackClient (line 23) | class SlackClient(AsyncWebClient): method open_channel (line 38) | async def open_channel(self): method chat (line 42) | async def chat(self, text): method get_slack_messages (line 49) | async def get_slack_messages(self): method get_reply (line 59) | async def get_reply(self): class ClaudeHandle (line 82) | class ClaudeHandle(Process): method __init__ (line 83) | def __init__(self): method check_dependency (line 95) | def check_dependency(self): method ready (line 105) | def ready(self): method async_run (line 108) | async def async_run(self): method run (line 140) | def run(self): method stream_chat (line 177) | def stream_chat(self, **kwargs): function predict_no_ui_long_connection (line 204) | def predict_no_ui_long_connection(inputs, llm_kwargs, history=[], sys_pr... function predict (line 234) | def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], syst... FILE: llm_cards/core_functional.py function get_core_functions (line 9) | def get_core_functions(): function handle_core_functionality (line 81) | def handle_core_functionality(additional_fn, inputs, history, chatbot): FILE: llm_cards/crazy_functional.py function get_crazy_functions (line 4) | def get_crazy_functions(): FILE: model_cards/Tag2Text/batch_inference.py function parse_args (line 20) | def parse_args(): function load_dataset (line 94) | def load_dataset( function get_class_idxs (line 151) | def get_class_idxs( function load_thresholds (line 170) | def load_thresholds( function gen_pred_file (line 201) | def gen_pred_file( function load_ram (line 217) | def load_ram( function load_tag2text (line 236) | def load_tag2text( function forward_ram (line 250) | def forward_ram(model: Module, imgs: Tensor) -> Tensor: function forward_tag2text (line 267) | def forward_tag2text( function print_write (line 287) | def print_write(f: TextIO, s: str): FILE: model_cards/Tag2Text/ram/inference.py function inference_tag2text (line 8) | def inference_tag2text(image, model, input_tag="None"): function inference_ram (line 33) | def inference_ram(image, model): function inference_ram_openset (line 42) | def inference_ram_openset(image, model): FILE: model_cards/Tag2Text/ram/models/bert.py class BertEmbeddings_nopos (line 52) | class BertEmbeddings_nopos(nn.Module): method __init__ (line 55) | def __init__(self, config): method forward (line 71) | def forward( class BertEmbeddings (line 100) | class BertEmbeddings(nn.Module): method __init__ (line 103) | def __init__(self, config): method forward (line 119) | def forward( class BertSelfAttention (line 146) | class BertSelfAttention(nn.Module): method __init__ (line 147) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 175) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 178) | def get_attn_gradients(self): method save_attention_map (line 181) | def save_attention_map(self, attention_map): method get_attention_map (line 184) | def get_attention_map(self): method transpose_for_scores (line 187) | def transpose_for_scores(self, x): method forward (line 192) | def forward( class BertSelfOutput (line 284) | class BertSelfOutput(nn.Module): method __init__ (line 285) | def __init__(self, config): method forward (line 291) | def forward(self, hidden_states, input_tensor): class BertAttention (line 298) | class BertAttention(nn.Module): method __init__ (line 299) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 305) | def prune_heads(self, heads): method forward (line 323) | def forward( class BertIntermediate (line 347) | class BertIntermediate(nn.Module): method __init__ (line 348) | def __init__(self, config): method forward (line 356) | def forward(self, hidden_states): class BertOutput (line 362) | class BertOutput(nn.Module): method __init__ (line 363) | def __init__(self, config): method forward (line 369) | def forward(self, hidden_states, input_tensor): class BertLayer (line 376) | class BertLayer(nn.Module): method __init__ (line 377) | def __init__(self, config, layer_num): method forward (line 389) | def forward( method feed_forward_chunk (line 455) | def feed_forward_chunk(self, attention_output): class BertEncoder (line 461) | class BertEncoder(nn.Module): method __init__ (line 462) | def __init__(self, config): method forward (line 468) | def forward( class BertPooler (line 561) | class BertPooler(nn.Module): method __init__ (line 562) | def __init__(self, config): method forward (line 567) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 576) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 577) | def __init__(self, config): method forward (line 586) | def forward(self, hidden_states): class BertLMPredictionHead (line 593) | class BertLMPredictionHead(nn.Module): method __init__ (line 594) | def __init__(self, config): method forward (line 607) | def forward(self, hidden_states): class BertOnlyMLMHead (line 613) | class BertOnlyMLMHead(nn.Module): method __init__ (line 614) | def __init__(self, config): method forward (line 618) | def forward(self, sequence_output): class BertPreTrainedModel (line 623) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 633) | def _init_weights(self, module): class BertModel (line 646) | class BertModel(BertPreTrainedModel): method __init__ (line 656) | def __init__(self, config, add_pooling_layer=True): method get_input_embeddings (line 669) | def get_input_embeddings(self): method set_input_embeddings (line 672) | def set_input_embeddings(self, value): method _prune_heads (line 675) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 684) | def get_extended_attention_mask(self, attention_mask: Tensor, input_sh... method forward (line 745) | def forward( class BertLMHeadModel (line 885) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 890) | def __init__(self, config): method get_output_embeddings (line 898) | def get_output_embeddings(self): method set_output_embeddings (line 901) | def set_output_embeddings(self, new_embeddings): method forward (line 904) | def forward( method prepare_inputs_for_generation (line 1010) | def prepare_inputs_for_generation(self, input_ids, past=None, attentio... method _reorder_cache (line 1029) | def _reorder_cache(self, past, beam_idx): FILE: model_cards/Tag2Text/ram/models/ram.py class RAM (line 20) | class RAM(nn.Module): method __init__ (line 21) | def __init__(self, method load_tag_list (line 158) | def load_tag_list(self, tag_list_file): method del_selfattention (line 165) | def del_selfattention(self): method generate_tag (line 170) | def generate_tag(self, method generate_tag_openset (line 217) | def generate_tag_openset(self, function ram (line 262) | def ram(pretrained='', **kwargs): FILE: model_cards/Tag2Text/ram/models/swin_transformer.py class Mlp (line 17) | class Mlp(nn.Module): method __init__ (line 18) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 27) | def forward(self, x): function window_partition (line 36) | def window_partition(x, window_size): function window_reverse (line 51) | def window_reverse(windows, window_size, H, W): class WindowAttention (line 68) | class WindowAttention(nn.Module): method __init__ (line 82) | def __init__(self, dim, window_size, num_heads, qkv_bias=True, qk_scal... method forward (line 116) | def forward(self, x, mask=None): method extra_repr (line 149) | def extra_repr(self) -> str: method flops (line 152) | def flops(self, N): class SwinTransformerBlock (line 166) | class SwinTransformerBlock(nn.Module): method __init__ (line 185) | def __init__(self, dim, input_resolution, num_heads, window_size=7, sh... method forward (line 236) | def forward(self, x): method extra_repr (line 275) | def extra_repr(self) -> str: method flops (line 279) | def flops(self): class PatchMerging (line 294) | class PatchMerging(nn.Module): method __init__ (line 303) | def __init__(self, input_resolution, dim, norm_layer=nn.LayerNorm): method forward (line 310) | def forward(self, x): method extra_repr (line 333) | def extra_repr(self) -> str: method flops (line 336) | def flops(self): class BasicLayer (line 343) | class BasicLayer(nn.Module): method __init__ (line 363) | def __init__(self, dim, input_resolution, depth, num_heads, window_size, method forward (line 391) | def forward(self, x): method extra_repr (line 401) | def extra_repr(self) -> str: method flops (line 404) | def flops(self): class PatchEmbed (line 413) | class PatchEmbed(nn.Module): method __init__ (line 424) | def __init__(self, img_size=224, patch_size=4, in_chans=3, embed_dim=9... method forward (line 443) | def forward(self, x): method flops (line 453) | def flops(self): class SwinTransformer (line 461) | class SwinTransformer(nn.Module): method __init__ (line 487) | def __init__(self, img_size=224, patch_size=4, in_chans=3, num_classes... method _init_weights (line 545) | def _init_weights(self, m): method no_weight_decay (line 555) | def no_weight_decay(self): method no_weight_decay_keywords (line 559) | def no_weight_decay_keywords(self): method forward (line 562) | def forward(self, x, idx_to_group_img=None, image_atts=None, **kwargs): method flops (line 586) | def flops(self): function interpolate_relative_pos_embed (line 596) | def interpolate_relative_pos_embed(rel_pos_bias, dst_num_pos, param_name... FILE: model_cards/Tag2Text/ram/models/tag2text.py class Tag2Text (line 19) | class Tag2Text(nn.Module): method __init__ (line 21) | def __init__(self, method load_tag_list (line 128) | def load_tag_list(self, tag_list_file): method del_selfattention (line 135) | def del_selfattention(self): method forward (line 141) | def forward(self, image, caption, tag): method generate (line 231) | def generate(self, function tag2text (line 360) | def tag2text(pretrained='', **kwargs): FILE: model_cards/Tag2Text/ram/models/utils.py function read_json (line 16) | def read_json(rpath): function tie_encoder_decoder_weights (line 21) | def tie_encoder_decoder_weights(encoder: nn.Module, decoder: nn.Module, class GroupWiseLinear (line 99) | class GroupWiseLinear(nn.Module): method __init__ (line 103) | def __init__(self, num_class, hidden_dim, bias=True): method reset_parameters (line 114) | def reset_parameters(self): method forward (line 122) | def forward(self, x): function init_tokenizer (line 130) | def init_tokenizer(): function create_vit (line 138) | def create_vit(vit, function is_url (line 170) | def is_url(url_or_filename): function load_checkpoint (line 175) | def load_checkpoint(model, url_or_filename): function load_checkpoint_swinbase (line 203) | def load_checkpoint_swinbase(model, url_or_filename, kwargs): function load_checkpoint_swinlarge (line 241) | def load_checkpoint_swinlarge(model, url_or_filename, kwargs): class AsymmetricLoss (line 281) | class AsymmetricLoss(nn.Module): method __init__ (line 282) | def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-8, disa... method forward (line 291) | def forward(self, x, y): FILE: model_cards/Tag2Text/ram/models/vit.py class Mlp (line 23) | class Mlp(nn.Module): method __init__ (line 26) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 35) | def forward(self, x): class Attention (line 44) | class Attention(nn.Module): method __init__ (line 45) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at... method save_attn_gradients (line 58) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 61) | def get_attn_gradients(self): method save_attention_map (line 64) | def save_attention_map(self, attention_map): method get_attention_map (line 67) | def get_attention_map(self): method forward (line 70) | def forward(self, x, register_hook=False): class Block (line 89) | class Block(nn.Module): method __init__ (line 91) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 107) | def forward(self, x, register_hook=False): class VisionTransformer (line 113) | class VisionTransformer(nn.Module): method __init__ (line 118) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method _init_weights (line 167) | def _init_weights(self, m): method no_weight_decay (line 177) | def no_weight_decay(self): method forward (line 180) | def forward(self, x, register_blk=-1): method load_pretrained (line 197) | def load_pretrained(self, checkpoint_path, prefix=''): function _load_weights (line 202) | def _load_weights(model: VisionTransformer, checkpoint_path: str, prefix... function interpolate_pos_embed (line 281) | def interpolate_pos_embed(pos_embed_checkpoint, visual_encoder): FILE: model_cards/Tag2Text/ram/transform.py function get_transform (line 4) | def get_transform(image_size=384): FILE: model_cards/Tag2Text/ram/utils/metrics.py function get_mAP (line 7) | def get_mAP( function _average_precision (line 41) | def _average_precision(output: ndarray, target: ndarray) -> float: function get_PR (line 61) | def get_PR( FILE: model_cards/Tag2Text/ram/utils/openset_utils.py function article (line 9) | def article(name): function processed_name (line 13) | def processed_name(name, rm_dot=False): function build_openset_label_embedding (line 293) | def build_openset_label_embedding(categories=None): FILE: model_cards/autoback.py function preprocess_image (line 48) | def preprocess_image(img): class Ensemble (line 67) | class Ensemble(nn.ModuleList): method __init__ (line 69) | def __init__(self): method forward (line 72) | def forward(self, x, augment=False, profile=False, visualize=False): function torch_safe_load (line 77) | def torch_safe_load(weight): function is_similar_string (line 102) | def is_similar_string(string): function attempt_load (line 109) | def attempt_load(weights, device=None): class AutoBackend (line 124) | class AutoBackend(nn.Module): method __init__ (line 126) | def __init__(self, methods: str ,weights: None , device=torch.device('... method forward (line 253) | def forward(self, im, augment=False, visualize=False,prompt= None ,box... method gligen_inference (line 278) | def gligen_inference(config=None, starting_noise=None,negative_prompt=... method grounded_inference (line 281) | def grounded_inference(self,im,caption,box_threshold,text_threshold,io... method sam_inference (line 322) | def sam_inference(self,im,prompt): method tag2text_inference (line 334) | def tag2text_inference(self,im,prompt): method ram_inference (line 341) | def ram_inference(self,im): method lama_inference (line 347) | def lama_inference(self,im,mask) : method _model_type (line 376) | def _model_type(p='path/to/model.pt'): FILE: model_cards/groundingdino/datasets/transforms.py function crop (line 17) | def crop(image, target, region): function hflip (line 68) | def hflip(image, target): function resize (line 87) | def resize(image, target, size, max_size=None): function pad (line 149) | def pad(image, target, padding): class ResizeDebug (line 162) | class ResizeDebug(object): method __init__ (line 163) | def __init__(self, size): method __call__ (line 166) | def __call__(self, img, target): class RandomCrop (line 170) | class RandomCrop(object): method __init__ (line 171) | def __init__(self, size): method __call__ (line 174) | def __call__(self, img, target): class RandomSizeCrop (line 179) | class RandomSizeCrop(object): method __init__ (line 180) | def __init__(self, min_size: int, max_size: int, respect_boxes: bool =... method __call__ (line 187) | def __call__(self, img: PIL.Image.Image, target: dict): class CenterCrop (line 204) | class CenterCrop(object): method __init__ (line 205) | def __init__(self, size): method __call__ (line 208) | def __call__(self, img, target): class RandomHorizontalFlip (line 216) | class RandomHorizontalFlip(object): method __init__ (line 217) | def __init__(self, p=0.5): method __call__ (line 220) | def __call__(self, img, target): class RandomResize (line 226) | class RandomResize(object): method __init__ (line 227) | def __init__(self, sizes, max_size=None): method __call__ (line 232) | def __call__(self, img, target=None): class RandomPad (line 237) | class RandomPad(object): method __init__ (line 238) | def __init__(self, max_pad): method __call__ (line 241) | def __call__(self, img, target): class RandomSelect (line 247) | class RandomSelect(object): method __init__ (line 253) | def __init__(self, transforms1, transforms2, p=0.5): method __call__ (line 258) | def __call__(self, img, target): class ToTensor (line 264) | class ToTensor(object): method __call__ (line 265) | def __call__(self, img, target): class RandomErasing (line 269) | class RandomErasing(object): method __init__ (line 270) | def __init__(self, *args, **kwargs): method __call__ (line 273) | def __call__(self, img, target): class Normalize (line 277) | class Normalize(object): method __init__ (line 278) | def __init__(self, mean, std): method __call__ (line 282) | def __call__(self, image, target=None): class Compose (line 296) | class Compose(object): method __init__ (line 297) | def __init__(self, transforms): method __call__ (line 300) | def __call__(self, image, target): method __repr__ (line 305) | def __repr__(self): FILE: model_cards/groundingdino/models/GroundingDINO/backbone/backbone.py class FrozenBatchNorm2d (line 33) | class FrozenBatchNorm2d(torch.nn.Module): method __init__ (line 42) | def __init__(self, n): method _load_from_state_dict (line 49) | def _load_from_state_dict( method forward (line 60) | def forward(self, x): class BackboneBase (line 73) | class BackboneBase(nn.Module): method __init__ (line 74) | def __init__( method forward (line 107) | def forward(self, tensor_list: NestedTensor): class Backbone (line 119) | class Backbone(BackboneBase): method __init__ (line 122) | def __init__( class Joiner (line 146) | class Joiner(nn.Sequential): method __init__ (line 147) | def __init__(self, backbone, position_embedding): method forward (line 150) | def forward(self, tensor_list: NestedTensor): function build_backbone (line 162) | def build_backbone(args): FILE: model_cards/groundingdino/models/GroundingDINO/backbone/position_encoding.py class PositionEmbeddingSine (line 30) | class PositionEmbeddingSine(nn.Module): method __init__ (line 36) | def __init__(self, num_pos_feats=64, temperature=10000, normalize=Fals... method forward (line 47) | def forward(self, tensor_list: NestedTensor): class PositionEmbeddingSineHW (line 78) | class PositionEmbeddingSineHW(nn.Module): method __init__ (line 84) | def __init__( method forward (line 98) | def forward(self, tensor_list: NestedTensor): class PositionEmbeddingLearned (line 134) | class PositionEmbeddingLearned(nn.Module): method __init__ (line 139) | def __init__(self, num_pos_feats=256): method reset_parameters (line 145) | def reset_parameters(self): method forward (line 149) | def forward(self, tensor_list: NestedTensor): function build_position_encoding (line 171) | def build_position_encoding(args): FILE: model_cards/groundingdino/models/GroundingDINO/backbone/swin_transformer.py class Mlp (line 24) | class Mlp(nn.Module): method __init__ (line 27) | def __init__( method forward (line 38) | def forward(self, x): function window_partition (line 47) | def window_partition(x, window_size): function window_reverse (line 61) | def window_reverse(windows, window_size, H, W): class WindowAttention (line 77) | class WindowAttention(nn.Module): method __init__ (line 90) | def __init__( method forward (line 134) | def forward(self, x, mask=None): class SwinTransformerBlock (line 177) | class SwinTransformerBlock(nn.Module): method __init__ (line 194) | def __init__( method forward (line 238) | def forward(self, x, mask_matrix): class PatchMerging (line 301) | class PatchMerging(nn.Module): method __init__ (line 308) | def __init__(self, dim, norm_layer=nn.LayerNorm): method forward (line 314) | def forward(self, x, H, W): class BasicLayer (line 343) | class BasicLayer(nn.Module): method __init__ (line 361) | def __init__( method forward (line 409) | def forward(self, x, H, W): class PatchEmbed (line 459) | class PatchEmbed(nn.Module): method __init__ (line 468) | def __init__(self, patch_size=4, in_chans=3, embed_dim=96, norm_layer=... method forward (line 482) | def forward(self, x): class SwinTransformer (line 501) | class SwinTransformer(nn.Module): method __init__ (line 530) | def __init__( method _freeze_stages (line 636) | def _freeze_stages(self): method forward_raw (line 678) | def forward_raw(self, x): method forward (line 712) | def forward(self, tensor_list: NestedTensor): method train (line 756) | def train(self, mode=True): function build_swin_transformer (line 762) | def build_swin_transformer(modelname, pretrain_img_size, **kw): FILE: model_cards/groundingdino/models/GroundingDINO/bertwarper.py class BertModelWarper (line 17) | class BertModelWarper(nn.Module): method __init__ (line 18) | def __init__(self, bert_model): method forward (line 31) | def forward( class TextEncoderShell (line 169) | class TextEncoderShell(nn.Module): method __init__ (line 170) | def __init__(self, text_encoder): method forward (line 175) | def forward(self, **kw): function generate_masks_with_special_tokens (line 180) | def generate_masks_with_special_tokens(tokenized, special_tokens_list, t... function generate_masks_with_special_tokens_and_transfer_map (line 224) | def generate_masks_with_special_tokens_and_transfer_map(tokenized, speci... FILE: model_cards/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn.h function namespace (line 19) | namespace groundingdino { FILE: model_cards/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cpu.cpp type groundingdino (line 16) | namespace groundingdino { function ms_deform_attn_cpu_forward (line 18) | at::Tensor function ms_deform_attn_cpu_backward (line 30) | std::vector FILE: model_cards/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cpu.h function namespace (line 14) | namespace groundingdino { FILE: model_cards/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.h function namespace (line 14) | namespace groundingdino { FILE: model_cards/groundingdino/models/GroundingDINO/csrc/vision.cpp type groundingdino (line 5) | namespace groundingdino { function get_cuda_version (line 11) | std::string get_cuda_version() { function get_compiler_version (line 32) | std::string get_compiler_version() { function PYBIND11_MODULE (line 53) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: model_cards/groundingdino/models/GroundingDINO/fuse_modules.py class FeatureResizer (line 14) | class FeatureResizer(nn.Module): method __init__ (line 20) | def __init__(self, input_feat_size, output_feat_size, dropout, do_ln=T... method forward (line 28) | def forward(self, encoder_features): function l1norm (line 36) | def l1norm(X, dim, eps=1e-8): function l2norm (line 43) | def l2norm(X, dim, eps=1e-8): function func_attention (line 50) | def func_attention(query, context, smooth=1, raw_feature_norm="softmax",... class BiMultiHeadAttention (line 99) | class BiMultiHeadAttention(nn.Module): method __init__ (line 100) | def __init__(self, v_dim, l_dim, embed_dim, num_heads, dropout=0.1, cf... method _shape (line 129) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method _reset_parameters (line 132) | def _reset_parameters(self): method forward (line 146) | def forward(self, v, l, attention_mask_v=None, attention_mask_l=None): class BiAttentionBlock (line 252) | class BiAttentionBlock(nn.Module): method __init__ (line 253) | def __init__( method forward (line 286) | def forward(self, v, l, attention_mask_v=None, attention_mask_l=None): FILE: model_cards/groundingdino/models/GroundingDINO/groundingdino.py class GroundingDINO (line 52) | class GroundingDINO(nn.Module): method __init__ (line 55) | def __init__( method _reset_parameters (line 204) | def _reset_parameters(self): method init_ref_points (line 210) | def init_ref_points(self, use_num_queries): method forward (line 213) | def forward(self, samples: NestedTensor, targets: List = None, **kw): method _set_aux_loss (line 353) | def _set_aux_loss(self, outputs_class, outputs_coord): function build_groundingdino (line 364) | def build_groundingdino(args): FILE: model_cards/groundingdino/models/GroundingDINO/ms_deform_attn.py function _is_power_of_2 (line 35) | def _is_power_of_2(n): class MultiScaleDeformableAttnFunction (line 41) | class MultiScaleDeformableAttnFunction(Function): method forward (line 43) | def forward( method backward (line 72) | def backward(ctx, grad_output): function multi_scale_deformable_attn_pytorch (line 93) | def multi_scale_deformable_attn_pytorch( class MultiScaleDeformableAttention (line 136) | class MultiScaleDeformableAttention(nn.Module): method __init__ (line 154) | def __init__( method _reset_parameters (line 194) | def _reset_parameters(self): method init_weights (line 197) | def init_weights(self): method freeze_sampling_offsets (line 222) | def freeze_sampling_offsets(self): method freeze_attention_weights (line 227) | def freeze_attention_weights(self): method forward (line 232) | def forward( function create_dummy_class (line 362) | def create_dummy_class(klass, dependency, message=""): function create_dummy_func (line 391) | def create_dummy_func(func, dependency, message=""): FILE: model_cards/groundingdino/models/GroundingDINO/transformer.py class Transformer (line 40) | class Transformer(nn.Module): method __init__ (line 41) | def __init__( method _reset_parameters (line 189) | def _reset_parameters(self): method get_valid_ratio (line 199) | def get_valid_ratio(self, mask): method init_ref_points (line 208) | def init_ref_points(self, use_num_queries): method forward (line 211) | def forward(self, srcs, masks, refpoint_embed, pos_embeds, tgt, attn_m... class TransformerEncoder (line 406) | class TransformerEncoder(nn.Module): method __init__ (line 407) | def __init__( method get_reference_points (line 466) | def get_reference_points(spatial_shapes, valid_ratios, device): method forward (line 482) | def forward( class TransformerDecoder (line 598) | class TransformerDecoder(nn.Module): method __init__ (line 599) | def __init__( method forward (line 633) | def forward( class DeformableTransformerEncoderLayer (line 738) | class DeformableTransformerEncoderLayer(nn.Module): method __init__ (line 739) | def __init__( method with_pos_embed (line 771) | def with_pos_embed(tensor, pos): method forward_ffn (line 774) | def forward_ffn(self, src): method forward (line 780) | def forward( class DeformableTransformerDecoderLayer (line 802) | class DeformableTransformerDecoderLayer(nn.Module): method __init__ (line 803) | def __init__( method rm_self_attn_modules (line 852) | def rm_self_attn_modules(self): method with_pos_embed (line 858) | def with_pos_embed(tensor, pos): method forward_ffn (line 861) | def forward_ffn(self, tgt): method forward (line 868) | def forward( function build_transformer (line 930) | def build_transformer(args): FILE: model_cards/groundingdino/models/GroundingDINO/transformer_vanilla.py class TextTransformer (line 33) | class TextTransformer(nn.Module): method __init__ (line 34) | def __init__(self, num_layers, d_model=256, nheads=8, dim_feedforward=... method forward (line 47) | def forward(self, memory_text: torch.Tensor, text_attention_mask: torc... class TransformerEncoderLayer (line 72) | class TransformerEncoderLayer(nn.Module): method __init__ (line 73) | def __init__( method with_pos_embed (line 98) | def with_pos_embed(self, tensor, pos: Optional[Tensor]): method forward (line 101) | def forward( FILE: model_cards/groundingdino/models/GroundingDINO/utils.py function _get_clones (line 16) | def _get_clones(module, N, layer_share=False): function get_sine_pos_embed (line 24) | def get_sine_pos_embed( function gen_encoder_output_proposals (line 56) | def gen_encoder_output_proposals( class RandomBoxPerturber (line 119) | class RandomBoxPerturber: method __init__ (line 120) | def __init__( method __call__ (line 127) | def __call__(self, refanchors: Tensor) -> Tensor: function sigmoid_focal_loss (line 138) | def sigmoid_focal_loss( class MLP (line 171) | class MLP(nn.Module): method __init__ (line 174) | def __init__(self, input_dim, hidden_dim, output_dim, num_layers): method forward (line 182) | def forward(self, x): function _get_activation_fn (line 188) | def _get_activation_fn(activation, d_model=256, batch_dim=0): function gen_sineembed_for_position (line 204) | def gen_sineembed_for_position(pos_tensor): class ContrastiveEmbed (line 233) | class ContrastiveEmbed(nn.Module): method __init__ (line 234) | def __init__(self, max_text_len=256): method forward (line 242) | def forward(self, x, text_dict): FILE: model_cards/groundingdino/models/__init__.py function build_model (line 11) | def build_model(args): FILE: model_cards/groundingdino/models/registry.py class Registry (line 18) | class Registry(object): method __init__ (line 19) | def __init__(self, name): method __repr__ (line 23) | def __repr__(self): method __len__ (line 29) | def __len__(self): method name (line 33) | def name(self): method module_dict (line 37) | def module_dict(self): method get (line 40) | def get(self, key): method registe_with_name (line 43) | def registe_with_name(self, module_name=None, force=False): method register (line 46) | def register(self, module_build_function, module_name=None, force=False): FILE: model_cards/groundingdino/util/box_ops.py function box_cxcywh_to_xyxy (line 9) | def box_cxcywh_to_xyxy(x): function box_xyxy_to_cxcywh (line 15) | def box_xyxy_to_cxcywh(x): function box_iou (line 22) | def box_iou(boxes1, boxes2): function generalized_box_iou (line 39) | def generalized_box_iou(boxes1, boxes2): function box_iou_pairwise (line 66) | def box_iou_pairwise(boxes1, boxes2): function generalized_box_iou_pairwise (line 82) | def generalized_box_iou_pairwise(boxes1, boxes2): function masks_to_boxes (line 107) | def masks_to_boxes(masks): FILE: model_cards/groundingdino/util/get_tokenlizer.py function get_tokenlizer (line 4) | def get_tokenlizer(text_encoder_type): function get_pretrained_language_model (line 21) | def get_pretrained_language_model(text_encoder_type): FILE: model_cards/groundingdino/util/inference.py function preprocess_caption (line 21) | def preprocess_caption(caption: str) -> str: function load_model (line 28) | def load_model(model_config_path: str, model_checkpoint_path: str, devic... function load_image (line 38) | def load_image(image_path: str) -> Tuple[np.array, torch.Tensor]: function predict (line 52) | def predict( function annotate (line 87) | def annotate(image_source: np.ndarray, boxes: torch.Tensor, logits: torc... class Model (line 110) | class Model: method __init__ (line 112) | def __init__( method predict_with_caption (line 125) | def predict_with_caption( method predict_with_classes (line 165) | def predict_with_classes( method preprocess_image (line 210) | def preprocess_image(image_bgr: np.ndarray) -> torch.Tensor: method post_process_result (line 223) | def post_process_result( method phrases2classes (line 235) | def phrases2classes(phrases: List[str], classes: List[str]) -> np.ndar... FILE: model_cards/groundingdino/util/logger.py class _ColorfulFormatter (line 10) | class _ColorfulFormatter(logging.Formatter): method __init__ (line 11) | def __init__(self, *args, **kwargs): method formatMessage (line 18) | def formatMessage(self, record): function setup_logger (line 32) | def setup_logger(output=None, distributed_rank=0, *, color=True, name="i... function _cached_log_stream (line 92) | def _cached_log_stream(filename): FILE: model_cards/groundingdino/util/misc.py class SmoothedValue (line 33) | class SmoothedValue(object): method __init__ (line 38) | def __init__(self, window_size=20, fmt=None): method update (line 46) | def update(self, value, n=1): method synchronize_between_processes (line 51) | def synchronize_between_processes(self): method median (line 65) | def median(self): method avg (line 72) | def avg(self): method global_avg (line 77) | def global_avg(self): method max (line 85) | def max(self): method value (line 89) | def value(self): method __str__ (line 92) | def __str__(self): function _get_global_gloo_group (line 103) | def _get_global_gloo_group(): function all_gather_cpu (line 115) | def all_gather_cpu(data): function all_gather (line 173) | def all_gather(data): function reduce_dict (line 220) | def reduce_dict(input_dict, average=True): class MetricLogger (line 247) | class MetricLogger(object): method __init__ (line 248) | def __init__(self, delimiter="\t"): method update (line 252) | def update(self, **kwargs): method __getattr__ (line 259) | def __getattr__(self, attr): method __str__ (line 266) | def __str__(self): method synchronize_between_processes (line 275) | def synchronize_between_processes(self): method add_meter (line 279) | def add_meter(self, name, meter): method log_every (line 282) | def log_every(self, iterable, print_freq, header=None, logger=None): function get_sha (line 362) | def get_sha(): function collate_fn (line 383) | def collate_fn(batch): function _max_by_axis (line 390) | def _max_by_axis(the_list): class NestedTensor (line 399) | class NestedTensor(object): method __init__ (line 400) | def __init__(self, tensors, mask: Optional[Tensor]): method imgsize (line 416) | def imgsize(self): method to (line 425) | def to(self, device): method to_img_list_single (line 436) | def to_img_list_single(self, tensor, mask): method to_img_list (line 443) | def to_img_list(self): method device (line 460) | def device(self): method decompose (line 463) | def decompose(self): method __repr__ (line 466) | def __repr__(self): method shape (line 470) | def shape(self): function nested_tensor_from_tensor_list (line 474) | def nested_tensor_from_tensor_list(tensor_list: List[Tensor]): function _onnx_nested_tensor_from_tensor_list (line 502) | def _onnx_nested_tensor_from_tensor_list(tensor_list: List[Tensor]) -> N... function setup_for_distributed (line 532) | def setup_for_distributed(is_master): function is_dist_avail_and_initialized (line 548) | def is_dist_avail_and_initialized(): function get_world_size (line 556) | def get_world_size(): function get_rank (line 562) | def get_rank(): function is_main_process (line 568) | def is_main_process(): function save_on_master (line 572) | def save_on_master(*args, **kwargs): function init_distributed_mode (line 577) | def init_distributed_mode(args): function accuracy (line 638) | def accuracy(output, target, topk=(1,)): function accuracy_onehot (line 657) | def accuracy_onehot(pred, gt): function interpolate (line 669) | def interpolate(input, size=None, scale_factor=None, mode="nearest", ali... class color_sys (line 687) | class color_sys: method __init__ (line 688) | def __init__(self, num_colors) -> None: method __call__ (line 700) | def __call__(self, idx): function inverse_sigmoid (line 704) | def inverse_sigmoid(x, eps=1e-3): function clean_state_dict (line 711) | def clean_state_dict(state_dict): FILE: model_cards/groundingdino/util/slconfig.py function check_file_exist (line 21) | def check_file_exist(filename, msg_tmpl='file "{}" does not exist'): class ConfigDict (line 26) | class ConfigDict(Dict): method __missing__ (line 27) | def __missing__(self, name): method __getattr__ (line 30) | def __getattr__(self, name): class SLConfig (line 42) | class SLConfig(object): method _validate_py_syntax (line 68) | def _validate_py_syntax(filename): method _file2dict (line 77) | def _file2dict(filename): method _merge_a_into_b (line 140) | def _merge_a_into_b(a, b): method fromfile (line 184) | def fromfile(filename): method __init__ (line 188) | def __init__(self, cfg_dict=None, cfg_text=None, filename=None): method filename (line 209) | def filename(self): method text (line 213) | def text(self): method pretty_text (line 217) | def pretty_text(self): method __repr__ (line 310) | def __repr__(self): method __len__ (line 313) | def __len__(self): method __getattr__ (line 316) | def __getattr__(self, name): method __getitem__ (line 329) | def __getitem__(self, name): method __setattr__ (line 332) | def __setattr__(self, name, value): method __setitem__ (line 337) | def __setitem__(self, name, value): method __iter__ (line 342) | def __iter__(self): method dump (line 345) | def dump(self, file=None): method merge_from_dict (line 353) | def merge_from_dict(self, options): method __setstate__ (line 386) | def __setstate__(self, state): method copy (line 389) | def copy(self): method deepcopy (line 392) | def deepcopy(self): class DictAction (line 396) | class DictAction(Action): method _parse_int_float_bool (line 404) | def _parse_int_float_bool(val): method __call__ (line 419) | def __call__(self, parser, namespace, values, option_string=None): FILE: model_cards/groundingdino/util/slio.py class BaseFileHandler (line 23) | class BaseFileHandler(metaclass=ABCMeta): method load_from_fileobj (line 25) | def load_from_fileobj(self, file, **kwargs): method dump_to_fileobj (line 29) | def dump_to_fileobj(self, obj, file, **kwargs): method dump_to_str (line 33) | def dump_to_str(self, obj, **kwargs): method load_from_path (line 36) | def load_from_path(self, filepath, mode="r", **kwargs): method dump_to_path (line 40) | def dump_to_path(self, obj, filepath, mode="w", **kwargs): class JsonHandler (line 45) | class JsonHandler(BaseFileHandler): method load_from_fileobj (line 46) | def load_from_fileobj(self, file): method dump_to_fileobj (line 49) | def dump_to_fileobj(self, obj, file, **kwargs): method dump_to_str (line 52) | def dump_to_str(self, obj, **kwargs): class PickleHandler (line 56) | class PickleHandler(BaseFileHandler): method load_from_fileobj (line 57) | def load_from_fileobj(self, file, **kwargs): method load_from_path (line 60) | def load_from_path(self, filepath, **kwargs): method dump_to_str (line 63) | def dump_to_str(self, obj, **kwargs): method dump_to_fileobj (line 67) | def dump_to_fileobj(self, obj, file, **kwargs): method dump_to_path (line 71) | def dump_to_path(self, obj, filepath, **kwargs): class YamlHandler (line 75) | class YamlHandler(BaseFileHandler): method load_from_fileobj (line 76) | def load_from_fileobj(self, file, **kwargs): method dump_to_fileobj (line 80) | def dump_to_fileobj(self, obj, file, **kwargs): method dump_to_str (line 84) | def dump_to_str(self, obj, **kwargs): function is_str (line 102) | def is_str(x): function slload (line 110) | def slload(file, file_format=None, **kwargs): function sldump (line 143) | def sldump(obj, file=None, file_format=None, **kwargs): FILE: model_cards/groundingdino/util/time_counter.py class TimeCounter (line 5) | class TimeCounter: method __init__ (line 6) | def __init__(self) -> None: method clear (line 9) | def clear(self): method timeit (line 13) | def timeit(self, name): class TimeHolder (line 19) | class TimeHolder: method __init__ (line 20) | def __init__(self) -> None: method update (line 23) | def update(self, _timedict: dict): method final_res (line 29) | def final_res(self): method __str__ (line 32) | def __str__(self): class AverageMeter (line 36) | class AverageMeter(object): method __init__ (line 39) | def __init__(self, name, fmt=":f", val_only=False): method reset (line 45) | def reset(self): method update (line 51) | def update(self, val, n=1): method __str__ (line 57) | def __str__(self): FILE: model_cards/groundingdino/util/utils.py function slprint (line 15) | def slprint(x, name="x"): function clean_state_dict (line 29) | def clean_state_dict(state_dict): function renorm (line 38) | def renorm( class CocoClassMapper (line 66) | class CocoClassMapper: method __init__ (line 67) | def __init__(self) -> None: method origin2compact (line 153) | def origin2compact(self, idx): method compact2origin (line 156) | def compact2origin(self, idx): function to_device (line 160) | def to_device(item, device): function get_gaussian_mean (line 174) | def get_gaussian_mean(x, axis, other_axis, softmax=True): function get_expected_points_from_map (line 200) | def get_expected_points_from_map(hm, softmax=True): class Embedder (line 222) | class Embedder: method __init__ (line 223) | def __init__(self, **kwargs): method create_embedding_fn (line 227) | def create_embedding_fn(self): method embed (line 251) | def embed(self, inputs): function get_embedder (line 255) | def get_embedder(multires, i=0): class APOPMeter (line 275) | class APOPMeter: method __init__ (line 276) | def __init__(self) -> None: method update (line 282) | def update(self, pred, gt): method update_cm (line 293) | def update_cm(self, tp, fp, tn, fn): function inverse_sigmoid (line 300) | def inverse_sigmoid(x, eps=1e-5): function get_raw_dict (line 307) | def get_raw_dict(args): function stat_tensors (line 325) | def stat_tensors(tensor): class NiceRepr (line 340) | class NiceRepr: method __nice__ (line 374) | def __nice__(self): method __repr__ (line 384) | def __repr__(self): method __str__ (line 394) | def __str__(self): function ensure_rng (line 405) | def ensure_rng(rng=None): function random_boxes (line 436) | def random_boxes(num=1, scale=1, rng=None): class ModelEma (line 473) | class ModelEma(torch.nn.Module): method __init__ (line 474) | def __init__(self, model, decay=0.9997, device=None): method _update (line 487) | def _update(self, model, update_fn): method update (line 496) | def update(self, model): method set (line 499) | def set(self, model): class BestMetricSingle (line 503) | class BestMetricSingle: method __init__ (line 504) | def __init__(self, init_res=0.0, better="large") -> None: method isbetter (line 512) | def isbetter(self, new_res, old_res): method update (line 518) | def update(self, new_res, ep): method __str__ (line 525) | def __str__(self) -> str: method __repr__ (line 528) | def __repr__(self) -> str: method summary (line 531) | def summary(self) -> dict: class BestMetricHolder (line 538) | class BestMetricHolder: method __init__ (line 539) | def __init__(self, init_res=0.0, better="large", use_ema=False) -> None: method update (line 546) | def update(self, new_res, epoch, is_ema=False): method summary (line 560) | def summary(self): method __repr__ (line 570) | def __repr__(self) -> str: method __str__ (line 573) | def __str__(self) -> str: function targets_to (line 577) | def targets_to(targets: List[Dict[str, Any]], device): function get_phrases_from_posmap (line 599) | def get_phrases_from_posmap( FILE: model_cards/groundingdino/util/visualizer.py function renorm (line 22) | def renorm( class ColorMap (line 50) | class ColorMap: method __init__ (line 51) | def __init__(self, basergb=[255, 255, 0]): method __call__ (line 54) | def __call__(self, attnmap): function rainbow_text (line 66) | def rainbow_text(x, y, ls, lc, **kw): class COCOVisualizer (line 95) | class COCOVisualizer: method __init__ (line 96) | def __init__(self, coco=None, tokenlizer=None) -> None: method visualize (line 99) | def visualize(self, img, tgt, caption=None, dpi=180, savedir="vis"): method addtgt (line 135) | def addtgt(self, tgt): method showAnns (line 225) | def showAnns(self, anns, draw_bbox=False): FILE: model_cards/groundingdino/util/vl_utils.py function create_positive_map_from_span (line 8) | def create_positive_map_from_span(tokenized, token_span, max_text_len=256): function build_captions_and_token_span (line 49) | def build_captions_and_token_span(cat_list, force_lowercase): function build_id2posspan_and_caption (line 90) | def build_id2posspan_and_caption(category_dict: dict): FILE: model_cards/lama/bin/analyze_errors.py function draw_score (line 18) | def draw_score(img, score): function save_global_samples (line 30) | def save_global_samples(global_mask_fnames, mask2real_fname, mask2fake_f... function save_samples_by_real (line 49) | def save_samples_by_real(worst_best_by_real, mask2fake_fname, fake_info,... function extract_overlapping_masks (line 85) | def extract_overlapping_masks(mask_fnames, cur_i, fake_scores_table, max... function main (line 103) | def main(args): FILE: model_cards/lama/bin/blur_predicts.py function main (line 13) | def main(args): FILE: model_cards/lama/bin/calc_dataset_stats.py function main (line 13) | def main(args): FILE: model_cards/lama/bin/evaluate_predicts.py function main (line 14) | def main(args): FILE: model_cards/lama/bin/evaluator_example.py class SimpleImageDataset (line 14) | class SimpleImageDataset(Dataset): method __init__ (line 15) | def __init__(self, root_dir, image_size=(400, 600)): method __getitem__ (line 20) | def __getitem__(self, index): method __len__ (line 27) | def __len__(self): function create_rectangle_mask (line 31) | def create_rectangle_mask(height, width): class Model (line 39) | class Model(): method __call__ (line 40) | def __call__(self, img_batch, mask_batch): class SimpleImageSquareMaskDataset (line 46) | class SimpleImageSquareMaskDataset(Dataset): method __init__ (line 47) | def __init__(self, dataset): method __getitem__ (line 52) | def __getitem__(self, index): method __len__ (line 58) | def __len__(self): FILE: model_cards/lama/bin/extract_masks.py function main (line 6) | def main(args): FILE: model_cards/lama/bin/filter_sharded_dataset.py function is_good_key (line 13) | def is_good_key(key, cats): function main (line 17) | def main(args): FILE: model_cards/lama/bin/gen_debug_mask_dataset.py function generate_masks_for_img (line 16) | def generate_masks_for_img(infile, outmask_pattern, mask_size=200, step=... function main (line 34) | def main(args): FILE: model_cards/lama/bin/gen_mask_dataset.py class MakeManyMasksWrapper (line 17) | class MakeManyMasksWrapper: method __init__ (line 18) | def __init__(self, impl, variants_n=2): method get_masks (line 22) | def get_masks(self, img): function process_images (line 27) | def process_images(src_images, indir, outdir, config): function main (line 100) | def main(args): FILE: model_cards/lama/bin/gen_mask_dataset_hydra.py class MakeManyMasksWrapper (line 19) | class MakeManyMasksWrapper: method __init__ (line 20) | def __init__(self, impl, variants_n=2): method get_masks (line 24) | def get_masks(self, img): function process_images (line 29) | def process_images(src_images, indir, outdir, config): function main (line 104) | def main(config: OmegaConf): FILE: model_cards/lama/bin/gen_outpainting_dataset.py function main (line 34) | def main(args): FILE: model_cards/lama/bin/make_checkpoint.py function get_checkpoint_files (line 9) | def get_checkpoint_files(s): function main (line 16) | def main(args): FILE: model_cards/lama/bin/paper_runfiles/find_best_checkpoint.py function ssim_fid100_f1 (line 8) | def ssim_fid100_f1(metrics, fid_scale=100): function find_best_checkpoint (line 16) | def find_best_checkpoint(model_list, models_dir): FILE: model_cards/lama/bin/predict.py function main (line 39) | def main(predict_config: OmegaConf): FILE: model_cards/lama/bin/predict_inner_features.py function main (line 39) | def main(predict_config: OmegaConf): FILE: model_cards/lama/bin/report_from_tb.py function need_drop (line 21) | def need_drop(tag): function get_group_and_title (line 28) | def get_group_and_title(tag): function main (line 37) | def main(args): FILE: model_cards/lama/bin/sample_from_dataset.py function save_mask_for_sidebyside (line 13) | def save_mask_for_sidebyside(item, out_file): function save_img_for_sidebyside (line 20) | def save_img_for_sidebyside(item, out_file): function save_masked_img_for_sidebyside (line 25) | def save_masked_img_for_sidebyside(item, out_file): function main (line 35) | def main(args): FILE: model_cards/lama/bin/side_by_side.py function main (line 13) | def main(args): FILE: model_cards/lama/bin/split_tar.py function main (line 8) | def main(args): FILE: model_cards/lama/bin/to_jit.py class JITWrapper (line 14) | class JITWrapper(nn.Module): method __init__ (line 15) | def __init__(self, model): method forward (line 19) | def forward(self, image, mask): function main (line 29) | def main(predict_config: OmegaConf): FILE: model_cards/lama/bin/train.py function main (line 30) | def main(config: OmegaConf): FILE: model_cards/lama/models/ade20k/base.py class NormalizeTensor (line 25) | class NormalizeTensor: method __init__ (line 26) | def __init__(self, mean, std, inplace=False): method __call__ (line 44) | def __call__(self, tensor): class ModelBuilder (line 56) | class ModelBuilder: method weights_init (line 59) | def weights_init(m): method build_encoder (line 68) | def build_encoder(arch='resnet50dilated', fc_dim=512, weights=''): method build_decoder (line 98) | def build_decoder(arch='ppm_deepsup', method get_decoder (line 125) | def get_decoder(weights_path, arch_encoder, arch_decoder, fc_dim, drop... method get_encoder (line 130) | def get_encoder(weights_path, arch_encoder, arch_decoder, fc_dim, segm... function conv3x3_bn_relu (line 139) | def conv3x3_bn_relu(in_planes, out_planes, stride=1): class SegmentationModule (line 147) | class SegmentationModule(nn.Module): method __init__ (line 148) | def __init__(self, method normalize_input (line 194) | def normalize_input(self, tensor): method feature_maps_channels (line 200) | def feature_maps_channels(self): method forward (line 203) | def forward(self, img_data, segSize=None): method multi_mask_from_multiclass (line 215) | def multi_mask_from_multiclass(self, pred, classes): method multi_mask_from_multiclass_probs (line 221) | def multi_mask_from_multiclass_probs(scores, classes): method predict (line 230) | def predict(self, tensor, imgSizes=(-1,), # (300, 375, 450, 525, 600) method get_edges (line 277) | def get_edges(self, t): class PPMDeepsup (line 290) | class PPMDeepsup(nn.Module): method __init__ (line 291) | def __init__(self, num_class=NUM_CLASS, fc_dim=4096, method forward (line 320) | def forward(self, conv_out, segSize=None): class Resnet (line 355) | class Resnet(nn.Module): method __init__ (line 356) | def __init__(self, orig_resnet): method forward (line 375) | def forward(self, x, return_feature_maps=False): class ResnetDilated (line 393) | class ResnetDilated(nn.Module): method __init__ (line 394) | def __init__(self, orig_resnet, dilate_scale=8): method _nostride_dilate (line 423) | def _nostride_dilate(self, m, dilate): method forward (line 438) | def forward(self, x, return_feature_maps=False): class MobileNetV2Dilated (line 459) | class MobileNetV2Dilated(nn.Module): method __init__ (line 460) | def __init__(self, orig_net, dilate_scale=8): method _nostride_dilate (line 485) | def _nostride_dilate(self, m, dilate): method forward (line 500) | def forward(self, x, return_feature_maps=False): class C1DeepSup (line 515) | class C1DeepSup(nn.Module): method __init__ (line 516) | def __init__(self, num_class=150, fc_dim=2048, use_softmax=False, drop... method forward (line 528) | def forward(self, conv_out, segSize=None): class C1 (line 556) | class C1(nn.Module): method __init__ (line 557) | def __init__(self, num_class=150, fc_dim=2048, use_softmax=False): method forward (line 566) | def forward(self, conv_out, segSize=None): class PPM (line 582) | class PPM(nn.Module): method __init__ (line 583) | def __init__(self, num_class=150, fc_dim=4096, method forward (line 607) | def forward(self, conv_out, segSize=None): FILE: model_cards/lama/models/ade20k/mobilenet.py function conv_bn (line 22) | def conv_bn(inp, oup, stride): function conv_1x1_bn (line 30) | def conv_1x1_bn(inp, oup): class InvertedResidual (line 38) | class InvertedResidual(nn.Module): method __init__ (line 39) | def __init__(self, inp, oup, stride, expand_ratio): method forward (line 72) | def forward(self, x): class MobileNetV2 (line 79) | class MobileNetV2(nn.Module): method __init__ (line 80) | def __init__(self, n_class=1000, input_size=224, width_mult=1.): method forward (line 123) | def forward(self, x): method _initialize_weights (line 129) | def _initialize_weights(self): function mobilenetv2 (line 145) | def mobilenetv2(pretrained=False, **kwargs): FILE: model_cards/lama/models/ade20k/resnet.py function conv3x3 (line 18) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 24) | class BasicBlock(nn.Module): method __init__ (line 27) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 37) | def forward(self, x): class Bottleneck (line 56) | class Bottleneck(nn.Module): method __init__ (line 59) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 72) | def forward(self, x): class ResNet (line 95) | class ResNet(nn.Module): method __init__ (line 97) | def __init__(self, block, layers, num_classes=1000): method _make_layer (line 126) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 143) | def forward(self, x): function resnet50 (line 161) | def resnet50(pretrained=False, **kwargs): function resnet18 (line 173) | def resnet18(pretrained=False, **kwargs): FILE: model_cards/lama/models/ade20k/segm_lib/nn/modules/batchnorm.py function _sum_ft (line 24) | def _sum_ft(tensor): function _unsqueeze_ft (line 29) | def _unsqueeze_ft(tensor): class _SynchronizedBatchNorm (line 38) | class _SynchronizedBatchNorm(_BatchNorm): method __init__ (line 39) | def __init__(self, num_features, eps=1e-5, momentum=0.001, affine=True): method forward (line 56) | def forward(self, input): method __data_parallel_replicate__ (line 88) | def __data_parallel_replicate__(self, ctx, copy_id): method _data_parallel_master (line 98) | def _data_parallel_master(self, intermediates): method _add_weighted (line 119) | def _add_weighted(self, dest, delta, alpha=1, beta=1, bias=0): method _compute_mean_std (line 123) | def _compute_mean_std(self, sum_, ssum, size): class SynchronizedBatchNorm1d (line 142) | class SynchronizedBatchNorm1d(_SynchronizedBatchNorm): method _check_input_dim (line 198) | def _check_input_dim(self, input): class SynchronizedBatchNorm2d (line 205) | class SynchronizedBatchNorm2d(_SynchronizedBatchNorm): method _check_input_dim (line 261) | def _check_input_dim(self, input): class SynchronizedBatchNorm3d (line 268) | class SynchronizedBatchNorm3d(_SynchronizedBatchNorm): method _check_input_dim (line 325) | def _check_input_dim(self, input): FILE: model_cards/lama/models/ade20k/segm_lib/nn/modules/comm.py class FutureResult (line 18) | class FutureResult(object): method __init__ (line 21) | def __init__(self): method put (line 26) | def put(self, result): method get (line 32) | def get(self): class SlavePipe (line 46) | class SlavePipe(_SlavePipeBase): method run_slave (line 49) | def run_slave(self, msg): class SyncMaster (line 56) | class SyncMaster(object): method __init__ (line 67) | def __init__(self, master_callback): method register_slave (line 78) | def register_slave(self, identifier): method run_master (line 96) | def run_master(self, master_msg): method nr_slaves (line 130) | def nr_slaves(self): FILE: model_cards/lama/models/ade20k/segm_lib/nn/modules/replicate.py class CallbackContext (line 23) | class CallbackContext(object): function execute_replication_callbacks (line 27) | def execute_replication_callbacks(modules): class DataParallelWithCallback (line 50) | class DataParallelWithCallback(DataParallel): method replicate (line 64) | def replicate(self, module, device_ids): function patch_replication_callback (line 70) | def patch_replication_callback(data_parallel): FILE: model_cards/lama/models/ade20k/segm_lib/nn/modules/tests/test_numeric_batchnorm.py function handy_var (line 18) | def handy_var(a, unbias=True): class NumericTestCase (line 29) | class NumericTestCase(TorchTestCase): method testNumericBatchNorm (line 30) | def testNumericBatchNorm(self): FILE: model_cards/lama/models/ade20k/segm_lib/nn/modules/tests/test_sync_batchnorm.py function handy_var (line 19) | def handy_var(a, unbias=True): function _find_bn (line 30) | def _find_bn(module): class SyncTestCase (line 36) | class SyncTestCase(TorchTestCase): method _syncParameters (line 37) | def _syncParameters(self, bn1, bn2): method _checkBatchNormResult (line 44) | def _checkBatchNormResult(self, bn1, bn2, input, is_train, cuda=False): method testSyncBatchNormNormalTrain (line 67) | def testSyncBatchNormNormalTrain(self): method testSyncBatchNormNormalEval (line 73) | def testSyncBatchNormNormalEval(self): method testSyncBatchNormSyncTrain (line 79) | def testSyncBatchNormSyncTrain(self): method testSyncBatchNormSyncEval (line 89) | def testSyncBatchNormSyncEval(self): method testSyncBatchNorm2DSyncTrain (line 99) | def testSyncBatchNorm2DSyncTrain(self): FILE: model_cards/lama/models/ade20k/segm_lib/nn/modules/unittest.py function as_numpy (line 17) | def as_numpy(v): class TorchTestCase (line 23) | class TorchTestCase(unittest.TestCase): method assertTensorClose (line 24) | def assertTensorClose(self, a, b, atol=1e-3, rtol=1e-3): FILE: model_cards/lama/models/ade20k/segm_lib/nn/parallel/data_parallel.py function async_copy_to (line 13) | def async_copy_to(obj, dev, main_stream=None): function dict_gather (line 27) | def dict_gather(outputs, target_device, dim=0): class DictGatherDataParallel (line 48) | class DictGatherDataParallel(nn.DataParallel): method gather (line 49) | def gather(self, outputs, output_device): class UserScatteredDataParallel (line 53) | class UserScatteredDataParallel(DictGatherDataParallel): method scatter (line 54) | def scatter(self, inputs, kwargs, device_ids): function user_scattered_collate (line 65) | def user_scattered_collate(batch): function _async_copy (line 69) | def _async_copy(inputs, device_ids): function _async_copy_stream (line 82) | def _async_copy_stream(inputs, device_ids): function _get_stream (line 104) | def _get_stream(device): FILE: model_cards/lama/models/ade20k/segm_lib/utils/data/dataloader.py class ExceptionWrapper (line 25) | class ExceptionWrapper(object): method __init__ (line 28) | def __init__(self, exc_info): function _worker_loop (line 37) | def _worker_loop(dataset, index_queue, data_queue, collate_fn, seed, ini... function _worker_manager_loop (line 67) | def _worker_manager_loop(in_queue, out_queue, done_event, pin_memory, de... function default_collate (line 104) | def default_collate(batch): function pin_memory_batch (line 145) | def pin_memory_batch(batch): function _set_SIGCHLD_handler (line 163) | def _set_SIGCHLD_handler(): class DataLoaderIter (line 188) | class DataLoaderIter(object): method __init__ (line 191) | def __init__(self, loader): method __len__ (line 249) | def __len__(self): method _get_batch (line 252) | def _get_batch(self): method __next__ (line 261) | def __next__(self): method __iter__ (line 290) | def __iter__(self): method _put_indices (line 293) | def _put_indices(self): method _process_next_batch (line 302) | def _process_next_batch(self, batch): method __getstate__ (line 309) | def __getstate__(self): method _shutdown_workers (line 317) | def _shutdown_workers(self): method __del__ (line 336) | def __del__(self): class DataLoader (line 341) | class DataLoader(object): method __init__ (line 383) | def __init__(self, dataset, batch_size=1, shuffle=False, sampler=None,... method __iter__ (line 421) | def __iter__(self): method __len__ (line 424) | def __len__(self): FILE: model_cards/lama/models/ade20k/segm_lib/utils/data/dataset.py class Dataset (line 8) | class Dataset(object): method __getitem__ (line 16) | def __getitem__(self, index): method __len__ (line 19) | def __len__(self): method __add__ (line 22) | def __add__(self, other): class TensorDataset (line 26) | class TensorDataset(Dataset): method __init__ (line 37) | def __init__(self, data_tensor, target_tensor): method __getitem__ (line 42) | def __getitem__(self, index): method __len__ (line 45) | def __len__(self): class ConcatDataset (line 49) | class ConcatDataset(Dataset): method cumsum (line 61) | def cumsum(sequence): method __init__ (line 69) | def __init__(self, datasets): method __len__ (line 75) | def __len__(self): method __getitem__ (line 78) | def __getitem__(self, idx): method cummulative_sizes (line 87) | def cummulative_sizes(self): class Subset (line 93) | class Subset(Dataset): method __init__ (line 94) | def __init__(self, dataset, indices): method __getitem__ (line 98) | def __getitem__(self, idx): method __len__ (line 101) | def __len__(self): function random_split (line 105) | def random_split(dataset, lengths): FILE: model_cards/lama/models/ade20k/segm_lib/utils/data/distributed.py class DistributedSampler (line 7) | class DistributedSampler(Sampler): method __init__ (line 25) | def __init__(self, dataset, num_replicas=None, rank=None): method __iter__ (line 37) | def __iter__(self): method __len__ (line 54) | def __len__(self): method set_epoch (line 57) | def set_epoch(self, epoch): FILE: model_cards/lama/models/ade20k/segm_lib/utils/data/sampler.py class Sampler (line 4) | class Sampler(object): method __init__ (line 12) | def __init__(self, data_source): method __iter__ (line 15) | def __iter__(self): method __len__ (line 18) | def __len__(self): class SequentialSampler (line 22) | class SequentialSampler(Sampler): method __init__ (line 29) | def __init__(self, data_source): method __iter__ (line 32) | def __iter__(self): method __len__ (line 35) | def __len__(self): class RandomSampler (line 39) | class RandomSampler(Sampler): method __init__ (line 46) | def __init__(self, data_source): method __iter__ (line 49) | def __iter__(self): method __len__ (line 52) | def __len__(self): class SubsetRandomSampler (line 56) | class SubsetRandomSampler(Sampler): method __init__ (line 63) | def __init__(self, indices): method __iter__ (line 66) | def __iter__(self): method __len__ (line 69) | def __len__(self): class WeightedRandomSampler (line 73) | class WeightedRandomSampler(Sampler): method __init__ (line 84) | def __init__(self, weights, num_samples, replacement=True): method __iter__ (line 89) | def __iter__(self): method __len__ (line 92) | def __len__(self): class BatchSampler (line 96) | class BatchSampler(object): method __init__ (line 112) | def __init__(self, sampler, batch_size, drop_last): method __iter__ (line 117) | def __iter__(self): method __len__ (line 127) | def __len__(self): FILE: model_cards/lama/models/ade20k/segm_lib/utils/th.py function as_variable (line 8) | def as_variable(obj): function as_numpy (line 18) | def as_numpy(obj): function mark_volatile (line 30) | def mark_volatile(obj): FILE: model_cards/lama/models/ade20k/utils.py function load_url (line 15) | def load_url(url, model_dir='./pretrained', map_location=None): function color_encode (line 26) | def color_encode(labelmap, colors, mode='RGB'): FILE: model_cards/lama/saicinpainting/evaluation/__init__.py function make_evaluator (line 9) | def make_evaluator(kind='default', ssim=True, lpips=True, fid=True, inte... FILE: model_cards/lama/saicinpainting/evaluation/data.py function load_image (line 12) | def load_image(fname, mode='RGB', return_orig=False): function ceil_modulo (line 23) | def ceil_modulo(x, mod): function pad_img_to_modulo (line 29) | def pad_img_to_modulo(img, mod): function pad_tensor_to_modulo (line 36) | def pad_tensor_to_modulo(img, mod): function scale_image (line 43) | def scale_image(img, factor, interpolation=cv2.INTER_AREA): class InpaintingDataset (line 58) | class InpaintingDataset(Dataset): method __init__ (line 59) | def __init__(self, datadir, img_suffix='.jpg', pad_out_to_modulo=None,... method __len__ (line 66) | def __len__(self): method __getitem__ (line 69) | def __getitem__(self, i): class OurInpaintingDataset (line 85) | class OurInpaintingDataset(Dataset): method __init__ (line 86) | def __init__(self, datadir, img_suffix='.jpg', pad_out_to_modulo=None,... method __len__ (line 93) | def __len__(self): method __getitem__ (line 96) | def __getitem__(self, i): class PrecomputedInpaintingResultsDataset (line 110) | class PrecomputedInpaintingResultsDataset(InpaintingDataset): method __init__ (line 111) | def __init__(self, datadir, predictdir, inpainted_suffix='_inpainted.j... method __getitem__ (line 119) | def __getitem__(self, i): class OurPrecomputedInpaintingResultsDataset (line 126) | class OurPrecomputedInpaintingResultsDataset(OurInpaintingDataset): method __init__ (line 127) | def __init__(self, datadir, predictdir, inpainted_suffix="png", **kwar... method __getitem__ (line 137) | def __getitem__(self, i): class InpaintingEvalOnlineDataset (line 145) | class InpaintingEvalOnlineDataset(Dataset): method __init__ (line 146) | def __init__(self, indir, mask_generator, img_suffix='.jpg', pad_out_t... method __len__ (line 153) | def __len__(self): method __getitem__ (line 156) | def __getitem__(self, i): FILE: model_cards/lama/saicinpainting/evaluation/evaluator.py class InpaintingEvaluator (line 16) | class InpaintingEvaluator(): method __init__ (line 17) | def __init__(self, dataset, scores, area_grouping=True, bins=10, batch... method _get_bin_edges (line 42) | def _get_bin_edges(self): method evaluate (line 67) | def evaluate(self, model=None): function ssim_fid100_f1 (line 112) | def ssim_fid100_f1(metrics, fid_scale=100): function lpips_fid100_f1 (line 120) | def lpips_fid100_f1(metrics, fid_scale=100): class InpaintingEvaluatorOnline (line 129) | class InpaintingEvaluatorOnline(nn.Module): method __init__ (line 130) | def __init__(self, scores, bins=10, image_key='image', inpainted_key='... method _get_bins (line 162) | def _get_bins(self, mask_batch): method forward (line 168) | def forward(self, batch: Dict[str, torch.Tensor]): method process_batch (line 186) | def process_batch(self, batch: Dict[str, torch.Tensor]): method evaluation_end (line 189) | def evaluation_end(self, states=None): FILE: model_cards/lama/saicinpainting/evaluation/losses/base_loss.py function get_groupings (line 21) | def get_groupings(groups): class EvaluatorScore (line 40) | class EvaluatorScore(nn.Module): method forward (line 42) | def forward(self, pred_batch, target_batch, mask): method get_value (line 46) | def get_value(self, groups=None, states=None): method reset (line 50) | def reset(self): class PairwiseScore (line 54) | class PairwiseScore(EvaluatorScore, ABC): method __init__ (line 55) | def __init__(self): method get_value (line 59) | def get_value(self, groups=None, states=None): method reset (line 88) | def reset(self): class SSIMScore (line 92) | class SSIMScore(PairwiseScore): method __init__ (line 93) | def __init__(self, window_size=11): method forward (line 98) | def forward(self, pred_batch, target_batch, mask=None): class LPIPSScore (line 106) | class LPIPSScore(PairwiseScore): method __init__ (line 107) | def __init__(self, model='net-lin', net='vgg', model_path=None, use_gp... method forward (line 113) | def forward(self, pred_batch, target_batch, mask=None): function fid_calculate_activation_statistics (line 121) | def fid_calculate_activation_statistics(act): function calculate_frechet_distance (line 127) | def calculate_frechet_distance(activations_pred, activations_target, eps... class FIDScore (line 156) | class FIDScore(EvaluatorScore): method __init__ (line 157) | def __init__(self, dims=2048, eps=1e-6): method forward (line 168) | def forward(self, pred_batch, target_batch, mask=None): method get_value (line 177) | def get_value(self, groups=None, states=None): method reset (line 207) | def reset(self): method _get_activations (line 211) | def _get_activations(self, batch): class SegmentationAwareScore (line 221) | class SegmentationAwareScore(EvaluatorScore): method __init__ (line 222) | def __init__(self, weights_path): method forward (line 229) | def forward(self, pred_batch, target_batch, mask): method reset (line 256) | def reset(self): function distribute_values_to_classes (line 263) | def distribute_values_to_classes(target_class_freq_by_image_mask, values... function get_segmentation_idx2name (line 271) | def get_segmentation_idx2name(): class SegmentationAwarePairwiseScore (line 275) | class SegmentationAwarePairwiseScore(SegmentationAwareScore): method __init__ (line 276) | def __init__(self, *args, **kwargs): method forward (line 281) | def forward(self, pred_batch, target_batch, mask): method calc_score (line 288) | def calc_score(self, pred_batch, target_batch, mask): method get_value (line 291) | def get_value(self, groups=None, states=None): method reset (line 336) | def reset(self): class SegmentationClassStats (line 341) | class SegmentationClassStats(SegmentationAwarePairwiseScore): method calc_score (line 342) | def calc_score(self, pred_batch, target_batch, mask): method get_value (line 345) | def get_value(self, groups=None, states=None): class SegmentationAwareSSIM (line 420) | class SegmentationAwareSSIM(SegmentationAwarePairwiseScore): method __init__ (line 421) | def __init__(self, *args, window_size=11, **kwargs): method calc_score (line 425) | def calc_score(self, pred_batch, target_batch, mask): class SegmentationAwareLPIPS (line 429) | class SegmentationAwareLPIPS(SegmentationAwarePairwiseScore): method __init__ (line 430) | def __init__(self, *args, model='net-lin', net='vgg', model_path=None,... method calc_score (line 435) | def calc_score(self, pred_batch, target_batch, mask): function calculade_fid_no_img (line 439) | def calculade_fid_no_img(img_i, activations_pred, activations_target, ep... class SegmentationAwareFID (line 445) | class SegmentationAwareFID(SegmentationAwarePairwiseScore): method __init__ (line 446) | def __init__(self, *args, dims=2048, eps=1e-6, n_jobs=-1, **kwargs): method calc_score (line 455) | def calc_score(self, pred_batch, target_batch, mask): method get_value (line 460) | def get_value(self, groups=None, states=None): method distribute_fid_to_classes (line 513) | def distribute_fid_to_classes(self, class_freq, activations_pred, acti... method _get_activations (line 523) | def _get_activations(self, batch): FILE: model_cards/lama/saicinpainting/evaluation/losses/fid/fid_score.py function tqdm (line 52) | def tqdm(x): return x function get_activations (line 76) | def get_activations(files, model, batch_size=50, dims=2048, function calculate_frechet_distance (line 160) | def calculate_frechet_distance(mu1, sigma1, mu2, sigma2, eps=1e-6): function calculate_activation_statistics (line 218) | def calculate_activation_statistics(files, model, batch_size=50, function _compute_statistics_of_path (line 243) | def _compute_statistics_of_path(path, model, batch_size, dims, cuda): function _compute_statistics_of_images (line 257) | def _compute_statistics_of_images(images, model, batch_size, dims, cuda,... function calculate_fid_given_paths (line 268) | def calculate_fid_given_paths(paths, batch_size, cuda, dims): function calculate_fid_given_images (line 289) | def calculate_fid_given_images(images, batch_size, cuda, dims, use_globa... FILE: model_cards/lama/saicinpainting/evaluation/losses/fid/inception.py class InceptionV3 (line 21) | class InceptionV3(nn.Module): method __init__ (line 36) | def __init__(self, method forward (line 134) | def forward(self, inp): function fid_inception_v3 (line 171) | def fid_inception_v3(): class FIDInceptionA (line 206) | class FIDInceptionA(models.inception.InceptionA): method __init__ (line 208) | def __init__(self, in_channels, pool_features): method forward (line 211) | def forward(self, x): class FIDInceptionC (line 231) | class FIDInceptionC(models.inception.InceptionC): method __init__ (line 233) | def __init__(self, in_channels, channels_7x7): method forward (line 236) | def forward(self, x): class FIDInceptionE_1 (line 259) | class FIDInceptionE_1(models.inception.InceptionE): method __init__ (line 261) | def __init__(self, in_channels): method forward (line 264) | def forward(self, x): class FIDInceptionE_2 (line 292) | class FIDInceptionE_2(models.inception.InceptionE): method __init__ (line 294) | def __init__(self, in_channels): method forward (line 297) | def forward(self, x): FILE: model_cards/lama/saicinpainting/evaluation/losses/lpips.py class PerceptualLoss (line 18) | class PerceptualLoss(torch.nn.Module): method __init__ (line 19) | def __init__(self, model='net-lin', net='alex', colorspace='rgb', mode... method forward (line 29) | def forward(self, pred, target, normalize=True): function normalize_tensor (line 45) | def normalize_tensor(in_feat, eps=1e-10): function l2 (line 50) | def l2(p0, p1, range=255.): function psnr (line 54) | def psnr(p0, p1, peak=255.): function dssim (line 58) | def dssim(p0, p1, range=255.): function rgb2lab (line 62) | def rgb2lab(in_img, mean_cent=False): function tensor2np (line 70) | def tensor2np(tensor_obj): function np2tensor (line 75) | def np2tensor(np_obj): function tensor2tensorlab (line 80) | def tensor2tensorlab(image_tensor, to_norm=True, mc_only=False): function tensorlab2tensor (line 95) | def tensorlab2tensor(lab_tensor, return_inbnd=False): function rgb2lab (line 114) | def rgb2lab(input): function tensor2im (line 119) | def tensor2im(image_tensor, imtype=np.uint8, cent=1., factor=255. / 2.): function im2tensor (line 125) | def im2tensor(image, imtype=np.uint8, cent=1., factor=255. / 2.): function tensor2vec (line 130) | def tensor2vec(vector_tensor): function voc_ap (line 134) | def voc_ap(rec, prec, use_07_metric=False): function tensor2im (line 168) | def tensor2im(image_tensor, imtype=np.uint8, cent=1., factor=255. / 2.): function im2tensor (line 175) | def im2tensor(image, imtype=np.uint8, cent=1., factor=255. / 2.): class BaseModel (line 186) | class BaseModel(torch.nn.Module): method __init__ (line 187) | def __init__(self): method name (line 190) | def name(self): method initialize (line 193) | def initialize(self, use_gpu=True): method forward (line 196) | def forward(self): method get_image_paths (line 199) | def get_image_paths(self): method optimize_parameters (line 202) | def optimize_parameters(self): method get_current_visuals (line 205) | def get_current_visuals(self): method get_current_errors (line 208) | def get_current_errors(self): method save (line 211) | def save(self, label): method save_network (line 215) | def save_network(self, network, path, network_label, epoch_label): method load_network (line 221) | def load_network(self, network, network_label, epoch_label): method update_learning_rate (line 227) | def update_learning_rate(): method get_image_paths (line 230) | def get_image_paths(self): method save_done (line 233) | def save_done(self, flag=False): class DistModel (line 248) | class DistModel(BaseModel): method name (line 249) | def name(self): method initialize (line 252) | def initialize(self, model='net-lin', net='alex', colorspace='Lab', pn... method forward (line 330) | def forward(self, in0, in1, retPerLayer=False): method optimize_parameters (line 341) | def optimize_parameters(self): method clamp_weights (line 348) | def clamp_weights(self): method set_input (line 353) | def set_input(self, data): method forward_train (line 369) | def forward_train(self): # run forward pass method backward_train (line 385) | def backward_train(self): method compute_accuracy (line 388) | def compute_accuracy(self, d0, d1, judge): method get_current_errors (line 394) | def get_current_errors(self): method get_current_visuals (line 403) | def get_current_visuals(self): method save (line 418) | def save(self, path, label): method update_learning_rate (line 425) | def update_learning_rate(self, nepoch_decay): function score_2afc_dataset (line 436) | def score_2afc_dataset(data_loader, func, name=''): function score_jnd_dataset (line 472) | def score_jnd_dataset(data_loader, func, name=''): function spatial_average (line 521) | def spatial_average(in_tens, keepdim=True): function upsample (line 525) | def upsample(in_tens, out_H=64): # assumes scale factor is same for H a... class PNetLin (line 533) | class PNetLin(nn.Module): method __init__ (line 534) | def __init__(self, pnet_type='vgg', pnet_rand=False, pnet_tune=False, ... method forward (line 571) | def forward(self, in0, in1, retPerLayer=False): class ScalingLayer (line 603) | class ScalingLayer(nn.Module): method __init__ (line 604) | def __init__(self): method forward (line 609) | def forward(self, inp): class NetLinLayer (line 613) | class NetLinLayer(nn.Module): method __init__ (line 616) | def __init__(self, chn_in, chn_out=1, use_dropout=False): class Dist2LogitLayer (line 624) | class Dist2LogitLayer(nn.Module): method __init__ (line 627) | def __init__(self, chn_mid=32, use_sigmoid=True): method forward (line 639) | def forward(self, d0, d1, eps=0.1): class BCERankingLoss (line 643) | class BCERankingLoss(nn.Module): method __init__ (line 644) | def __init__(self, chn_mid=32): method forward (line 650) | def forward(self, d0, d1, judge): class FakeNet (line 657) | class FakeNet(nn.Module): method __init__ (line 658) | def __init__(self, use_gpu=True, colorspace='Lab'): class L2 (line 664) | class L2(FakeNet): method forward (line 666) | def forward(self, in0, in1, retPerLayer=None): class DSSIM (line 683) | class DSSIM(FakeNet): method forward (line 685) | def forward(self, in0, in1, retPerLayer=None): function print_network (line 699) | def print_network(net): class squeezenet (line 716) | class squeezenet(torch.nn.Module): method __init__ (line 717) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 746) | def forward(self, X): class alexnet (line 767) | class alexnet(torch.nn.Module): method __init__ (line 768) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 791) | def forward(self, X): class vgg16 (line 808) | class vgg16(torch.nn.Module): method __init__ (line 809) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 832) | def forward(self, X): class resnet (line 849) | class resnet(torch.nn.Module): method __init__ (line 850) | def __init__(self, requires_grad=False, pretrained=True, num=18): method forward (line 873) | def forward(self, X): FILE: model_cards/lama/saicinpainting/evaluation/losses/ssim.py class SSIM (line 6) | class SSIM(torch.nn.Module): method __init__ (line 11) | def __init__(self, window_size=11, size_average=True): method forward (line 18) | def forward(self, img1, img2): method _gaussian (line 36) | def _gaussian(self, window_size, sigma): method _create_window (line 42) | def _create_window(self, window_size, channel): method _ssim (line 47) | def _ssim(self, img1, img2, window, window_size, channel, size_average... method _load_from_state_dict (line 73) | def _load_from_state_dict(self, state_dict, prefix, local_metadata, st... FILE: model_cards/lama/saicinpainting/evaluation/masks/countless/countless2d.py function simplest_countless (line 25) | def simplest_countless(data): function quick_countless (line 52) | def quick_countless(data): function quickest_countless (line 77) | def quickest_countless(data): function quick_countless_xor (line 100) | def quick_countless_xor(data): function stippled_countless (line 124) | def stippled_countless(data): function zero_corrected_countless (line 151) | def zero_corrected_countless(data): function countless_extreme (line 195) | def countless_extreme(data): function countless (line 212) | def countless(data): function upgrade_type (line 252) | def upgrade_type(arr): function downgrade_type (line 264) | def downgrade_type(arr): function odd_to_even (line 276) | def odd_to_even(image): function counting (line 310) | def counting(array): function ndzoom (line 340) | def ndzoom(array): function countless_if (line 347) | def countless_if(array): function downsample_with_averaging (line 376) | def downsample_with_averaging(array): function downsample_with_max_pooling (line 401) | def downsample_with_max_pooling(array): function striding (line 421) | def striding(array): function benchmark (line 431) | def benchmark(): FILE: model_cards/lama/saicinpainting/evaluation/masks/countless/countless3d.py function countless5 (line 17) | def countless5(a,b,c,d,e): function countless8 (line 50) | def countless8(a,b,c,d,e,f,g,h): function dynamic_countless3d (line 74) | def dynamic_countless3d(data): function countless3d (line 133) | def countless3d(data): function countless_generalized (line 169) | def countless_generalized(data, factor): function dynamic_countless_generalized (line 209) | def dynamic_countless_generalized(data, factor): function downsample_with_averaging (line 261) | def downsample_with_averaging(array): function downsample_with_max_pooling (line 282) | def downsample_with_max_pooling(array): function striding (line 299) | def striding(array): function benchmark (line 309) | def benchmark(): FILE: model_cards/lama/saicinpainting/evaluation/masks/countless/test.py function test_countless2d (line 8) | def test_countless2d(): function test_stippled_countless2d (line 55) | def test_stippled_countless2d(): function test_countless3d (line 113) | def test_countless3d(): FILE: model_cards/lama/saicinpainting/evaluation/masks/mask.py class ObjectMask (line 19) | class ObjectMask(): method __init__ (line 20) | def __init__(self, mask): method _get_limits (line 26) | def _get_limits(mask): method _clean (line 40) | def _clean(self): method horizontal_flip (line 44) | def horizontal_flip(self, inplace=False): method vertical_flip (line 52) | def vertical_flip(self, inplace=False): method image_center (line 60) | def image_center(self): method rescale (line 65) | def rescale(self, scaling_factor, inplace=False): method crop_to_canvas (line 82) | def crop_to_canvas(self, vertical=True, horizontal=True, inplace=False): method restore_full_mask (line 114) | def restore_full_mask(self, allow_crop=False): method shift (line 120) | def shift(self, vertical=0, horizontal=0, inplace=False): method area (line 131) | def area(self): class RigidnessMode (line 135) | class RigidnessMode(enum.Enum): class SegmentationMask (line 140) | class SegmentationMask: method __init__ (line 141) | def __init__(self, confidence_threshold=0.5, rigidness_mode=RigidnessM... method get_segmentation (line 191) | def get_segmentation(self, img): method _is_power_of_two (line 197) | def _is_power_of_two(n): method identify_candidates (line 200) | def identify_candidates(self, panoptic_seg, segments_info): method downsample_mask (line 212) | def downsample_mask(self, mask): method _augmentation_params (line 230) | def _augmentation_params(self): method _get_intersection (line 244) | def _get_intersection(self, mask_array, mask_object): method _check_masks_intersection (line 250) | def _check_masks_intersection(self, aug_mask, total_mask_area, prev_ma... method _check_foreground_intersection (line 260) | def _check_foreground_intersection(self, aug_mask, foreground): method _move_mask (line 271) | def _move_mask(self, mask, foreground): method _prepare_mask (line 351) | def _prepare_mask(self, mask): method get_masks (line 358) | def get_masks(self, im, return_panoptic=False): function propose_random_square_crop (line 410) | def propose_random_square_crop(mask, min_overlap=0.5): FILE: model_cards/lama/saicinpainting/evaluation/refinement.py function _pyrdown (line 19) | def _pyrdown(im : torch.Tensor, downsize : tuple=None): function _pyrdown_mask (line 28) | def _pyrdown_mask(mask : torch.Tensor, downsize : tuple=None, eps : floa... function _erode_mask (line 66) | def _erode_mask(mask : torch.Tensor, ekernel : torch.Tensor=None, eps : ... function _l1_loss (line 75) | def _l1_loss( function _infer (line 86) | def _infer( function _get_image_mask_pyramid (line 176) | def _get_image_mask_pyramid(batch : dict, min_side : int, max_scales : i... function refine_predict (line 228) | def refine_predict( FILE: model_cards/lama/saicinpainting/evaluation/utils.py function load_yaml (line 9) | def load_yaml(path): function move_to_device (line 14) | def move_to_device(obj, device): class SmallMode (line 26) | class SmallMode(Enum): FILE: model_cards/lama/saicinpainting/evaluation/vis.py function save_item_for_vis (line 6) | def save_item_for_vis(item, out_file): function save_mask_for_sidebyside (line 27) | def save_mask_for_sidebyside(item, out_file): function save_img_for_sidebyside (line 34) | def save_img_for_sidebyside(item, out_file): FILE: model_cards/lama/saicinpainting/training/data/aug.py class IAAAffine2 (line 4) | class IAAAffine2(DualIAATransform): method __init__ (line 17) | def __init__( method processor (line 41) | def processor(self): method get_transform_init_args_names (line 53) | def get_transform_init_args_names(self): class IAAPerspective2 (line 57) | class IAAPerspective2(DualIAATransform): method __init__ (line 71) | def __init__(self, scale=(0.05, 0.1), keep_size=True, always_apply=Fal... method processor (line 80) | def processor(self): method get_transform_init_args_names (line 83) | def get_transform_init_args_names(self): FILE: model_cards/lama/saicinpainting/training/data/datasets.py class InpaintingTrainDataset (line 25) | class InpaintingTrainDataset(Dataset): method __init__ (line 26) | def __init__(self, indir, mask_generator, transform): method __len__ (line 32) | def __len__(self): method __getitem__ (line 35) | def __getitem__(self, item): class InpaintingTrainWebDataset (line 48) | class InpaintingTrainWebDataset(IterableDataset): method __init__ (line 49) | def __init__(self, indir, mask_generator, transform, shuffle_buffer=200): method __iter__ (line 54) | def __iter__(self): class ImgSegmentationDataset (line 64) | class ImgSegmentationDataset(Dataset): method __init__ (line 65) | def __init__(self, indir, mask_generator, transform, out_size, segm_in... method __len__ (line 74) | def __len__(self): method __getitem__ (line 77) | def __getitem__(self, item): method load_semantic_segm (line 92) | def load_semantic_segm(self, img_path): function get_transforms (line 101) | def get_transforms(transform_variant, out_size): function make_default_train_dataloader (line 206) | def make_default_train_dataloader(indir, kind='default', out_size=512, m... function make_default_val_dataset (line 249) | def make_default_val_dataset(indir, kind='default', out_size=512, transf... function make_default_val_dataloader (line 283) | def make_default_val_dataloader(*args, dataloader_kwargs=None, **kwargs): function make_constant_area_crop_params (line 292) | def make_constant_area_crop_params(img_height, img_width, min_size=128, ... FILE: model_cards/lama/saicinpainting/training/data/masks.py class DrawMethod (line 16) | class DrawMethod(Enum): function make_random_irregular_mask (line 22) | def make_random_irregular_mask(shape, max_angle=4, max_len=60, max_width... class RandomIrregularMaskGenerator (line 51) | class RandomIrregularMaskGenerator: method __init__ (line 52) | def __init__(self, max_angle=4, max_len=60, max_width=20, min_times=0,... method __call__ (line 62) | def __call__(self, img, iter_i=None, raw_image=None): function make_random_rectangle_mask (line 72) | def make_random_rectangle_mask(shape, margin=10, bbox_min_size=30, bbox_... class RandomRectangleMaskGenerator (line 86) | class RandomRectangleMaskGenerator: method __init__ (line 87) | def __init__(self, margin=10, bbox_min_size=30, bbox_max_size=100, min... method __call__ (line 95) | def __call__(self, img, iter_i=None, raw_image=None): class RandomSegmentationMaskGenerator (line 104) | class RandomSegmentationMaskGenerator: method __init__ (line 105) | def __init__(self, **kwargs): method __call__ (line 109) | def __call__(self, img, iter_i=None, raw_image=None): function make_random_superres_mask (line 118) | def make_random_superres_mask(shape, min_step=2, max_step=4, min_width=1... class RandomSuperresMaskGenerator (line 136) | class RandomSuperresMaskGenerator: method __init__ (line 137) | def __init__(self, **kwargs): method __call__ (line 140) | def __call__(self, img, iter_i=None): class DumbAreaMaskGenerator (line 144) | class DumbAreaMaskGenerator: method __init__ (line 149) | def __init__(self, is_training): method _random_vector (line 154) | def _random_vector(self, dimension): method __call__ (line 167) | def __call__(self, img, iter_i=None, raw_image=None): class OutpaintingMaskGenerator (line 176) | class OutpaintingMaskGenerator: method __init__ (line 177) | def __init__(self, min_padding_percent:float=0.04, max_padding_percent... method apply_padding (line 195) | def apply_padding(self, mask, coord): method get_padding (line 200) | def get_padding(self, size): method _img2rs (line 206) | def _img2rs(img): method __call__ (line 212) | def __call__(self, img, iter_i=None, raw_image=None): class MixedMaskGenerator (line 252) | class MixedMaskGenerator: method __init__ (line 253) | def __init__(self, irregular_proba=1/3, irregular_kwargs=None, method __call__ (line 309) | def __call__(self, img, iter_i=None, raw_image=None): function get_mask_generator (line 318) | def get_mask_generator(kind, kwargs): FILE: model_cards/lama/saicinpainting/training/losses/adversarial.py class BaseAdversarialLoss (line 8) | class BaseAdversarialLoss: method pre_generator_step (line 9) | def pre_generator_step(self, real_batch: torch.Tensor, fake_batch: tor... method pre_discriminator_step (line 20) | def pre_discriminator_step(self, real_batch: torch.Tensor, fake_batch:... method generator_loss (line 31) | def generator_loss(self, real_batch: torch.Tensor, fake_batch: torch.T... method discriminator_loss (line 46) | def discriminator_loss(self, real_batch: torch.Tensor, fake_batch: tor... method interpolate_mask (line 61) | def interpolate_mask(self, mask, shape): function make_r1_gp (line 71) | def make_r1_gp(discr_real_pred, real_batch): class NonSaturatingWithR1 (line 81) | class NonSaturatingWithR1(BaseAdversarialLoss): method __init__ (line 82) | def __init__(self, gp_coef=5, weight=1, mask_as_fake_target=False, all... method generator_loss (line 101) | def generator_loss(self, real_batch: torch.Tensor, fake_batch: torch.T... method pre_discriminator_step (line 117) | def pre_discriminator_step(self, real_batch: torch.Tensor, fake_batch:... method discriminator_loss (line 121) | def discriminator_loss(self, real_batch: torch.Tensor, fake_batch: tor... class BCELoss (line 145) | class BCELoss(BaseAdversarialLoss): method __init__ (line 146) | def __init__(self, weight): method generator_loss (line 150) | def generator_loss(self, discr_fake_pred: torch.Tensor) -> Tuple[torch... method pre_discriminator_step (line 155) | def pre_discriminator_step(self, real_batch: torch.Tensor, fake_batch:... method discriminator_loss (line 159) | def discriminator_loss(self, function make_discrim_loss (line 172) | def make_discrim_loss(kind, **kwargs): FILE: model_cards/lama/saicinpainting/training/losses/distance_weighting.py function dummy_distance_weighter (line 9) | def dummy_distance_weighter(real_img, pred_img, mask): function get_gauss_kernel (line 13) | def get_gauss_kernel(kernel_size, width_factor=1): class BlurMask (line 22) | class BlurMask(nn.Module): method __init__ (line 23) | def __init__(self, kernel_size=5, width_factor=1): method forward (line 28) | def forward(self, real_img, pred_img, mask): class EmulatedEDTMask (line 34) | class EmulatedEDTMask(nn.Module): method __init__ (line 35) | def __init__(self, dilate_kernel_size=5, blur_kernel_size=5, width_fac... method forward (line 43) | def forward(self, real_img, pred_img, mask): class PropagatePerceptualSim (line 51) | class PropagatePerceptualSim(nn.Module): method __init__ (line 52) | def __init__(self, level=2, max_iters=10, temperature=500, erode_mask_... method forward (line 82) | def forward(self, real_img, pred_img, mask): function make_mask_distance_weighter (line 117) | def make_mask_distance_weighter(kind='none', **kwargs): FILE: model_cards/lama/saicinpainting/training/losses/feature_matching.py function masked_l2_loss (line 7) | def masked_l2_loss(pred, target, mask, weight_known, weight_missing): function masked_l1_loss (line 13) | def masked_l1_loss(pred, target, mask, weight_known, weight_missing): function feature_matching_loss (line 19) | def feature_matching_loss(fake_features: List[torch.Tensor], target_feat... FILE: model_cards/lama/saicinpainting/training/losses/perceptual.py class PerceptualLoss (line 14) | class PerceptualLoss(nn.Module): method __init__ (line 15) | def __init__(self, normalize_inputs=True): method do_normalize_inputs (line 38) | def do_normalize_inputs(self, x): method partial_losses (line 41) | def partial_losses(self, input, target, mask=None): method forward (line 72) | def forward(self, input, target, mask=None): method get_global_features (line 76) | def get_global_features(self, input): class ResNetPL (line 88) | class ResNetPL(nn.Module): method __init__ (line 89) | def __init__(self, weight=1, method forward (line 103) | def forward(self, pred, target): FILE: model_cards/lama/saicinpainting/training/losses/segmentation.py class CrossEntropy2d (line 8) | class CrossEntropy2d(nn.Module): method __init__ (line 9) | def __init__(self, reduction="mean", ignore_label=255, weights=None, *... method forward (line 22) | def forward(self, predict, target): FILE: model_cards/lama/saicinpainting/training/losses/style_loss.py class PerceptualLoss (line 6) | class PerceptualLoss(nn.Module): method __init__ (line 13) | def __init__(self, weights=[1.0, 1.0, 1.0, 1.0, 1.0]): method __call__ (line 19) | def __call__(self, x, y): class VGG19 (line 34) | class VGG19(torch.nn.Module): method __init__ (line 35) | def __init__(self): method forward (line 111) | def forward(self, x): FILE: model_cards/lama/saicinpainting/training/modules/__init__.py function make_generator (line 7) | def make_generator(config, kind, **kwargs): function make_discriminator (line 22) | def make_discriminator(kind, **kwargs): FILE: model_cards/lama/saicinpainting/training/modules/base.py class BaseDiscriminator (line 11) | class BaseDiscriminator(nn.Module): method forward (line 13) | def forward(self, x: torch.Tensor) -> Tuple[torch.Tensor, List[torch.T... function get_conv_block_ctor (line 21) | def get_conv_block_ctor(kind='default'): function get_norm_layer (line 33) | def get_norm_layer(kind='bn'): function get_activation (line 43) | def get_activation(kind='tanh'): class SimpleMultiStepGenerator (line 53) | class SimpleMultiStepGenerator(nn.Module): method __init__ (line 54) | def __init__(self, steps: List[nn.Module]): method forward (line 58) | def forward(self, x): function deconv_factory (line 67) | def deconv_factory(kind, ngf, mult, norm_layer, activation, max_features): FILE: model_cards/lama/saicinpainting/training/modules/depthwise_sep_conv.py class DepthWiseSeperableConv (line 4) | class DepthWiseSeperableConv(nn.Module): method __init__ (line 5) | def __init__(self, in_dim, out_dim, *args, **kwargs): method forward (line 14) | def forward(self, x): FILE: model_cards/lama/saicinpainting/training/modules/fake_fakes.py class FakeFakesGenerator (line 6) | class FakeFakesGenerator: method __init__ (line 7) | def __init__(self, aug_proba=0.5, img_aug_degree=30, img_aug_translate... method __call__ (line 20) | def __call__(self, input_images, masks): method _make_blend_target (line 26) | def _make_blend_target(self, input_images): method _fill_masks_with_gradient (line 34) | def _fill_masks_with_gradient(self, masks): FILE: model_cards/lama/saicinpainting/training/modules/ffc.py class FFCSE_block (line 16) | class FFCSE_block(nn.Module): method __init__ (line 18) | def __init__(self, channels, ratio_g): method forward (line 34) | def forward(self, x): class FourierUnit (line 49) | class FourierUnit(nn.Module): method __init__ (line 51) | def __init__(self, in_channels, out_channels, groups=1, spatial_scale_... method forward (line 76) | def forward(self, x): class SpectralTransform (line 116) | class SpectralTransform(nn.Module): method __init__ (line 118) | def __init__(self, in_channels, out_channels, stride=1, groups=1, enab... method forward (line 142) | def forward(self, x): class FFC (line 166) | class FFC(nn.Module): method __init__ (line 168) | def __init__(self, in_channels, out_channels, kernel_size, method forward (line 205) | def forward(self, x): class FFC_BN_ACT (line 228) | class FFC_BN_ACT(nn.Module): method __init__ (line 230) | def __init__(self, in_channels, out_channels, method forward (line 251) | def forward(self, x): class FFCResnetBlock (line 258) | class FFCResnetBlock(nn.Module): method __init__ (line 259) | def __init__(self, dim, padding_type, norm_layer, activation_layer=nn.... method forward (line 277) | def forward(self, x): class ConcatTupleLayer (line 295) | class ConcatTupleLayer(nn.Module): method forward (line 296) | def forward(self, x): class FFCResNetGenerator (line 305) | class FFCResNetGenerator(nn.Module): method __init__ (line 306) | def __init__(self, input_nc, output_nc, ngf=64, n_downsampling=3, n_bl... method forward (line 366) | def forward(self, input): class FFCNLayerDiscriminator (line 370) | class FFCNLayerDiscriminator(BaseDiscriminator): method __init__ (line 371) | def __init__(self, input_nc, ndf=64, n_layers=3, norm_layer=nn.BatchNo... method get_all_activations (line 416) | def get_all_activations(self, x): method forward (line 423) | def forward(self, x): FILE: model_cards/lama/saicinpainting/training/modules/multidilated_conv.py class MultidilatedConv (line 6) | class MultidilatedConv(nn.Module): method __init__ (line 7) | def __init__(self, in_dim, out_dim, kernel_size, dilation_num=3, comb_... method forward (line 73) | def forward(self, x): FILE: model_cards/lama/saicinpainting/training/modules/multiscale.py class ResNetHead (line 11) | class ResNetHead(nn.Module): method __init__ (line 12) | def __init__(self, input_nc, ngf=64, n_downsampling=3, n_blocks=9, nor... method forward (line 40) | def forward(self, input): class ResNetTail (line 44) | class ResNetTail(nn.Module): method __init__ (line 45) | def __init__(self, output_nc, ngf=64, n_downsampling=3, n_blocks=9, no... method forward (line 86) | def forward(self, input, return_last_act=False): class MultiscaleResNet (line 95) | class MultiscaleResNet(nn.Module): method __init__ (line 96) | def __init__(self, input_nc, output_nc, ngf=64, n_downsampling=2, n_bl... method num_scales (line 120) | def num_scales(self): method forward (line 123) | def forward(self, ms_inputs: List[torch.Tensor], smallest_scales_num: ... class MultiscaleDiscriminatorSimple (line 173) | class MultiscaleDiscriminatorSimple(nn.Module): method __init__ (line 174) | def __init__(self, ms_impl): method num_scales (line 179) | def num_scales(self): method forward (line 182) | def forward(self, ms_inputs: List[torch.Tensor], smallest_scales_num: ... class SingleToMultiScaleInputMixin (line 199) | class SingleToMultiScaleInputMixin: method forward (line 200) | def forward(self, x: torch.Tensor) -> List: class GeneratorMultiToSingleOutputMixin (line 208) | class GeneratorMultiToSingleOutputMixin: method forward (line 209) | def forward(self, x): class DiscriminatorMultiToSingleOutputMixin (line 213) | class DiscriminatorMultiToSingleOutputMixin: method forward (line 214) | def forward(self, x): class DiscriminatorMultiToSingleOutputStackedMixin (line 219) | class DiscriminatorMultiToSingleOutputStackedMixin: method __init__ (line 220) | def __init__(self, *args, return_feats_only_levels=None, **kwargs): method forward (line 224) | def forward(self, x): class MultiscaleDiscrSingleInput (line 239) | class MultiscaleDiscrSingleInput(SingleToMultiScaleInputMixin, Discrimin... class MultiscaleResNetSingle (line 243) | class MultiscaleResNetSingle(GeneratorMultiToSingleOutputMixin, SingleTo... FILE: model_cards/lama/saicinpainting/training/modules/pix2pixhd.py class DotDict (line 15) | class DotDict(defaultdict): class Identity (line 22) | class Identity(nn.Module): method __init__ (line 23) | def __init__(self): method forward (line 26) | def forward(self, x): class ResnetBlock (line 30) | class ResnetBlock(nn.Module): method __init__ (line 31) | def __init__(self, dim, padding_type, norm_layer, activation=nn.ReLU(T... method build_conv_block (line 47) | def build_conv_block(self, dim, padding_type, norm_layer, activation, ... method forward (line 85) | def forward(self, x): class ResnetBlock5x5 (line 92) | class ResnetBlock5x5(nn.Module): method __init__ (line 93) | def __init__(self, dim, padding_type, norm_layer, activation=nn.ReLU(T... method build_conv_block (line 109) | def build_conv_block(self, dim, padding_type, norm_layer, activation, ... method forward (line 147) | def forward(self, x): class MultidilatedResnetBlock (line 155) | class MultidilatedResnetBlock(nn.Module): method __init__ (line 156) | def __init__(self, dim, padding_type, conv_layer, norm_layer, activati... method build_conv_block (line 160) | def build_conv_block(self, dim, padding_type, conv_layer, norm_layer, ... method forward (line 173) | def forward(self, x): class MultiDilatedGlobalGenerator (line 178) | class MultiDilatedGlobalGenerator(nn.Module): method __init__ (line 179) | def __init__(self, input_nc, output_nc, ngf=64, n_downsampling=3, method forward (line 236) | def forward(self, input): class ConfigGlobalGenerator (line 239) | class ConfigGlobalGenerator(nn.Module): method __init__ (line 240) | def __init__(self, input_nc, output_nc, ngf=64, n_downsampling=3, method forward (line 325) | def forward(self, input): function make_dil_blocks (line 329) | def make_dil_blocks(dilated_blocks_n, dilation_block_kind, dilated_block... class GlobalGenerator (line 341) | class GlobalGenerator(nn.Module): method __init__ (line 342) | def __init__(self, input_nc, output_nc, ngf=64, n_downsampling=3, n_bl... method forward (line 435) | def forward(self, input): class GlobalGeneratorGated (line 439) | class GlobalGeneratorGated(GlobalGenerator): method __init__ (line 440) | def __init__(self, *args, **kwargs): class GlobalGeneratorFromSuperChannels (line 450) | class GlobalGeneratorFromSuperChannels(nn.Module): method __init__ (line 451) | def __init__(self, input_nc, output_nc, n_downsampling, n_blocks, supe... method convert_super_channels (line 517) | def convert_super_channels(self, super_channels): method forward (line 560) | def forward(self, input): class NLayerDiscriminator (line 565) | class NLayerDiscriminator(BaseDiscriminator): method __init__ (line 566) | def __init__(self, input_nc, ndf=64, n_layers=3, norm_layer=nn.BatchNo... method get_all_activations (line 604) | def get_all_activations(self, x): method forward (line 611) | def forward(self, x): class MultidilatedNLayerDiscriminator (line 616) | class MultidilatedNLayerDiscriminator(BaseDiscriminator): method __init__ (line 617) | def __init__(self, input_nc, ndf=64, n_layers=3, norm_layer=nn.BatchNo... method get_all_activations (line 655) | def get_all_activations(self, x): method forward (line 662) | def forward(self, x): class NLayerDiscriminatorAsGen (line 667) | class NLayerDiscriminatorAsGen(NLayerDiscriminator): method forward (line 668) | def forward(self, x): FILE: model_cards/lama/saicinpainting/training/modules/spatial_transform.py class LearnableSpatialTransformWrapper (line 7) | class LearnableSpatialTransformWrapper(nn.Module): method __init__ (line 8) | def __init__(self, impl, pad_coef=0.5, angle_init_range=80, train_angl... method forward (line 16) | def forward(self, x): method transform (line 26) | def transform(self, x): method inverse_transform (line 33) | def inverse_transform(self, y_padded_rotated, orig_x): FILE: model_cards/lama/saicinpainting/training/modules/squeeze_excitation.py class SELayer (line 4) | class SELayer(nn.Module): method __init__ (line 5) | def __init__(self, channel, reduction=16): method forward (line 15) | def forward(self, x): FILE: model_cards/lama/saicinpainting/training/trainers/__init__.py function get_training_model_class (line 6) | def get_training_model_class(kind): function make_training_model (line 13) | def make_training_model(config): function load_checkpoint (line 25) | def load_checkpoint(train_config, path, map_location='cuda', strict=True): FILE: model_cards/lama/saicinpainting/training/trainers/base.py function make_optimizer (line 24) | def make_optimizer(parameters, kind='adamw', **kwargs): function update_running_average (line 34) | def update_running_average(result: nn.Module, new_iterate_model: nn.Modu... function make_multiscale_noise (line 43) | def make_multiscale_noise(base_tensor, scales=6, scale_mode='bilinear'): class BaseInpaintingTrainingModule (line 57) | class BaseInpaintingTrainingModule(ptl.LightningModule): method __init__ (line 58) | def __init__(self, config, use_ddp, *args, predict_only=False, visual... method configure_optimizers (line 117) | def configure_optimizers(self): method train_dataloader (line 124) | def train_dataloader(self): method val_dataloader (line 133) | def val_dataloader(self): method training_step (line 147) | def training_step(self, batch, batch_idx, optimizer_idx=None): method validation_step (line 151) | def validation_step(self, batch, batch_idx, dataloader_idx): method training_step_end (line 163) | def training_step_end(self, batch_parts_outputs): method validation_epoch_end (line 180) | def validation_epoch_end(self, outputs): method _do_step (line 224) | def _do_step(self, batch, batch_idx, mode='train', optimizer_idx=None,... method get_current_generator (line 267) | def get_current_generator(self, no_average=False): method forward (line 272) | def forward(self, batch: Dict[str, torch.Tensor]) -> Dict[str, torch.T... method generator_loss (line 276) | def generator_loss(self, batch) -> Tuple[torch.Tensor, Dict[str, torch... method discriminator_loss (line 279) | def discriminator_loss(self, batch) -> Tuple[torch.Tensor, Dict[str, t... method store_discr_outputs (line 282) | def store_discr_outputs(self, batch): method get_ddp_rank (line 290) | def get_ddp_rank(self): FILE: model_cards/lama/saicinpainting/training/trainers/default.py function make_constant_area_crop_batch (line 17) | def make_constant_area_crop_batch(batch, **kwargs): class DefaultInpaintingTrainingModule (line 26) | class DefaultInpaintingTrainingModule(BaseInpaintingTrainingModule): method __init__ (line 27) | def __init__(self, *args, concat_mask=True, rescale_scheduler_kwargs=N... method forward (line 47) | def forward(self, batch): method generator_loss (line 88) | def generator_loss(self, batch): method discriminator_loss (line 140) | def discriminator_loss(self, batch): FILE: model_cards/lama/saicinpainting/training/visualizers/__init__.py function make_visualizer (line 7) | def make_visualizer(kind, **kwargs): FILE: model_cards/lama/saicinpainting/training/visualizers/base.py class BaseVisualizer (line 14) | class BaseVisualizer: method __call__ (line 16) | def __call__(self, epoch_i, batch_i, batch, suffix='', rank=None): function visualize_mask_and_images (line 23) | def visualize_mask_and_images(images_dict: Dict[str, np.ndarray], keys: ... function visualize_mask_and_images_batch (line 61) | def visualize_mask_and_images_batch(batch: Dict[str, torch.Tensor], keys... FILE: model_cards/lama/saicinpainting/training/visualizers/colors.py function generate_colors (line 11) | def generate_colors(nlabels, type='bright', first_color_black=False, las... FILE: model_cards/lama/saicinpainting/training/visualizers/directory.py class DirectoryVisualizer (line 10) | class DirectoryVisualizer(BaseVisualizer): method __init__ (line 13) | def __init__(self, outdir, key_order=DEFAULT_KEY_ORDER, max_items_in_b... method __call__ (line 22) | def __call__(self, epoch_i, batch_i, batch, suffix='', rank=None): FILE: model_cards/lama/saicinpainting/training/visualizers/noop.py class NoopVisualizer (line 4) | class NoopVisualizer(BaseVisualizer): method __init__ (line 5) | def __init__(self, *args, **kwargs): method __call__ (line 8) | def __call__(self, epoch_i, batch_i, batch, suffix='', rank=None): FILE: model_cards/lama/saicinpainting/utils.py function check_and_warn_input_range (line 20) | def check_and_warn_input_range(tensor, min_value, max_value, name): function sum_dict_with_prefix (line 27) | def sum_dict_with_prefix(target, cur_dict, prefix, default=0): function average_dicts (line 33) | def average_dicts(dict_list): function add_prefix_to_keys (line 44) | def add_prefix_to_keys(dct, prefix): function set_requires_grad (line 48) | def set_requires_grad(module, value): function flatten_dict (line 53) | def flatten_dict(dct): class LinearRamp (line 66) | class LinearRamp: method __init__ (line 67) | def __init__(self, start_value=0, end_value=1, start_iter=-1, end_iter... method __call__ (line 73) | def __call__(self, i): class LadderRamp (line 82) | class LadderRamp: method __init__ (line 83) | def __init__(self, start_iters, values): method __call__ (line 88) | def __call__(self, i): function get_ramp (line 93) | def get_ramp(kind='ladder', **kwargs): function print_traceback_handler (line 101) | def print_traceback_handler(sig, frame): function register_debug_signal_handlers (line 107) | def register_debug_signal_handlers(sig=signal.SIGUSR1, handler=print_tra... function handle_deterministic_config (line 112) | def handle_deterministic_config(config): function get_shape (line 121) | def get_shape(t): function get_has_ddp_rank (line 134) | def get_has_ddp_rank(): function handle_ddp_subprocess (line 143) | def handle_ddp_subprocess(): function handle_ddp_parent_process (line 168) | def handle_ddp_parent_process(): FILE: model_cards/segment_anything/automatic_mask_generator.py class SamAutomaticMaskGenerator (line 35) | class SamAutomaticMaskGenerator: method __init__ (line 36) | def __init__( method generate (line 137) | def generate(self, image: np.ndarray) -> List[Dict[str, Any]]: method _generate_masks (line 197) | def _generate_masks(self, image: np.ndarray) -> MaskData: method _process_crop (line 225) | def _process_crop( method _process_batch (line 266) | def _process_batch( method postprocess_small_regions (line 324) | def postprocess_small_regions( FILE: model_cards/segment_anything/build_sam.py function build_sam_vit_h (line 14) | def build_sam_vit_h(checkpoint=None): function build_sam_vit_l (line 27) | def build_sam_vit_l(checkpoint=None): function build_sam_vit_b (line 37) | def build_sam_vit_b(checkpoint=None): function _build_sam (line 55) | def _build_sam( FILE: model_cards/segment_anything/modeling/common.py class MLPBlock (line 13) | class MLPBlock(nn.Module): method __init__ (line 14) | def __init__( method forward (line 25) | def forward(self, x: torch.Tensor) -> torch.Tensor: class LayerNorm2d (line 31) | class LayerNorm2d(nn.Module): method __init__ (line 32) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 38) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: model_cards/segment_anything/modeling/image_encoder.py class ImageEncoderViT (line 17) | class ImageEncoderViT(nn.Module): method __init__ (line 18) | def __init__( method forward (line 106) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Block (line 119) | class Block(nn.Module): method __init__ (line 122) | def __init__( method forward (line 166) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Attention (line 185) | class Attention(nn.Module): method __init__ (line 188) | def __init__( method forward (line 224) | def forward(self, x: torch.Tensor) -> torch.Tensor: function window_partition (line 243) | def window_partition(x: torch.Tensor, window_size: int) -> Tuple[torch.T... function window_unpartition (line 267) | def window_unpartition( function get_rel_pos (line 292) | def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torc... function add_decomposed_rel_pos (line 325) | def add_decomposed_rel_pos( class PatchEmbed (line 364) | class PatchEmbed(nn.Module): method __init__ (line 369) | def __init__( method forward (line 391) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: model_cards/segment_anything/modeling/mask_decoder.py class MaskDecoder (line 16) | class MaskDecoder(nn.Module): method __init__ (line 17) | def __init__( method forward (line 71) | def forward( method predict_masks (line 112) | def predict_masks( class MLP (line 154) | class MLP(nn.Module): method __init__ (line 155) | def __init__( method forward (line 171) | def forward(self, x): FILE: model_cards/segment_anything/modeling/prompt_encoder.py class PromptEncoder (line 16) | class PromptEncoder(nn.Module): method __init__ (line 17) | def __init__( method get_dense_pe (line 62) | def get_dense_pe(self) -> torch.Tensor: method _embed_points (line 73) | def _embed_points( method _embed_boxes (line 93) | def _embed_boxes(self, boxes: torch.Tensor) -> torch.Tensor: method _embed_masks (line 102) | def _embed_masks(self, masks: torch.Tensor) -> torch.Tensor: method _get_batch_size (line 107) | def _get_batch_size( method _get_device (line 125) | def _get_device(self) -> torch.device: method forward (line 128) | def forward( class PositionEmbeddingRandom (line 171) | class PositionEmbeddingRandom(nn.Module): method __init__ (line 176) | def __init__(self, num_pos_feats: int = 64, scale: Optional[float] = N... method _pe_encoding (line 185) | def _pe_encoding(self, coords: torch.Tensor) -> torch.Tensor: method forward (line 194) | def forward(self, size: Tuple[int, int]) -> torch.Tensor: method forward_with_coords (line 207) | def forward_with_coords( FILE: model_cards/segment_anything/modeling/sam.py class Sam (line 18) | class Sam(nn.Module): method __init__ (line 22) | def __init__( method device (line 50) | def device(self) -> Any: method forward (line 54) | def forward( method postprocess_masks (line 133) | def postprocess_masks( method preprocess (line 164) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: FILE: model_cards/segment_anything/modeling/transformer.py class TwoWayTransformer (line 16) | class TwoWayTransformer(nn.Module): method __init__ (line 17) | def __init__( method forward (line 62) | def forward( class TwoWayAttentionBlock (line 109) | class TwoWayAttentionBlock(nn.Module): method __init__ (line 110) | def __init__( method forward (line 151) | def forward( class Attention (line 185) | class Attention(nn.Module): method __init__ (line 191) | def __init__( method _separate_heads (line 208) | def _separate_heads(self, x: Tensor, num_heads: int) -> Tensor: method _recombine_heads (line 213) | def _recombine_heads(self, x: Tensor) -> Tensor: method forward (line 218) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> Tensor: FILE: model_cards/segment_anything/predictor.py class SamPredictor (line 17) | class SamPredictor: method __init__ (line 18) | def __init__( method set_image (line 34) | def set_image( method set_torch_image (line 63) | def set_torch_image( method predict (line 92) | def predict( method predict_torch (line 169) | def predict_torch( method get_image_embedding (line 245) | def get_image_embedding(self) -> torch.Tensor: method device (line 259) | def device(self) -> torch.device: method reset_image (line 262) | def reset_image(self) -> None: FILE: model_cards/segment_anything/utils/amg.py class MaskData (line 16) | class MaskData: method __init__ (line 22) | def __init__(self, **kwargs) -> None: method __setitem__ (line 29) | def __setitem__(self, key: str, item: Any) -> None: method __delitem__ (line 35) | def __delitem__(self, key: str) -> None: method __getitem__ (line 38) | def __getitem__(self, key: str) -> Any: method items (line 41) | def items(self) -> ItemsView[str, Any]: method filter (line 44) | def filter(self, keep: torch.Tensor) -> None: method cat (line 59) | def cat(self, new_stats: "MaskData") -> None: method to_numpy (line 72) | def to_numpy(self) -> None: function is_box_near_crop_edge (line 78) | def is_box_near_crop_edge( function box_xyxy_to_xywh (line 91) | def box_xyxy_to_xywh(box_xyxy: torch.Tensor) -> torch.Tensor: function batch_iterator (line 98) | def batch_iterator(batch_size: int, *args) -> Generator[List[Any], None,... function mask_to_rle_pytorch (line 107) | def mask_to_rle_pytorch(tensor: torch.Tensor) -> List[Dict[str, Any]]: function rle_to_mask (line 138) | def rle_to_mask(rle: Dict[str, Any]) -> np.ndarray: function area_from_rle (line 152) | def area_from_rle(rle: Dict[str, Any]) -> int: function calculate_stability_score (line 156) | def calculate_stability_score( function build_point_grid (line 179) | def build_point_grid(n_per_side: int) -> np.ndarray: function build_all_layer_point_grids (line 189) | def build_all_layer_point_grids( function generate_crop_boxes (line 200) | def generate_crop_boxes( function uncrop_boxes_xyxy (line 237) | def uncrop_boxes_xyxy(boxes: torch.Tensor, crop_box: List[int]) -> torch... function uncrop_points (line 246) | def uncrop_points(points: torch.Tensor, crop_box: List[int]) -> torch.Te... function uncrop_masks (line 255) | def uncrop_masks( function remove_small_regions (line 267) | def remove_small_regions( function coco_encode_rle (line 294) | def coco_encode_rle(uncompressed_rle: Dict[str, Any]) -> Dict[str, Any]: function batched_mask_to_box (line 303) | def batched_mask_to_box(masks: torch.Tensor) -> torch.Tensor: FILE: model_cards/segment_anything/utils/onnx.py class SamOnnxModel (line 17) | class SamOnnxModel(nn.Module): method __init__ (line 25) | def __init__( method resize_longest_image_size (line 42) | def resize_longest_image_size( method _embed_points (line 51) | def _embed_points(self, point_coords: torch.Tensor, point_labels: torc... method _embed_masks (line 69) | def _embed_masks(self, input_mask: torch.Tensor, has_mask_input: torch... method mask_postprocessing (line 76) | def mask_postprocessing(self, masks: torch.Tensor, orig_im_size: torch... method select_masks (line 92) | def select_masks( method forward (line 108) | def forward( FILE: model_cards/segment_anything/utils/transforms.py class ResizeLongestSide (line 16) | class ResizeLongestSide: method __init__ (line 23) | def __init__(self, target_length: int) -> None: method apply_image (line 26) | def apply_image(self, image: np.ndarray) -> np.ndarray: method apply_coords (line 33) | def apply_coords(self, coords: np.ndarray, original_size: Tuple[int, .... method apply_boxes (line 47) | def apply_boxes(self, boxes: np.ndarray, original_size: Tuple[int, ...... method apply_image_torch (line 55) | def apply_image_torch(self, image: torch.Tensor) -> torch.Tensor: method apply_coords_torch (line 67) | def apply_coords_torch( method apply_boxes_torch (line 83) | def apply_boxes_torch( method get_preprocess_shape (line 94) | def get_preprocess_shape(oldh: int, oldw: int, long_side_length: int) ... FILE: model_cards/setup.py function write_version_file (line 44) | def write_version_file(): function get_extensions (line 56) | def get_extensions(): function parse_requirements (line 114) | def parse_requirements(fname="requirements.txt", with_version=True): FILE: themes/common.js function ChatBotHeight (line 1) | function ChatBotHeight() { function get_elements (line 31) | function get_elements() { FILE: themes/default.py function adjust_theme (line 5) | def adjust_theme(): FILE: themes/green.py function adjust_theme (line 5) | def adjust_theme(): FILE: utils/AudioRecorder.py class BaseRecorder (line 9) | class BaseRecorder: method __init__ (line 10) | def __init__(self, source, source_name): method adjust_for_noise (line 21) | def adjust_for_noise(self, device_name, msg): method record_into_queue (line 27) | def record_into_queue(self, audio_queue): class DefaultMicRecorder (line 34) | class DefaultMicRecorder(BaseRecorder): method __init__ (line 35) | def __init__(self): class DefaultSpeakerRecorder (line 39) | class DefaultSpeakerRecorder(BaseRecorder): method __init__ (line 40) | def __init__(self): FILE: utils/AudioTrans.py class AudioTranscriber (line 18) | class AudioTranscriber: method __init__ (line 19) | def __init__(self, mic_source, speaker_source, model,two_ways=False): method transcribe_audio_queue (line 45) | def transcribe_audio_queue(self, audio_queue): method update_last_sample_and_phrase_status (line 73) | def update_last_sample_and_phrase_status(self, who_spoke, data, time_s... method process_mic_data (line 89) | def process_mic_data(self, data, temp_file_name): method process_speaker_data (line 95) | def process_speaker_data(self, data, temp_file_name): method update_transcript (line 103) | def update_transcript(self, who_spoke, text, time_spoken): method get_transcript (line 115) | def get_transcript(self): method clear_transcript_data (line 122) | def clear_transcript_data(self): FILE: utils/__init__.py function set_logging (line 21) | def set_logging(name=None, verbose=VERBOSE): function write_categories (line 36) | def write_categories(cls_name, file_path): function threaded (line 45) | def threaded(func): class TryExcept (line 54) | class TryExcept(contextlib.ContextDecorator): method __init__ (line 56) | def __init__(self, msg='', verbose=True): method __enter__ (line 60) | def __enter__(self): method __exit__ (line 63) | def __exit__(self, exc_type, value, traceback): function check_suffix (line 68) | def check_suffix(file=None, suffix=('.pt',), msg=''): function is_online (line 78) | def is_online() -> bool: function url2file (line 92) | def url2file(url): function emojis (line 97) | def emojis(str=''): function clean_url (line 100) | def clean_url(url): function check_requirements (line 106) | def check_requirements(requirements=ROOT / 'requirements.txt', exclude=(... FILE: utils/audio.py class SetupError (line 28) | class SetupError(Exception): class WaitTimeoutError (line 32) | class WaitTimeoutError(Exception): class RequestError (line 36) | class RequestError(Exception): class UnknownValueError (line 40) | class UnknownValueError(Exception): class TranscriptionNotReady (line 44) | class TranscriptionNotReady(Exception): class TranscriptionFailed (line 48) | class TranscriptionFailed(Exception): class PortableNamedTemporaryFile (line 51) | class PortableNamedTemporaryFile(object): method __init__ (line 53) | def __init__(self, mode="w+b"): method __enter__ (line 56) | def __enter__(self): method __exit__ (line 65) | def __exit__(self, exc_type, exc_value, traceback): method write (line 69) | def write(self, *args, **kwargs): method writelines (line 72) | def writelines(self, *args, **kwargs): method flush (line 75) | def flush(self, *args, **kwargs): class AudioSource (line 78) | class AudioSource(object): method __init__ (line 79) | def __init__(self): method __enter__ (line 82) | def __enter__(self): method __exit__ (line 85) | def __exit__(self, exc_type, exc_value, traceback): class Microphone (line 89) | class Microphone(AudioSource): method __init__ (line 105) | def __init__(self, device_index=None, sample_rate=None, chunk_size=102... method get_pyaudio (line 136) | def get_pyaudio(): method list_microphone_names (line 150) | def list_microphone_names(): method list_working_microphones (line 167) | def list_working_microphones(): method __enter__ (line 206) | def __enter__(self): method __exit__ (line 234) | def __exit__(self, exc_type, exc_value, traceback): class MicrophoneStream (line 241) | class MicrophoneStream(object): method __init__ (line 242) | def __init__(self, pyaudio_stream): method read (line 245) | def read(self, size): method close (line 248) | def close(self): class AudioFile (line 257) | class AudioFile(AudioSource): method __init__ (line 272) | def __init__(self, filename_or_fileobject): method __enter__ (line 284) | def __enter__(self): method __exit__ (line 341) | def __exit__(self, exc_type, exc_value, traceback): class AudioFileStream (line 347) | class AudioFileStream(object): method __init__ (line 348) | def __init__(self, audio_reader, little_endian, samples_24_bit_prete... method read (line 353) | def read(self, size=-1): class Recognizer (line 373) | class Recognizer(AudioSource): method __init__ (line 374) | def __init__(self): method record (line 388) | def record(self, source, duration=None, offset=None): method adjust_for_ambient_noise (line 421) | def adjust_for_ambient_noise(self, source, duration=1): method snowboy_wait_for_hot_word (line 448) | def snowboy_wait_for_hot_word(self, snowboy_location, snowboy_hot_word... method listen (line 497) | def listen(self, source, timeout=None, phrase_time_limit=None, snowboy... method listen_in_background (line 594) | def listen_in_background(self, source, callback, phrase_time_limit=None): method recognize_sphinx (line 627) | def recognize_sphinx(self, audio_data, language="en-US", keyword_entri... class AudioData (line 719) | class AudioData(object): method __init__ (line 732) | def __init__(self, frame_data, sample_rate, sample_width): method get_segment (line 741) | def get_segment(self, start_ms=None, end_ms=None): method get_raw_data (line 771) | def get_raw_data(self, convert_rate=None, convert_width=None): method get_wav_data (line 843) | def get_wav_data(self, convert_rate=None, convert_width=None, nchannel... method get_aiff_data (line 874) | def get_aiff_data(self, convert_rate=None, convert_width=None): method get_flac_data (line 916) | def get_flac_data(self, convert_rate=None, convert_width=None): function get_flac_converter (line 968) | def get_flac_converter(): function shutil_which (line 1018) | def shutil_which(pgm): FILE: utils/check_proxy.py function check_proxy (line 2) | def check_proxy(proxies): function _check_with_backup_source (line 27) | def _check_with_backup_source(proxies): function backup_and_download (line 33) | def backup_and_download(current_version, remote_version): function patch_and_restart (line 65) | def patch_and_restart(path): function get_current_version (line 97) | def get_current_version(): function auto_update (line 107) | def auto_update(raise_error=False): function warm_up_modules (line 156) | def warm_up_modules(): FILE: utils/colorful.py function print红 (line 11) | def print红(*kw,**kargs): function print绿 (line 13) | def print绿(*kw,**kargs): function print黄 (line 15) | def print黄(*kw,**kargs): function print蓝 (line 17) | def print蓝(*kw,**kargs): function print紫 (line 19) | def print紫(*kw,**kargs): function print靛 (line 21) | def print靛(*kw,**kargs): function print亮红 (line 24) | def print亮红(*kw,**kargs): function print亮绿 (line 26) | def print亮绿(*kw,**kargs): function print亮黄 (line 28) | def print亮黄(*kw,**kargs): function print亮蓝 (line 30) | def print亮蓝(*kw,**kargs): function print亮紫 (line 32) | def print亮紫(*kw,**kargs): function print亮靛 (line 34) | def print亮靛(*kw,**kargs): function sprint红 (line 38) | def sprint红(*kw): function sprint绿 (line 40) | def sprint绿(*kw): function sprint黄 (line 42) | def sprint黄(*kw): function sprint蓝 (line 44) | def sprint蓝(*kw): function sprint紫 (line 46) | def sprint紫(*kw): function sprint靛 (line 48) | def sprint靛(*kw): function sprint亮红 (line 50) | def sprint亮红(*kw): function sprint亮绿 (line 52) | def sprint亮绿(*kw): function sprint亮黄 (line 54) | def sprint亮黄(*kw): function sprint亮蓝 (line 56) | def sprint亮蓝(*kw): function sprint亮紫 (line 58) | def sprint亮紫(*kw): function sprint亮靛 (line 60) | def sprint亮靛(*kw): FILE: utils/dataloads.py function get_hash (line 51) | def get_hash(paths): function exif_size (line 59) | def exif_size(img): function exif_transpose (line 69) | def exif_transpose(image): function seed_worker (line 94) | def seed_worker(worker_id): function create_dataloader (line 101) | def create_dataloader(path, function create_kpt_dataloader (line 160) | def create_kpt_dataloader(path, imgsz, batch_size, stride, opt, hyp=None... class InfiniteDataLoader (line 190) | class InfiniteDataLoader(dataloader.DataLoader): method __init__ (line 195) | def __init__(self, *args, **kwargs): method __len__ (line 200) | def __len__(self): method __iter__ (line 203) | def __iter__(self): class _RepeatSampler (line 208) | class _RepeatSampler: method __init__ (line 214) | def __init__(self, sampler): method __iter__ (line 217) | def __iter__(self): class LoadScreenshots (line 222) | class LoadScreenshots: method __init__ (line 224) | def __init__(self, source, img_size=640, stride=32, auto=True, transfo... method __iter__ (line 253) | def __iter__(self): method __next__ (line 256) | def __next__(self): class LoadImages (line 271) | class LoadImages: method __init__ (line 273) | def __init__(self, path, img_size=640, stride=32, auto=True, transform... method __iter__ (line 308) | def __iter__(self): method __next__ (line 312) | def __next__(self): method _new_video (line 352) | def _new_video(self, path): method _cv2_rotate (line 360) | def _cv2_rotate(self, im): method __len__ (line 370) | def __len__(self): class LoadWebcam (line 375) | class LoadWebcam: # for inference method __init__ (line 377) | def __init__(self, pipe='0', img_size=640, stride=32): method __iter__ (line 384) | def __iter__(self): method __next__ (line 388) | def __next__(self): method __len__ (line 411) | def __len__(self): class LoadStreams (line 415) | class LoadStreams: method __init__ (line 417) | def __init__(self, sources='file.streams', img_size=640, stride=32, au... method update (line 460) | def update(self, i, cap, stream): method __iter__ (line 477) | def __iter__(self): method __next__ (line 481) | def __next__(self): method __len__ (line 497) | def __len__(self): function img2label_paths (line 501) | def img2label_paths(img_paths): class LoadImagesAndLabels (line 507) | class LoadImagesAndLabels(Dataset): method __init__ (line 512) | def __init__(self, method check_cache_ram (line 662) | def check_cache_ram(self, safety_margin=0.1, prefix=''): method cache_labels (line 679) | def cache_labels(self, path=Path('./labels.cache'), prefix=''): method __len__ (line 717) | def __len__(self): method __getitem__ (line 726) | def __getitem__(self, index): method load_image (line 812) | def load_image(self, i): method cache_images_to_disk (line 829) | def cache_images_to_disk(self, i): method load_mosaic (line 835) | def load_mosaic(self, index): method load_mosaic9 (line 893) | def load_mosaic9(self, index): method load_samples (line 970) | def load_samples(self, index): method collate_fn (line 1022) | def collate_fn(batch): method collate_fn_v8 (line 1029) | def collate_fn_v8(batch): method collate_fn4 (line 1045) | def collate_fn4(batch): function create_folder (line 1073) | def create_folder(path='./new'): function flatten_recursive (line 1080) | def flatten_recursive(path=DATASETS_DIR / 'coco128'): function extract_boxes (line 1088) | def extract_boxes(path=DATASETS_DIR / 'coco128'): # from utils.datasets... function autosplit (line 1122) | def autosplit(path=DATASETS_DIR / 'coco128/images', weights=(0.9, 0.1, 0... function verify_image_label (line 1146) | def verify_image_label(args): FILE: utils/downloads.py function is_url (line 24) | def is_url(url, check_online=True): function unzip_file (line 34) | def unzip_file(file, path=None, exclude=('.DS_Store', '__MACOSX')): function gsutil_getsize (line 49) | def gsutil_getsize(url=''): function url_getsize (line 54) | def url_getsize(url='https://ultralytics.com/images/bus.jpg'): function check_disk_space (line 59) | def check_disk_space(url=None, sf=1.5, hard=True): function safe_download (line 90) | def safe_download(url, function attempt_download (line 176) | def attempt_download(file, repo='positive666/Prompt-Can-Anything', relea... function download_model (line 225) | def download_model(model_url, save_directory): FILE: utils/ops.py function write_xml (line 63) | def write_xml(filename, img_name, img_root,preds, width, height): function save_format (line 94) | def save_format(label_format: str ="xml",save_path :str ="runs/xmls" , function dilate_mask (line 107) | def dilate_mask(mask, dilate_factor=15): function erode_mask (line 116) | def erode_mask(mask, dilate_factor=15): function torch_nms_box (line 125) | def torch_nms_box(bboxes, scores, iou_threshold=0.5): function check_class_names (line 171) | def check_class_names(names): function is_kaggle (line 187) | def is_kaggle(): function is_writeable (line 192) | def is_writeable(dir, test=False): function set_logging (line 206) | def set_logging(name=None, verbose=VERBOSE): function set_logging (line 222) | def set_logging(name=LOGGING_NAME, verbose=True): function user_config_dir (line 250) | def user_config_dir(dir='positive666', env_var='YOLOV5_CONFIG_DIR'): class Profile (line 266) | class Profile(contextlib.ContextDecorator): method __init__ (line 268) | def __init__(self, t=0.0): method __enter__ (line 272) | def __enter__(self): method __exit__ (line 276) | def __exit__(self, type, value, traceback): method time (line 280) | def time(self): class Timeout (line 286) | class Timeout(contextlib.ContextDecorator): method __init__ (line 288) | def __init__(self, seconds, *, timeout_msg='', suppress_timeout_errors... method _timeout_handler (line 293) | def _timeout_handler(self, signum, frame): method __enter__ (line 296) | def __enter__(self): method __exit__ (line 301) | def __exit__(self, exc_type, exc_val, exc_tb): class WorkingDirectory (line 308) | class WorkingDirectory(contextlib.ContextDecorator): method __init__ (line 310) | def __init__(self, new_dir): method __enter__ (line 314) | def __enter__(self): method __exit__ (line 317) | def __exit__(self, exc_type, exc_val, exc_tb): function methods (line 322) | def methods(instance): function print_args (line 327) | def print_args(args: Optional[dict] = None, show_file=True, show_func=Fa... function init_seeds (line 342) | def init_seeds(seed=0, deterministic=False): function intersect_dicts (line 360) | def intersect_dicts(da, db, exclude=()): function get_default_args (line 364) | def get_default_args(func): function merge_bases (line 369) | def merge_bases(rois, coeffs, attn_r, num_b, location_to_inds=None): function get_latest_run (line 387) | def get_latest_run(search_dir='.'): function is_docker (line 393) | def is_docker(): function is_colab (line 403) | def is_colab(): function is_jupyter (line 408) | def is_jupyter(): function is_pip (line 420) | def is_pip(): function is_ascii (line 425) | def is_ascii(s=''): function is_chinese (line 431) | def is_chinese(s='人工智能'): function file_age (line 436) | def file_age(path=__file__): function file_date (line 442) | def file_date(path=__file__): function file_size (line 448) | def file_size(path): function check_online (line 460) | def check_online(): function check_yolo (line 475) | def check_yolo(verbose=True): function git_describe (line 497) | def git_describe(path=ROOT): # path must be a directory function check_git_status (line 508) | def check_git_status(repo='positive666/yolo_research', branch='master'): function check_git_info (line 535) | def check_git_info(path='.'): function check_python (line 551) | def check_python(minimum='3.7.0'): function check_version (line 556) | def check_version(current='0.0.0', minimum='0.0.0', name='version ', pin... function check_requirements (line 569) | def check_requirements(requirements=ROOT / 'requirements.txt', exclude=(... function check_img_size (line 605) | def check_img_size(imgsz, s=32, floor=0): function check_imshow (line 617) | def check_imshow(warn=False): function check_suffix (line 633) | def check_suffix(file='yolov5s.pt', suffix=('.pt',), msg=''): function check_yaml (line 644) | def check_yaml(file, suffix=('.yaml', '.yml')): function check_file (line 649) | def check_file(file, suffix=''): function check_dataset (line 673) | def check_dataset(data, autodownload=True): function yaml_load (line 735) | def yaml_load(file='data.yaml', append_filename=False): function yaml_save (line 754) | def yaml_save(file='data.yaml', data={}): function unzip_file (line 759) | def unzip_file(file, path=None, exclude=('.DS_Store', '__MACOSX')): function url2file (line 768) | def url2file(url): function download (line 774) | def download(url, dir='.', unzip=True, delete=True, curl=False, threads=... function make_divisible (line 822) | def make_divisible(x, divisor): function clean_str (line 829) | def clean_str(s): function one_cycle (line 834) | def one_cycle(y1=0.0, y2=1.0, steps=100): function colorstr (line 839) | def colorstr(*input): function labels_to_class_weights (line 865) | def labels_to_class_weights(labels, nc=80): function labels_to_image_weights (line 884) | def labels_to_image_weights(labels, nc=80, class_weights=np.ones(80)): function coco80_to_coco91_class (line 891) | def coco80_to_coco91_class(): # converts 80-index (val2014) to 91-index... function xyxy2xywh (line 903) | def xyxy2xywh(x): function xywh2xyxy (line 913) | def xywh2xyxy(x): function xywh2xyxy_export (line 923) | def xywh2xyxy_export(cx,cy,w,h): function xywhn2xyxy (line 935) | def xywhn2xyxy(x, w=640, h=640, padw=0, padh=0,kpt_label=False): function xyxy2xywhn (line 955) | def xyxy2xywhn(x, w=640, h=640, clip=False, eps=0.0): function xyn2xy (line 967) | def xyn2xy(x, w=640, h=640, padw=0, padh=0): function segment2box (line 975) | def segment2box(segment, width=640, height=640): function segments2boxes (line 983) | def segments2boxes(segments): function resample_segments (line 992) | def resample_segments(segments, n=1000): function scale_boxes (line 1002) | def scale_boxes(img1_shape, boxes, img0_shape, ratio_pad=None,kpt_label=... function box_iou (line 1024) | def box_iou(box1, box2, eps=1e-7): function scale_segments (line 1044) | def scale_segments(img1_shape, segments, img0_shape, ratio_pad=None, nor... function clip_boxes (line 1063) | def clip_boxes(boxes, shape, step=None): function clip_segments (line 1080) | def clip_segments(boxes, shape): function scale_image (line 1089) | def scale_image(im1_shape, masks, im0_shape, ratio_pad=None): function clip_boxes (line 1121) | def clip_boxes(boxes, shape): function non_max_suppression (line 1138) | def non_max_suppression(prediction, function non_max_suppression_keypoint (line 1246) | def non_max_suppression_keypoint(prediction, conf_thres=0.25, iou_thres=... function increment_path (line 1346) | def increment_path(path, exist_ok=False, sep='', mkdir=False): function imread (line 1376) | def imread(path, flags=cv2.IMREAD_COLOR): function imwrite (line 1380) | def imwrite(path, im): function imshow (line 1388) | def imshow(path, im): function fitness (line 1396) | def fitness(x): function split_images_to_folders (line 1402) | def split_images_to_folders(folder_path, num_threads, num_folders): function merge_image_folders (line 1433) | def merge_image_folders(folder_path): FILE: utils/plot.py function save_mask_data (line 33) | def save_mask_data(output_dir, caption, mask_list, box_list, label_list,... function scale_image (line 61) | def scale_image(im1_shape, masks, im0_shape, ratio_pad=None): function show_mask (line 88) | def show_mask(mask, ax, random_color=False,cls_color=None): function Draw_img (line 103) | def Draw_img(data,draw,mode='box',label=None,random_color=None): function show_box (line 132) | def show_box(box, ax, label): class Colors (line 138) | class Colors: method __init__ (line 140) | def __init__(self): method __call__ (line 147) | def __call__(self, i, bgr=False): method hex2rgb (line 152) | def hex2rgb(h): # rgb order (PIL) function check_font (line 158) | def check_font(font=FONT, url="",progress=False): function check_pil_font (line 167) | def check_pil_font(font=FONT, size=10): class Annotator (line 183) | class Annotator: method __init__ (line 185) | def __init__(self, im, line_width=None, font_size=None, font='Arial.tt... method box_label (line 198) | def box_label(self, box, label='', color=(128, 128, 128), txt_color=(2... method masks (line 229) | def masks(self, masks, colors, im_gpu, alpha=0.5, retina_masks=False): method rectangle (line 259) | def rectangle(self, xy, fill=None, outline=None, width=1): method text (line 263) | def text(self, xy, text, txt_color=(255, 255, 255), anchor='top'): method fromarray (line 270) | def fromarray(self, im): method result (line 275) | def result(self): function feature_visualization (line 280) | def feature_visualization(x, module_type, stage, n=32, save_dir=Path('ru... function hist2d (line 308) | def hist2d(x, y, n=100): function butter_lowpass_filtfilt (line 317) | def butter_lowpass_filtfilt(data, cutoff=1500, fs=50000, order=5): function output_to_target (line 330) | def output_to_target(output, max_det=300): function plot_images (line 341) | def plot_images(images, targets, paths=None, fname='images.jpg', names=N... function plot_images_masks (line 405) | def plot_images_masks(images, function plot_lr_scheduler (line 510) | def plot_lr_scheduler(optimizer, scheduler, epochs=300, save_dir=''): function plot_val_txt (line 527) | def plot_val_txt(): # from utils.plots import *; plot_val() function plot_targets_txt (line 544) | def plot_targets_txt(): # from utils.plots import *; plot_targets_txt() function plot_val_study (line 557) | def plot_val_study(file='', dir='', x=None): # from utils.plots import ... function plot_labels (line 603) | def plot_labels(labels, names=(), save_dir=Path('')): function plot_evolve (line 678) | def plot_evolve(evolve_csv='path/to/evolve.csv'): # from utils.plots im... function plot_results (line 705) | def plot_results(file='path/to/results.csv', dir=''): function profile_idetection (line 731) | def profile_idetection(start=0, stop=0, labels=(), save_dir=''): function save_one_box (line 762) | def save_one_box(xyxy, im, file=Path('im.jpg'), gain=1.02, pad=10, squar... function plot_one_box (line 780) | def plot_one_box(x, im, color=None, label=None, line_thickness=3, kpt_la... function plot_skeleton_kpts (line 800) | def plot_skeleton_kpts(im, kpts, steps, orig_shape=None): FILE: utils/text2speech.py class T2S (line 7) | class T2S(): method __init__ (line 8) | def __init__(self) -> None: method test (line 12) | def test(self, text, language='en'): FILE: utils/textsplitter/ali_text_splitter.py class AliTextSplitter (line 6) | class AliTextSplitter(CharacterTextSplitter): method __init__ (line 7) | def __init__(self, pdf: bool = False, **kwargs): method split_text (line 11) | def split_text(self, text: str) -> List[str]: FILE: utils/textsplitter/chinese_text_splitter.py class ChineseTextSplitter (line 7) | class ChineseTextSplitter(CharacterTextSplitter): method __init__ (line 8) | def __init__(self, pdf: bool = False, sentence_size: int = SENTENCE_SI... method split_text1 (line 13) | def split_text1(self, text: str) -> List[str]: method split_text (line 27) | def split_text(self, text: str) -> List[str]: ##此处需要进一步优化逻辑 FILE: utils/textsplitter/zh_title_enhance.py function under_non_alpha_ratio (line 5) | def under_non_alpha_ratio(text: str, threshold: float = 0.5): function is_possible_title (line 30) | def is_possible_title( function zh_title_enhance (line 88) | def zh_title_enhance(docs: Document) -> Document: FILE: utils/toolbox.py class ChatBotWithCookies (line 24) | class ChatBotWithCookies(list): method __init__ (line 25) | def __init__(self, cookie): method write_list (line 28) | def write_list(self, list): method get_list (line 32) | def get_list(self): method get_cookies (line 35) | def get_cookies(self): function ArgsGeneralWrapper (line 39) | def ArgsGeneralWrapper(f): function update_ui (line 73) | def update_ui(chatbot, history, msg='正常', **kwargs): # 刷新界面 function trimmed_format_exc (line 80) | def trimmed_format_exc(): function CatchException (line 87) | def CatchException(f): function HotReload (line 110) | def HotReload(f): function get_reduce_token_percent (line 146) | def get_reduce_token_percent(text): function write_results_to_file (line 164) | def write_results_to_file(history, file_name=None): function write_history_to_file (line 195) | def write_history_to_file(history, file_basename=None, file_fullname=None): function regular_txt_to_markdown (line 225) | def regular_txt_to_markdown(text): function report_execption (line 237) | def report_execption(chatbot, history, a, b): function text_divide_paragraph (line 246) | def text_divide_paragraph(text): function markdown_convertion (line 262) | def markdown_convertion(txt): function close_up_code_segment_during_stream (line 338) | def close_up_code_segment_during_stream(gpt_reply): function format_io (line 364) | def format_io(self, y): function find_free_port (line 386) | def find_free_port(): function extract_archive (line 398) | def extract_archive(file_path, dest_dir): function find_recent_files (line 443) | def find_recent_files(directory): function promote_file_to_downloadzone (line 466) | def promote_file_to_downloadzone(file, rename_file=None, chatbot=None): function disable_auto_promotion (line 481) | def disable_auto_promotion(chatbot): function on_file_uploaded (line 485) | def on_file_uploaded(files, chatbot, txt, txt2, checkboxes): function on_report_generated (line 523) | def on_report_generated(cookies, files, chatbot): function is_openai_api_key (line 539) | def is_openai_api_key(key): function is_api2d_key (line 544) | def is_api2d_key(key): function is_any_api_key (line 550) | def is_any_api_key(key): function what_keys (line 559) | def what_keys(keys): function select_api_key (line 573) | def select_api_key(keys, llm_model): function load_chat_cookies (line 592) | def load_chat_cookies(): function read_env_variable (line 599) | def read_env_variable(arg, default_value): function read_single_conf_with_lru_cache (line 654) | def read_single_conf_with_lru_cache(arg): function get_conf (line 685) | def get_conf(*args): function clear_line_break (line 694) | def clear_line_break(txt): class DummyWith (line 701) | class DummyWith(): method __enter__ (line 711) | def __enter__(self): method __exit__ (line 714) | def __exit__(self, exc_type, exc_value, traceback): function run_gradio_in_subpath (line 717) | def run_gradio_in_subpath(demo, auth, port, custom_path): function clip_history (line 752) | def clip_history(inputs, history, tokenizer, max_token_limit): function zip_folder (line 809) | def zip_folder(source_folder, dest_folder, zip_name): function gen_time_str (line 840) | def gen_time_str(): function get_log_folder (line 844) | def get_log_folder(user='default', plugin_name='shared'): class ProxyNetworkActivate (line 849) | class ProxyNetworkActivate(): method __enter__ (line 853) | def __enter__(self): method __exit__ (line 861) | def __exit__(self, exc_type, exc_value, traceback): function objdump (line 867) | def objdump(obj, file='objdump.tmp'): function objload (line 873) | def objload(file='objdump.tmp'): function Singleton (line 880) | def Singleton(cls): function set_conf (line 906) | def set_conf(key, value): function set_multi_conf (line 914) | def set_multi_conf(dic): function get_plugin_handle (line 918) | def get_plugin_handle(plugin_name): function get_chat_handle (line 929) | def get_chat_handle(): function get_plugin_default_kwargs (line 935) | def get_plugin_default_kwargs(): function get_chat_default_kwargs (line 964) | def get_chat_default_kwargs(): FILE: utils/torch_utils.py function smart_inference_mode (line 45) | def smart_inference_mode(torch_1_9=check_version(torch.__version__, '1.9... function smartCrossEntropyLoss (line 53) | def smartCrossEntropyLoss(label_smoothing=0.0): function smart_DDP (line 62) | def smart_DDP(model): function torch_distributed_zero_first (line 75) | def torch_distributed_zero_first(local_rank: int): function device_count (line 84) | def device_count(): function select_device (line 94) | def select_device(device='', batch_size=0, newline=True,verbose=True): function time_sync (line 131) | def time_sync(): function get_latest_opset (line 137) | def get_latest_opset(): function intersect_dicts (line 141) | def intersect_dicts(da, db, exclude=()): function profile (line 145) | def profile(input, ops, n=10, device=None): function is_parallel (line 196) | def is_parallel(model): function de_parallel (line 201) | def de_parallel(model): function initialize_weights (line 206) | def initialize_weights(model): function find_modules (line 218) | def find_modules(model, mclass=nn.Conv2d): function sparsity (line 223) | def sparsity(model): function prune (line 232) | def prune(model, amount=0.3): function fuse_conv_and_bn (line 243) | def fuse_conv_and_bn(conv, bn): function model_info (line 266) | def model_info(model, verbose=False, imgsz=640): function scale_img (line 291) | def scale_img(img, ratio=1.0, same_shape=False, gs=32): # img(16,3,256,... function copy_attr (line 303) | def copy_attr(a, b, include=(), exclude=()): function smart_optimizer (line 311) | def smart_optimizer(model, name='Adam', lr=0.001, momentum=0.9, decay=1e... function smart_hub_load (line 383) | def smart_hub_load(repo='ultralytics/yolov5', model='yolov5s', **kwargs): function smart_resume (line 394) | def smart_resume(ckpt, optimizer, ema=None, weights='yolov5s.pt', epochs... class EarlyStopping (line 417) | class EarlyStopping: method __init__ (line 419) | def __init__(self, patience=30): method __call__ (line 425) | def __call__(self, epoch, fitness): class ModelEMA (line 440) | class ModelEMA: method __init__ (line 446) | def __init__(self, model, decay=0.9999, tau=2000, updates=0): method update (line 457) | def update(self, model): method update_attr (line 468) | def update_attr(self, model, include=(), exclude=('process_group', 're... class BatchNormXd (line 472) | class BatchNormXd(torch.nn.modules.batchnorm._BatchNorm): method _check_input_dim (line 473) | def _check_input_dim(self, input): function revert_sync_batchnorm (line 484) | def revert_sync_batchnorm(module): class TracedModel (line 509) | class TracedModel(nn.Module): method __init__ (line 511) | def __init__(self, model=None, device=None, img_size=(640,640)): method forward (line 537) | def forward(self, x, augment=False, profile=False): function get_num_params (line 541) | def get_num_params(model): function get_num_gradients (line 545) | def get_num_gradients(model): function get_flops (line 549) | def get_flops(model, imgsz=640): FILE: utils/video.py function process_video (line 13) | def process_video(video_path): function process_video_chunk (line 44) | async def process_video_chunk(chunk_index, video_chunk, output_folder): function process_video (line 61) | async def process_video(input_file, chunk_size_secs=10, output_folder="o...