realIADD3复现笔记

部署运行你感兴趣的模型镜像

如何查找每个下一级子目录下所有png个数

find /home/c1/zgp/real_IADD3 -maxdepth 1 -type d ! -path “/home/c1/zgp/real_IADD3” | while read subdir; do
count= ( f i n d " (find " (find"subdir" -type f -name “*.png” | wc -l)
echo “$subdir : $count PNG files”
done

/home/c1/zgp/real_IADD3/audio_jack_socket : 225 PNG files
/home/c1/zgp/real_IADD3/common_mode_filter : 200 PNG files
/home/c1/zgp/real_IADD3/connector_housing_female : 200 PNG files
/home/c1/zgp/real_IADD3/crimp_st_cable_mount_box : 175 PNG files
/home/c1/zgp/real_IADD3/dc_power_connector : 200 PNG files
/home/c1/zgp/real_IADD3/ethernet_connector : 150 PNG files
/home/c1/zgp/real_IADD3/ferrite_bead : 125 PNG files
/home/c1/zgp/real_IADD3/fork_crimp_terminal : 175 PNG files
/home/c1/zgp/real_IADD3/fuse_holder : 150 PNG files
/home/c1/zgp/real_IADD3/headphone_jack_socket : 250 PNG files
/home/c1/zgp/real_IADD3/knob_cap : 150 PNG files
/home/c1/zgp/real_IADD3/lattice_block_plug : 200 PNG files
/home/c1/zgp/real_IADD3/lego_pin_connector_plate : 200 PNG files
/home/c1/zgp/real_IADD3/lego_propeller : 150 PNG files
/home/c1/zgp/real_IADD3/miniature_lifting_motor : 100 PNG files
/home/c1/zgp/real_IADD3/humidity_sensor : 200 PNG files
/home/c1/zgp/real_IADD3/limit_switch : 200 PNG files
/home/c1/zgp/real_IADD3/power_jack : 150 PNG files
/home/c1/zgp/real_IADD3/purple_clay_pot : 200 PNG files
/home/c1/zgp/real_IADD3/telephone_spring_switch : 250 PNG files

s_map.shape torch.Size([50176, 3])
Extracting test features for class bagel: 0%| | 0/110 [00:09<?, ?it/s]
Traceback (most recent call last):
File “main.py”, line 156, in
run_3d_ads(args)
File “main.py”, line 34, in run_3d_ads
image_rocaucs, pixel_rocaucs, au_pros = model.evaluate(cls)
File “/home/c1/zgp/realIAD_main/main-main/m3dm_runner.py”, line 118, in evaluate
method.predict(sample, mask, label)
File “/home/c1/zgp/realIAD_main/main-main/feature_extractors/multiple_features.py”, line 772, in predict
self.compute_s_s_map(xyz_patch, rgb_patch, fusion_patch, xyz_patch_full_resized[0].shape[-2:], mask, label, center, neighbor_idx, nonzero_indices, unorganized_pc_no_zeros.contiguous(), center_idx)
File “/home/c1/zgp/realIAD_main/main-main/feature_extractors/multiple_features.py”, line 975, in compute_s_s_map
s = torch.tensor(self.detect_fuser.score_samples(s))
File "/home/hanmh/anaconda3/envs/zgp_m3dm/lib/python3.8/site-packages/sklearn/linear_model/stochastic_gradient.py", line 2546, in score_samples
score_samples = self.decision_function(X) + self.offset

File “/home/hanmh/anaconda3/envs/zgp_m3dm/lib/python3.8/site-packages/sklearn/linear_model/stochastic_gradient.py", line 2526, in decision_function
check_is_fitted(self, "coef
”)
File “/home/hanmh/anaconda3/envs/zgp_m3dm/lib/python3.8/site-packages/sklearn/utils/validation.py”, line 1461, in check_is_fitted
raise NotFittedError(msg % {“name”: type(estimator).name})
sklearn.exceptions.NotFittedError: This SGDOneClassSVM instance is not fitted yet. Call ‘fit’ with appropriate arguments before using this estimator.

python3.8 main.py --dataset_type mvtec3d --dataset_path /home/zgp/Documents/m3dmpre/datasets/mvtec3d --method_name DINO+Point_MAE+Fusion --rgb_backbone_name vit_base_patch8_224_dino --xyz_backbone_name Point_MAE --fusion_module_path /home/zgp/Documents/M3DM_5_3080/EyecheckpointsFPFHDINOm3dm/checkpoint-2.pth --img_size 224 --max_sample 400 --coreset_eps 0.9 --save_preds

find /home/zgp/Documents/m3dmpre/datasets/mvtec3d -maxdepth 1 -type d ! -path “/home/zgp/Documents/m3dmpre/datasets/mvtec3d” | while read subdir; do count= ( f i n d " (find " (find"subdir" -type f -name “*.png” | wc -l); echo “$subdir : $count PNG files”; done
/home/zgp/Documents/m3dmpre/datasets/mvtec3d/cable_gland : 462 PNG files
/home/zgp/Documents/m3dmpre/datasets/mvtec3d/dowel : 582 PNG files
/home/zgp/Documents/m3dmpre/datasets/mvtec3d/carrot : 633 PNG files
/home/zgp/Documents/m3dmpre/datasets/mvtec3d/peach : 667 PNG files
/home/zgp/Documents/m3dmpre/datasets/mvtec3d/tire : 463 PNG files
/home/zgp/Documents/m3dmpre/datasets/mvtec3d/bagel : 486 PNG files
/home/zgp/Documents/m3dmpre/datasets/mvtec3d/cookie : 494 PNG files
/home/zgp/Documents/m3dmpre/datasets/mvtec3d/potato : 561 PNG files
/home/zgp/Documents/m3dmpre/datasets/mvtec3d/foam : 463 PNG files
/home/zgp/Documents/m3dmpre/datasets/mvtec3d/rope : 533 PNG files

您可能感兴趣的与本文相关的镜像

PyTorch 2.5

PyTorch 2.5

PyTorch
Cuda

PyTorch 是一个开源的 Python 机器学习库,基于 Torch 库,底层由 C++ 实现,应用于人工智能领域,如计算机视觉和自然语言处理

### 关于代码复现笔记与教程 #### 1. **NeRF代码复现** 对于基于NeRF(Neural Radiance Fields)模型的代码复现,可以参考 pengsida 的 Learning NeRF 框架。该框架最初是针对Linux环境开发的,在Windows环境下可能会遇到一些兼容性问题[^1]。因此,如果计划在Windows上运行此项目,则需要注意修复可能存在的bug。 为了更好地理解整个流程并完成代码复现,建议按照以下模块逐步学习: - 导入必要的Python库[^2]。 - 加载数据集,并对其进行预处理。 - 设计NeRF神经网络结构。 - 实现位置编码函数以增强输入特征表示能力。 - 编写光线采样函数用于三维空间中的点选取。 - 开发分层采样机制来提高效率和效果。 - 对采样得到的点坐标进行归一化操作。 - 计算每条光线所对应的像素颜色值。 - 构建渲染管线模拟真实图像生成过程。 - 处理采集到的数据以便后续训练阶段使用。 - 定义损失函数并通过反向传播算法调整参数实现优化目标。 - 将最终结果保存为视频文件展示动态变化情况。 以下是部分核心功能实现示例: ```python import torch from nerf_model import NerfModel def position_encoding(x, L=10): """ Apply positional encoding to input vector. Args: x (torch.Tensor): Input tensor of shape [..., C]. L (int): Number of frequency bands. Returns: encoded_x (torch.Tensor): Encoded tensor with increased dimensionality. """ pi = torch.tensor([3.141592653589793], device=x.device) freq_bands = [(2**l)*pi for l in range(L)] encodings = [x] for f in freq_bands: encodings.append(torch.sin(f*x)) encodings.append(torch.cos(f*x)) encoded_x = torch.cat(encodings, dim=-1) return encoded_x model = NerfModel() ``` #### 2. **Roop项目的Git克隆与安装指南** 另一个值得关注的是 roop 工具,它可以通过简单的命令行指令获取其最新版本源码[^3]: ```bash git clone https://github.com/s0md3v/roop ``` 这一步骤完成后即可进入下一步配置工作。 #### 3. **Docker容器内的DETR VAE组件改造** 当涉及到更复杂的深度学习架构比如 DETR 中集成VAE变体时,有时需要手动编辑特定脚本文件来进行定制化的改动[^4]。例如 `/detr/model/detr_vae.py` 文件第285行处应替换原有的 `build_transformer()` 函数调用为新的构建器方法即 `build_encoder(args)` 来适配当前需求场景下的新特性支持。 #### 4. **依赖管理工具 Pip 使用技巧** 最后提醒一下有关 Python 包管理方面的小贴士:通过指定额外索引URL选项能够加速国内用户的下载速度;而卸载不再使用的软件包则有助于保持系统整洁高效运作状态[^5]。具体命令如下所示: ```bash pip install package_name (-i http://pypi.douban.com/simple --trusted-host pypi.douban.com) pip uninstall package_name pip list ``` ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值