上一页 1 2 3 4 5 6 7 8 9 ··· 26 下一页
摘要: import torch a = torch.randint(0, 100, (6,3)) b = torch.Tensor([0, 1, 1, 2, 0, 2]).long() b = b.unsqueeze(1) b0 = b.view(-1, 1) b2 = a.gather(1, b.vie 阅读全文
posted @ 2023-03-25 19:23 无左无右 阅读(15) 评论(0) 推荐(0) 编辑
摘要: static bool show_rt(cv::Mat &show, cv::Rect &rt, int label) { static std::string label_map[] = { "bg", "Pedestrian", "Cyclist", "car" }; // cv::Mat sh 阅读全文
posted @ 2023-03-24 14:32 无左无右 阅读(12) 评论(0) 推荐(0) 编辑
摘要: caffe中需要整个共享变量,就是从bias过来的tensor转图片,然后后面目标检测第一阶段查看定位效果,把目标框画在图上就需要一开始的图片。 实验1:这个可以在prototxt增加一个top通过网络给到后面的层,但是这样太麻烦。 实验2: 然后想想能不能通过类似与共享变量能完成, 首先实验的是在 阅读全文
posted @ 2023-03-24 09:49 无左无右 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 经典图: 复现的github链接 https://github.com/jadore801120/attention-is-all-you-need-pytorch 注释的代码全集: https://download.csdn.net/download/yang332233/87602895 /at 阅读全文
posted @ 2023-03-22 10:44 无左无右 阅读(101) 评论(0) 推荐(0) 编辑
摘要: https://github.com/amdegroot/ssd.pytorch/blob/5b0b77faa955c1917b0c710d770739ba8fbff9b7/layers/functions/detection.py#L58 def forward(self, loc_data, c 阅读全文
posted @ 2023-03-13 11:12 无左无右 阅读(26) 评论(0) 推荐(0) 编辑
摘要: detections_out = torch.tensor([], dtype=torch.float32).to(model_out[0].device) for i in range(5): detections = torch.cat([bboxes, scores, clses], dim= 阅读全文
posted @ 2023-03-10 13:56 无左无右 阅读(109) 评论(0) 推荐(0) 编辑
摘要: torch.triu(input, diagonal=0, *, out=None) → Tensor 返回一个上三角矩阵 参数: input:输入的张量 diagonal:对角线 返回矩阵(二维张量)或矩阵批次 input 的上三角部分,结果张量 out 的其他元素设置为 0。 矩阵的上三角部分定 阅读全文
posted @ 2023-02-27 11:02 无左无右 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 需要直接打开项目工程文件夹,然后点击左侧的蜘蛛按钮然后点击生成launch.json launch.json ``` { // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwli 阅读全文
posted @ 2023-02-24 15:23 无左无右 阅读(1079) 评论(0) 推荐(0) 编辑
摘要: python中冒号实际上有两个意思: 1.全部选择 matrix1[1, :]表示matrix的第1行的所有元素 matrix1[:, 1]表示matrix的第1列的所有元素 2. 表示区间, 含左不含右 matrix1[1, 0:3]表示matrix的第1行的索引为[0, 3)的元素 matrix 阅读全文
posted @ 2023-02-23 21:34 无左无右 阅读(287) 评论(0) 推荐(0) 编辑
摘要: torch.cuda.synchronize() start = time.time() result = model(return_loss=False, rescale=True, **data) torch.cuda.synchronize() end = time.time() print( 阅读全文
posted @ 2023-02-17 18:05 无左无右 阅读(24) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 26 下一页