设置type="range"为vertical

本文详细介绍了如何通过CSS属性-webkit-appearance设置input type='range'为垂直显示,并提供了相关链接以供进一步学习。
# model settings model_cfg = dict( backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(3, ), style='pytorch'), neck=dict(type='GlobalAveragePooling'), head=dict( type='LinearClsHead', num_classes=1000, in_channels=2048, loss=dict(type='CrossEntropyLoss', loss_weight=1.0), topk=(1, 5),)) # dataloader pipeline img_lighting_cfg = dict( eigval=[55.4625, 4.7940, 1.1475], eigvec=[[-0.5675, 0.7192, 0.4009], [-0.5808, -0.0045, -0.8140], [-0.5836, -0.6948, 0.4203]], alphastd=0.1, to_rgb=True) policies = [ dict(type='AutoContrast', prob=0.5), dict(type='Equalize', prob=0.5), dict(type='Invert', prob=0.5), dict( type='Rotate', magnitude_key='angle', magnitude_range=(0, 30), pad_val=0, prob=0.5, random_negative_prob=0.5), dict( type='Posterize', magnitude_key='bits', magnitude_range=(0, 4), prob=0.5), dict( type='Solarize', magnitude_key='thr', magnitude_range=(0, 256), prob=0.5), dict( type='SolarizeAdd', magnitude_key='magnitude', magnitude_range=(0, 110), thr=128, prob=0.5), dict( type='ColorTransform', magnitude_key='magnitude', magnitude_range=(-0.9, 0.9), prob=0.5, random_negative_prob=0.), dict( type='Contrast', magnitude_key='magnitude', magnitude_range=(-0.9, 0.9), prob=0.5, random_negative_prob=0.), dict( type='Brightness', magnitude_key='magnitude', magnitude_range=(-0.9, 0.9), prob=0.5, random_negative_prob=0.), dict( type='Sharpness', magnitude_key='magnitude', magnitude_range=(-0.9, 0.9), prob=0.5, random_negative_prob=0.), dict( type='Shear', magnitude_key='magnitude', magnitude_range=(0, 0.3), pad_val=0, prob=0.5, direction='horizontal', random_negative_prob=0.5), dict( type='Shear', magnitude_key='magnitude', magnitude_range=(0, 0.3), pad_val=0, prob=0.5, direction='vertical', random_negative_prob=0.5), dict( type='Cutout', magnitude_key='shape', magnitude_range=(1, 41), pad_val=0, prob=0.5), dict( type='Translate', magnitude_key='magnitude', magnitude_range=(0, 0.3), pad_val=0, prob=0.5, direction='horizontal', random_negative_prob=0.5, interpolation='bicubic'), dict( type='Translate', magnitude_key='magnitude', magnitude_range=(0, 0.3), pad_val=0, prob=0.5, direction='vertical', random_negative_prob=0.5, interpolation='bicubic') ] train_pipeline = [ dict(type='LoadImageFromFile'), dict( type='RandAugment', policies=policies, num_policies=2, magnitude_level=12), dict( type='RandomResizedCrop', size=224, efficientnet_style=True, interpolation='bicubic', backend='pillow'), dict(type='RandomFlip', flip_prob=0.5, direction='horizontal'), dict(type='ColorJitter', brightness=0.4, contrast=0.4, saturation=0.4), dict(type='Lighting', **img_lighting_cfg), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=False), dict(type='ImageToTensor', keys=['img']), dict(type='ToTensor', keys=['gt_label']), dict(type='Collect', keys=['img', 'gt_label']) ] val_pipeline = [ dict(type='LoadImageFromFile'), dict( type='CenterCrop', crop_size=224, efficientnet_style=True, interpolation='bicubic', backend='pillow'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img']) ] # train data_cfg = dict( batch_size = 32, num_workers = 4, train = dict( pretrained_flag = False, pretrained_weights = '', freeze_flag = False, freeze_layers = ('backbone',), epoches = 100, ), test=dict( ckpt = '', metrics = ['accuracy', 'precision', 'recall', 'f1_score', 'confusion'], metric_options = dict( topk = (1,5), thrs = None, average_mode='none' ) ) ) # batch 32 # lr = 0.1 *32 /256 # optimizer optimizer_cfg = dict( type='SGD', lr=0.1 * 32/256, momentum=0.9, weight_decay=1e-4) # learning lr_config = dict(type='StepLrUpdater', step=[30, 60, 90]) 要求:每一句代码都需要单独详细解释,不仅需要告诉我在整段中它的作用,还需要剖析代码结构告诉我为何要这样写,所提及到的函数是怎样的编写逻辑以及怎么使用
10-16
def compare_table(self, block_name, old_table, new_table, belong_to): logger.info(f"start compare table, old_data_id: {old_table.data_id}, new_data_id: {new_table.data_id}") # 使表格内列数一致 self.align_table_col(old_table, new_table) # 表格中存在大量视觉上merge但是实际未合并的空格,需要将空格赋值为正确的文本,防止影响相似度匹配 self.fill_visual_merged_cells(old_table) self.fill_visual_merged_cells(new_table) if old_table.head_type == new_table.head_type == 'horizontal': old_col_table, new_col_table = self.transpose_table(old_table, new_table) else: if old_table.head_type == 'vertical': new_table.head_list = old_table.head_list new_table.head_type = 'vertical' elif new_table.head_type == 'vertical': old_table.head_list = new_table.head_list old_table.head_type = 'vertical' old_col_table, new_col_table = old_table, new_table # 列匹配 del_cols, add_cols = old_col_table.rows, new_col_table.rows col_matched = CustomTableStrategyMiddleware(self._path_base).match_row(del_cols, add_cols,is_col=True, head_indexes=[old_table.head_list,new_table.head_list]) if col_matched: matched_old_cols, matched_new_cols = list(zip(*list(col_matched))) del_cols = [old_col for old_col in old_col_table.rows if old_col not in matched_old_cols] add_cols = [new_col for new_col in new_col_table.rows if new_col not in matched_new_cols] sub_type = 'col' if old_table.head_type == 'horizontal' else 'row' ls_col_delete, ls_col_add = self.process_delete_add_diff(block_name, sub_type, del_cols, add_cols, belong_to=belong_to, head_type=old_table.head_type) # 根据matched的列组合新的表,得到列一致的两个表 if col_matched: old_col_indexes,new_col_indexes =[],[] for old_col, new_col in col_matched: old_col_indexes.append(old_col_table.rows.index(old_col)) new_col_indexes.append(new_col_table.rows.index(new_col)) old_equal_col_table = self.choice_cols(old_table, old_col_indexes) new_equal_col_table = self.choice_cols(new_table, new_col_indexes) else: return ls_col_delete, ls_col_add, [] # 行匹配 del_rows, add_rows = old_equal_col_table.rows, new_equal_col_table.rows row_matched = CustomTableStrategyMiddleware(self._path_base).match_row(del_rows, add_rows, is_col=False) if row_matched: matched_old_rows, matched_new_rows = list(zip(*list(row_matched))) del_rows_indexes = [idx for idx, old_row in enumerate(old_equal_col_table.rows) if old_row not in matched_old_rows] add_rows_indexes = [idx for idx, new_row in enumerate(new_equal_col_table.rows) if new_row not in matched_new_rows] # 使用没有重组前的表,横表头直接处理,竖表头需要转置 if old_table.head_type == new_table.head_type == 'horizontal': del_rows = [old_table.rows[idx] for idx in del_rows_indexes] add_rows = [new_table.rows[idx] for idx in add_rows_indexes] else: old_transpose_table = self.choice_cols(old_table, list(range(len(old_table.rows)))) new_transpose_table = self.choice_cols(new_table, list(range(len(new_table.rows)))) del_rows = [old_transpose_table.rows[idx] for idx in del_rows_indexes] add_rows = [new_transpose_table.rows[idx] for idx in add_rows_indexes] sub_type = 'row' if old_table.head_type == 'horizontal' else 'col' ls_row_delete, ls_row_add = self.process_delete_add_diff(block_name, sub_type, del_rows, add_rows, belong_to=belong_to, head_type=old_table.head_type) # 根据matched的行组合新的表,得到行一致的两个表 if row_matched: old_equal_row_table, new_equal_row_table = TableObject(), TableObject() old_equal_row_table.rows = list(matched_old_rows) old_equal_row_table.head_type = old_table.head_type self.copy_table_attrs(old_equal_row_table, old_table) new_equal_row_table.rows = list(matched_new_rows) new_equal_row_table.head_type = new_table.head_type self.copy_table_attrs(new_equal_row_table, new_table) # 查找行变更、列变更、单元格变更 ls_row_update, ls_col_update, ls_cell_update = self.compare_ordered_tables(block_name,old_equal_row_table, new_equal_row_table,belong_to=belong_to) else: ls_row_update, ls_col_update, ls_cell_update = [], [], [] part_delete = ls_row_delete + ls_col_delete part_add = ls_row_add + ls_col_add part_update = ls_row_update + ls_col_update + ls_cell_update logger.info(f"finish compare table, old_data_id: {old_table.data_id}, new_data_id: {new_table.data_id}") return part_delete, part_add, part_update 详细解析一下
09-30
我的pyecharts为1.9.0 --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[52], line 33 16 mark_x_value = x_data[mark_x_index] 18 # 添加垂直于X轴的标记线(从y=0到最大y值) 19 line_chart.set_global_opts( 20 title_opts=opts.TitleOpts(title="电池温度监测图表(带垂直线标记)"), 21 tooltip_opts=opts.TooltipOpts(trigger="axis"), 22 toolbox_opts=opts.ToolboxOpts(is_show=True), 23 xaxis_opts=opts.AxisOpts(type_="category"), 24 yaxis_opts=opts.AxisOpts(type_="value"), 25 datazoom_opts=[ 26 opts.DataZoomOpts(type_="slider", range_start=0, range_end=100), 27 opts.DataZoomOpts(type_="inside", range_start=0, range_end=100), 28 ], 29 # 添加标记线配置 30 # 修改MarkLineItem配置,添加type_='vertical'明确垂直线类型 31 markline_opts=opts.MarkLineOpts( 32 data=[ ---> 33 opts.MarkLineItem( 34 type_='vertical', # 关键:声明垂直线类型 35 x=mark_x_value, 36 symbol="none", 37 linestyle_opts=opts.LineStyleOpts( 38 color="#FF0000", 39 width=2, 40 type_="dashed" 41 ), 42 label_opts=opts.LabelOpts( 43 position="insideStartTop", 44 formatter=f"标记点: {mark_x_value}" 45 ) 46 ) 47 ] 48 ) 49 ) 52 # # 全局设置 53 # line_chart.set_global_opts( 54 # title_opts=opts.TitleOpts(title="信号折线图"), # 图表标题 (...) 62 # ] 63 # ) 65 line_chart.render("./result_analyze_map/"+vehicle_no+"_basic_map.html") TypeError: __init__() got an unexpected keyword argument 'linestyle_opts'
07-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值