This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
CogVideoX-2b Gradio demo — LOW-VRAM build for 16GB GPUs (e.g., 4060 Ti 16G) | |
UI updated for Chinese support, added a quick reset button for low-VRAM defaults. | |
""" | |
from __future__ import annotations | |
import argparse | |
import os | |
from pathlib import Path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
CogVideoX-2b Gradio demo — LOW-VRAM build for 16GB GPUs (e.g., 4060 Ti 16G) | |
Fix: added ndim existence checks to avoid AttributeError when output is None or unexpected. | |
""" | |
from __future__ import annotations | |
import argparse | |
import os | |
from pathlib import Path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pycocotools.coco import COCO | |
from pycocotools.cocoeval import COCOeval | |
import argparse | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def coco_eval(args): | |
cocoGt = COCO(args.gt_json) | |
cocoDt = cocoGt.loadRes(args.pred_json) | |
cocoEval = COCOeval(cocoGt, cocoDt, args.eval_type) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/developer0hye/PyTorch-Darknet53 | |
import torch | |
from torch import nn | |
def conv_batch(in_num, out_num, kernel_size=3, padding=1, stride=1): | |
return nn.Sequential( | |
nn.Conv2d(in_num, out_num, kernel_size=kernel_size, stride=stride, padding=padding, bias=False), | |
nn.BatchNorm2d(out_num), | |
nn.LeakyReLU()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://blog.csdn.net/weixin_43397208/article/details/131352685 | |
import torch | |
import torch.nn as nn | |
class IdentityBlock(nn.Module): | |
def __init__(self, in_channel, kl_size, filters): | |
super(IdentityBlock, self).__init__() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jpg files | |
a=1 | |
for i in *.jpg; do | |
new=$(printf "%04d.jpg" "$a") | |
mv -i -- "$i" "$new" | |
let a="$a+1" | |
done | |
# xml files | |
a=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
layer filters size input output | |
0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32 | |
1 conv 64 3 x 3 / 2 416 x 416 x 32 -> 208 x 208 x 64 | |
2 conv 32 1 x 1 / 1 208 x 208 x 64 -> 208 x 208 x 32 | |
3 conv 64 3 x 3 / 1 208 x 208 x 32 -> 208 x 208 x 64 | |
4 Shortcut Layer: 1 | |
5 conv 128 3 x 3 / 2 208 x 208 x 64 -> 104 x 104 x 128 | |
6 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x 64 | |
7 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 | |
8 Shortcut Layer: 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In[98]: | |
import os | |
from os.path import splitext | |
from collections import Counter | |
def compare(path): | |
# List containing all file names + their extension in path directory | |
myDir = os.listdir(path) | |
# List containing all file names without their extension | |
l = [splitext(filename)[0] for filename in myDir] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In[98]: | |
import pandas as pd | |
import os, glob | |
import sys | |
import shutil | |
import numpy as np | |
import cv2 | |
# In[98]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
import shutil | |
tp = 'TP' | |
fp = 'FP' | |
fn = 'FN' | |
model_name = 'yolo' |
NewerOlder