首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

3333333333333333333333333333333333

前端 20.44KB 62 需要积分: 1
立即下载

资源介绍:

3333333333333333333333
import copy import math import os import cv2 import horizon_plugin_pytorch as horizon import numpy as np import torch from hbdk.torch_script.placeholder import placeholder from horizon_plugin_pytorch.march import March from PIL import Image from torch import Tensor from torchvision.transforms.functional import pil_to_tensor from torchvision.transforms.functional_tensor import resize import hat.data.datasets.nuscenes_dataset as NuscenesDataset from hat.data.collates.nusc_collates import collate_nuscenes from hat.metrics.mean_iou import MeanIOU from hat.utils.config import ConfigVersion VERSION = ConfigVersion.v2 training_step = os.environ.get("HAT_TRAINING_STEP", "float") task_name = "bev_lss_efficientnetb0_multitask_nuscenes" bn_kwargs = {} refine_levels = 4 maxdisp = 192 batch_size_per_gpu = 4 device_ids = [0, 1, 2, 3] dataloader_workers = batch_size_per_gpu # per gpu ckpt_dir = "./tmp_models/%s" % task_name cudnn_benchmark = True seed = None log_rank_zero_only = True march = March.BAYES convert_mode = "fx" enable_amp = False orig_shape = (3, 900, 1600) resize_shape = (3, 396, 704) data_shape = (3, 256, 704) val_data_shape = (3, 256, 704) bn_kwargs = dict(eps=2e-5, momentum=0.1) vt_input_hw = ( 16, 44, ) # view transformer input shape for generationg reference points. weight_decay = 0.01 start_lr = 2e-4 train_epochs = 30 bev_size = (51.2, 51.2, 0.8) grid_size = (128, 128) map_size = (15, 30, 0.15) task_map_size = (15, 30, 0.15) qat_lr = 2e-5 qat_train_epochs = 10 data_rootdir = "./tmp_data/nuscenes/v1.0-trainval/" meta_rootdir = "./tmp_data/nuscenes/meta" seg_classes_name = ["others", "divider", "ped_crossing", "Boundary"] use_bce = False if use_bce: seg_classes = 3 else: seg_classes = 3 + 1 depth = 60 num_points = 10 # model def get_grid_quant_scale(grid_shape, view_shape): max_coord = max(*grid_shape, *view_shape) coord_bit_num = math.ceil(math.log(max_coord + 1, 2)) coord_shift = 15 - coord_bit_num coord_shift = max(min(coord_shift, 8), 0) grid_quant_scale = 1.0 / (1 << coord_shift) return grid_quant_scale view_shape = [data_shape[1] / 16, data_shape[2] / 16] featview_shape = [view_shape[0] * 6, view_shape[1]] grid_quant_scale = get_grid_quant_scale(grid_size, featview_shape) depthview_shape = [6 * depth, view_shape[0] * view_shape[1]] depth_quant_scale = get_grid_quant_scale(grid_size, depthview_shape) map_shape = [ int(task_map_size[1] * 2 / task_map_size[2]), int(task_map_size[0] * 2 / task_map_size[2]), ] map_grid_quant_scale = get_grid_quant_scale(map_shape, view_shape) tasks = [ dict(name="car", num_class=1, class_names=["car"]), dict( name="truck", num_class=2, class_names=["truck", "construction_vehicle"], ), dict(name="bus", num_class=2, class_names=["bus", "trailer"]), dict(name="barrier", num_class=1, class_names=["barrier"]), dict(name="bicycle", num_class=2, class_names=["motorcycle", "bicycle"]), dict( name="pedestrian", num_class=2, class_names=["pedestrian", "traffic_cone"], ), ] model = dict( type="ViewFusion", bev_feat_index=-1, bev_upscale=2, backbone=dict( type="efficientnet", bn_kwargs=bn_kwargs, model_type="b0", num_classes=1000, include_top=False, activation="relu", use_se_block=False, ), neck=dict( type="FastSCNNNeck", in_channels=[112, 320], feat_channels=[64, 64], indexes=[-2, -1], bn_kwargs=bn_kwargs, scale_factor=2, ), stereoNetHeadPlus=dict( type="StereoNetHead", maxdisp=maxdisp, bn_kwargs=bn_kwargs, refine_levels=refine_levels, ), stereoNetPostProcessPlus=dict( type="StereoNetPostProcess", maxdisp=maxdisp, ), view_transformer=dict( type="LSSTransformer", in_channels=64, feat_channels=64, z_range=(-10.0, 10.0), depth=depth, num_points=num_points, bev_size=bev_size, grid_size=grid_size, num_views=6, grid_quant_scale=grid_quant_scale, depth_grid_quant_scale=depth_quant_scale, ), bev_transforms=[ dict( type="BevFeatureRotate", bev_size=bev_size, rot=(-0.3925, 0.3925), ), ], bev_encoder=dict( type="BevEncoder", backbone=dict( type="efficientnet", bn_kwargs=bn_kwargs, model_type="b0", num_classes=1000, include_top=False, activation="relu", use_se_block=False, input_channels=64, quant_input=False, ), neck=dict( type="BiFPN", in_strides=[2, 4, 8, 16, 32], out_strides=[2, 4, 8, 16, 32], stride2channels=dict({2: 16, 4: 24, 8: 40, 16: 112, 32: 320}), out_channels=48, num_outs=5, stack=3, start_level=0, end_level=-1, fpn_name="bifpn_sum", upsample_type="function", use_fx=True, ), ), bev_decoders=[ dict( type="BevSegDecoder", name="bev_seg", use_bce=use_bce, bev_size=bev_size, task_size=task_map_size, grid_quant_scale=map_grid_quant_scale, task_weight=10.0, head=dict( type="DepthwiseSeparableFCNHead", input_index=0, in_channels=48, feat_channels=48, num_classes=seg_classes, dropout_ratio=0.1, num_convs=2, bn_kwargs=bn_kwargs, int8_output=False, ), target=dict( type="FCNTarget", ), loss=dict( type="CrossEntropyLoss", loss_name="seg", reduction="mean", ignore_index=-1, use_sigmoid=use_bce, class_weight=2.0 if use_bce else [1.0, 5.0, 5.0, 5.0], ), decoder=dict( type="FCNDecoder", upsample_output_scale=1, use_bce=use_bce, bg_cls=-1, ), ), dict( type="BevDetDecoder", name="bev_det", task_weight=1.0, head=dict( type="DepthwiseSeparableCenterPointHead", in_channels=48, tasks=tasks, share_conv_channels=48, share_conv_num=1, common_heads=dict( reg=(2, 2), height=(1, 2), dim=(3, 2), rot=(2, 2), vel=(2, 2), ), head_conv_channels=48, num_heatmap_convs=2, final_kernel=3, ), target=dict( type="CenterPointTarget", class_names=NuscenesDataset.CLASSES, tasks=tasks, gaussian_overlap=0.1, min_radius=2, out_size_factor=1, norm_bbox=True, max_num=500, bbox_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.2, 0.2], ), loss_cls=dict(type="GaussianFocalLoss", loss_weight=1.0), loss_reg=dict( type="L1Loss", loss_weight=0.25, ), decoder=dict( type="CenterPointDecoder", class_names=NuscenesDataset.CLASSES, tasks=tasks, bev_size=bev_size, out_size_factor=1, score_threshold=0.1, use_max_pool=True, nms_type=[ "rotate", "rotate",

资源文件列表:

stereonet.zip 大约有8个文件
  1. stereonet/
  2. stereonet/__init__.py 389B
  3. stereonet/head.py 18.49KB
  4. stereonet/headplus.py 23.26KB
  5. stereonet/neck.py 8.01KB
  6. stereonet/post_process.py 3.47KB
  7. stereonet/view_fusion.py 8.01KB
  8. stereonet/bev_lss_efficientnetb0_multitask_nuscenes.py 26.53KB
0评论
提交 加载更多评论
其他资源 ruoyi-springcloud-quartz
若依微服务项目中的quartz模块包
gtk3 + sqlite3实现登录注册功能(前后端分离)完整源码
gtk3实现的登录和注册可视化窗口
chnsenticorp.zip
chnsenticorp.zip
Swing (三原色)调色板(打包后)
包含两个文件:1.8版本的 jre 及该项目的 .exe文件
“gtk3管理端+tcp线程多并发后台+客户端”源码
tcp服务器和客户端之间实现多线程通信。gtk3管理端部署在服务器上,从sqlite3数据库获取数据实现可视化
Argyll-V3.2.0-win32-exe
DisplayCAL给显示器校色,安装DisplayCAL软件后最新安装ArgyllCMS色彩引擎文件,win32
【STM32+HAL】FreeRTOS的CubeMX配置
一、所用工具 1、芯片: STM32F407ZET6 2、STM32CubeMx软件 3、IDE: MDK-Keil软件 4、STM32F4xxHAL库 二、实现功能 1、使用CubeMx进行FreeRTOS的初始化配置 2、实现LED每隔500ms闪烁一次 ​
Argyll-V3.2.0-win64-exe
DisplayCAL给显示器校色,安装DisplayCAL软件后最新安装ArgyllCMS色彩引擎文件