mypad2

自动重置事件不会丢失

win32多线程程序设计   第四章  事件 

提到

“除非有线程正在等待,否则 event 不会被保存下来”

但是我试了下,并不会出现这种情形。

void CwaitEventDlg::OnBnClickedButton1()
{
	SetEvent(m_hEvent);
	Sleep(10);
	DWORD ret = WaitForSingleObject(m_hEvent, 1000);
	if (WAIT_TIMEOUT == ret)
	{
		MessageBox(_T("TimerOut"));
	}
	else if (WAIT_OBJECT_0 == ret)
	{
		MessageBox(_T("object_0"));
	}
}


def sfb1d_atrous(lo, hi, g0, g1, mode='periodization', dim=-1, dilation=1, pad1=None, pad=None): """ 1D synthesis filter bank of an image tensor with no upsampling. Used for the stationary wavelet transform. """ C = lo.shape[1] d = dim % 4 # If g0, g1 are not tensors, make them. If they are, then assume that they # are in the right order if not isinstance(g0, torch.Tensor): g0 = torch.tensor(np.copy(np.array(g0).ravel()), dtype=torch.float, device=lo.device) if not isinstance(g1, torch.Tensor): g1 = torch.tensor(np.copy(np.array(g1).ravel()), dtype=torch.float, device=lo.device) L = g0.numel() shape = [1,1,1,1] shape[d] = L # If g aren't in the right shape, make them so if g0.shape != tuple(shape): g0 = g0.reshape(*shape) if g1.shape != tuple(shape): g1 = g1.reshape(*shape) g0 = torch.cat([g0]*C,dim=0) g1 = torch.cat([g1]*C,dim=0) # Calculate the padding size. # With dilation, zeros are inserted between the filter taps but not after. # that means a filter that is [a b c d] becomes [a 0 b 0 c 0 d]. centre = L / 2 fsz = (L-1)*dilation + 1 newcentre = fsz / 2 before = newcentre - dilation*centre # When conv_transpose2d is done, a filter with k taps expands an input with # N samples to be N + k - 1 samples. The 'padding' is really the opposite of # that, and is how many samples on the edges you want to cut out. # In addition to this, we want the input to be extended before convolving. # This means the final output size without the padding option will be # N + k - 1 + k - 1 # The final thing to worry about is making sure that the output is centred. short_offset = dilation - 1 centre_offset = fsz % 2 a = fsz//2 b = fsz//2 + (fsz + 1) % 2 # a = 0 # b = 0 pad = (0, 0, a, b) if d == 2 else (a, b, 0, 0) lo = mypad(lo, pad=pad, mode=mode) hi = mypad(hi, pad=pad, mode=mode) unpad = (fsz - 1, 0) if d == 2 else (0, fsz - 1) unpad = (0, 0) y = F.conv_transpose2d(lo, g0, padding=unpad, groups=C, dilation=dilation) + \ F.conv_transpose2d(hi, g1, padding=unpad, groups=C, dilation=dilation) # pad = (L-1, 0) if d == 2 else (0, L-1) # y = F.conv_transpose2d(lo, g0, padding=pad, groups=C, dilation=dilation) + \ # F.conv_transpose2d(hi, g1, padding=pad, groups=C, dilation=dilation) # # # Calculate the pad size # L2 = (L * dilation)//2 # # pad = (0, 0, L2, L2+dilation) if d == 2 else (L2, L2+dilation, 0, 0) # a = dilation*2 # b = dilation*(L-2) # if pad1 is None: # pad1 = (0, 0, a, b) if d == 2 else (a, b, 0, 0) # print(pad1) # lo = mypad(lo, pad=pad1, mode=mode) # hi = mypad(hi, pad=pad1, mode=mode) # if pad is None: # p = (a + b + (L - 1)*dilation)//2 # pad = (p, 0) if d == 2 else (0, p) # print(pad) return y/(2*dilation) def sfb2d_atrous(ll, lh, hl, hh, filts, mode='zero'): """ Does a single level 2d wavelet reconstruction of wavelet coefficients. Does separate row and column filtering by two calls to :py:func:`pytorch_wavelets.dwt.lowlevel.sfb1d` Inputs: ll (torch.Tensor): lowpass coefficients lh (torch.Tensor): horizontal coefficients hl (torch.Tensor): vertical coefficients hh (torch.Tensor): diagonal coefficients filts (list of ndarray or torch.Tensor): If a list of tensors has been given, this function assumes they are in the right form (the form returned by :py:func:`~pytorch_wavelets.dwt.lowlevel.prep_filt_sfb2d`). Otherwise, this function will prepare the filters to be of the right form by calling :py:func:`~pytorch_wavelets.dwt.lowlevel.prep_filt_sfb2d`. mode (str): 'zero', 'symmetric', 'reflect' or 'periodization'. Which padding to use. If periodization, the output size will be half the input size. Otherwise, the output size will be slightly larger than half. """ tensorize = [not isinstance(x, torch.Tensor) for x in filts] if len(filts) == 2: g0, g1 = filts if True in tensorize: g0_col, g1_col, g0_row, g1_row = prep_filt_sfb2d(g0, g1) else: g0_col = g0 g0_row = g0.transpose(2,3) g1_col = g1 g1_row = g1.transpose(2,3) elif len(filts) == 4: if True in tensorize: g0_col, g1_col, g0_row, g1_row = prep_filt_sfb2d(*filts) else: g0_col, g1_col, g0_row, g1_row = filts else: raise ValueError("Unknown form for input filts") lo = sfb1d_atrous(ll, lh, g0_col, g1_col, mode=mode, dim=2) hi = sfb1d_atrous(hl, hh, g0_col, g1_col, mode=mode, dim=2) y = sfb1d_atrous(lo, hi, g0_row, g1_row, mode=mode, dim=3) return y class SWTInverse(nn.Module): """ Performs a 2d DWT Inverse reconstruction of an image Args: wave (str or pywt.Wavelet): Which wavelet to use C: deprecated, will be removed in future """ def __init__(self, wave='db1', mode='zero', separable=True): super().__init__() if isinstance(wave, str): wave = pywt.Wavelet(wave) if isinstance(wave, pywt.Wavelet): g0_col, g1_col = wave.rec_lo, wave.rec_hi g0_row, g1_row = g0_col, g1_col else: if len(wave) == 2: g0_col, g1_col = wave[0], wave[1] g0_row, g1_row = g0_col, g1_col elif len(wave) == 4: g0_col, g1_col = wave[0], wave[1] g0_row, g1_row = wave[2], wave[3] # Prepare the filters if separable: filts = lowlevel.prep_filt_sfb2d(g0_col, g1_col, g0_row, g1_row) self.register_buffer('g0_col', filts[0]) self.register_buffer('g1_col', filts[1]) self.register_buffer('g0_row', filts[2]) self.register_buffer('g1_row', filts[3]) else: filts = lowlevel.prep_filt_sfb2d_nonsep( g0_col, g1_col, g0_row, g1_row) self.register_buffer('h', filts) self.mode = mode self.separable = separable def forward(self, coeffs): """ Args: coeffs (yl, yh): tuple of lowpass and bandpass coefficients, where: yl is a lowpass tensor of shape :math:`(N, C_{in}, H_{in}', W_{in}')` and yh is a list of bandpass tensors of shape :math:`list(N, C_{in}, 3, H_{in}'', W_{in}'')`. I.e. should match the format returned by DWTForward Returns: Reconstructed input of shape :math:`(N, C_{in}, H_{in}, W_{in})` Note: :math:`H_{in}', W_{in}', H_{in}'', W_{in}''` denote the correctly downsampled shapes of the DWT pyramid. Note: Can have None for any of the highpass scales and will treat the values as zeros (not in an efficient way though). """ yl, yh = coeffs ll = yl # Do a multilevel inverse transform for h in yh[::-1]: if h is None: h = torch.zeros(ll.shape[0], ll.shape[1], 3, ll.shape[-2], ll.shape[-1], device=ll.device) # 'Unpad' added dimensions if ll.shape[-2] > h.shape[-2]: ll = ll[...,:-1,:] if ll.shape[-1] > h.shape[-1]: ll = ll[...,:-1] # Do the synthesis filter banks if self.separable: lh, hl, hh = torch.unbind(h, dim=2) filts = (self.g0_col, self.g1_col, self.g0_row, self.g1_row) ll = lowlevel.sfb2d(ll, lh, hl, hh, filts, mode=self.mode) else: c = torch.cat((ll[:,:,None], h), dim=2) ll = lowlevel.sfb2d_nonsep(c, self.h, mode=self.mode) return ll 这个代码又是什么意思
09-27
{"msg":"操作成功","code":200,"data":{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"deviceSn":"74261000001","jsonDataApp":"{\"enable_ota\": 0, \"enable_lang\": 1, \"enable_time\": 1, \"enable_share\": 0, \"enable_netcfg\": 0, \"enable_record\": 1, \"enable_screen\": 0, \"enable_volume\": 1, \"enable_selftest\": 1, \"enable_timezone\": 1}","jsonDataUser":"{\"Net\": {\"mac\": \"\", \"mask0\": 0, \"mask1\": 0, \"mask2\": 0, \"mask3\": 0, \"lteApn\": \"linksnet\", \"secret\": \"aA991d5cDaed\", \"ipAddr0\": 0, \"ipAddr1\": 0, \"ipAddr2\": 0, \"ipAddr3\": 0, \"netType\": 1, \"gateway0\": 0, \"gateway1\": 0, \"gateway2\": 0, \"gateway3\": 0, \"lteToken\": \"\", \"mqttPort\": 8884, \"wifiSsid\": \"MTX Endtest 2.4GHz\", \"priorType\": 1, \"ipAddrType\": 0, \"mqttServer\": \"iot-mqtt-eu.primedic.com\", \"serverName\": \"iot-eu.primedic.com\", \"serverPort\": 8804, \"activateLte\": 1, \"activateOTA\": 0, \"activateSOS\": 0, \"activateSSL\": 1, \"treatSwitch\": 0, \"activateWifi\": 1, \"wifiPassword\": \"1234567890\", \"ntpServerName\": \"pool.ntp.org\", \"activateWireless\": 1}, \"Sys\": {\"gain\": 0, \"region\": 1, \"tzName\": \"W. Europe Standard Time\", \"phoneNum\": \"\", \"saveLang\": 1, \"timeZone\": 1, \"tzDetail\": \"GMT-01:00\", \"waveOnOff0\": 0, \"waveOnOff1\": 1, \"waveOnOff2\": 1, \"waveOnOff3\": 1, \"waveOnOff4\": 1, \"waveOnOff5\": 1, \"cprFeedback\": 0, \"cprWaitTime\": 0, \"generalVolume\": 1, \"languageList0\": 0, \"languageList1\": 0, \"languageList2\": 0, \"languageList3\": 0, \"languageList4\": 0, \"languageList5\": 0, \"languageList6\": 0, \"languageList7\": 0, \"languageList8\": 0, \"languageList9\": 0, \"largeSelftest\": 1, \"cprPromptStyle\": 1, \"impedanceLimit\": 1, \"mediumSelftest\": 1, \"activeLanguage0\": 1, \"activeLanguage1\": 2, \"activeLanguage2\": 0, \"activeLanguage3\": 0, \"activeLanguage4\": 0, \"activeLanguage5\": 0, \"activeLanguage6\": 0, \"activeLanguage7\": 0, \"activeLanguage8\": 0, \"activeLanguage9\": 0, \"aiFuncOpenClose\": 1, \"ecgWaveDispOnOff\": 0, \"lcdBrightnessCfg\": 0, \"selftestFailAlarm\": 0, \"smallSelftestHour\": 5, \"waveRulerDispOnOff\": 0, \"smallSelftestMinute\": 13, \"updataCheckInterval\": 1, \"isWeekSelftestEnable\": 0, \"smallSelftestWeekDay\": 1}, \"Defi\": {\"CC\": 1, \"cpr\": 1, \"aduCCType\": 1, \"pedCCType\": 0, \"ecgAnalysis\": 1, \"cprMetronome\": 1, \"breathingTone\": 1, \"operatorGroup\": 0, \"rescueBreaths\": 1, \"aduCCLowerLimit\": 2, \"aduCCUpperLimit\": 5, \"pedCCLowerLimit\": 1, \"pedCCUpperLimit\": 4, \"cprCycleDuration\": 3, \"shockPressTimeout\": 15, \"aduCompressionRate\": 110, \"selectedEnergyAdu0\": 150, \"selectedEnergyAdu1\": 170, \"selectedEnergyAdu2\": 200, \"selectedEnergyPed0\": 50, \"selectedEnergyPed1\": 50, \"selectedEnergyPed2\": 50, \"ecgImpInterfereDetectOnoff\": 0}, \"Version\": \"01.00.00.05\", \"Reserved\": \"\", \"CreateTime\": 1757918418, \"ModifyTime\": 1757918418, \"SubVersion\": \"a\", \"ConfigToolVersion\": 1020001, \"DefaultVersionInAc\": \"01.00.00.05a\"}","jsonDataConfig":"{\"m_eLcd\": 0, \"m_eLte\": 0, \"m_bFAED\": 0, \"m_eSpO2\": 0, \"m_eWifi\": 0, \"m_eTouch\": 0, \"m_bSosLed\": 0, \"m_eBBoard\": 0, \"m_eCamera\": 0, \"m_reserve\": 0, \"m_version\": 1, \"m_aed_area\": 4, \"m_type_name\": \"myPAD 670(74261)\", \"m_bOKDisplay\": 1, \"m_eBlueTooth\": 1, \"m_eMainBoard\": 1, \"m_bRedGreenLed\": 0, \"m_eLanguageButton\": 1, \"m_ePedAdultSwitch\": 1, \"m_iAvailableLenth\": 0}","url":"https://iot-data-test.yuwell.com:19527/aed-management-admin-api/profile/upload/2025/09/15/20250915144032A046/user.json,https://iot-data-test.yuwell.com:19527/aed-management-admin-api/profile/upload/2025/09/15/20250915144032A047/config.json,https://iot-data-test.yuwell.com:19527/aed-management-admin-api/profile/upload/2025/09/15/20250915144032A048/app.json","createdTime":"2025-09-15","updatedTime":"2025-09-15","treatSwitch":null,"activateSSL":null,"aiFuncOpenClose":null,"impedanceLimit":null,"enableLang":null,"enableShare":null,"enableOta":null,"deviceType":"myPAD","region":1}} C# 获取这段文字"url"的json
12-30
数据集介绍:垃圾分类检测数据集 一、基础信息 数据集名称:垃圾分类检测数据集 图片数量: 训练集:2,817张图片 验证集:621张图片 测试集:317张图片 总计:3,755张图片 分类类别: - 金属:常见的金属垃圾材料。 - 纸板:纸板类垃圾,如包装盒等。 - 塑料:塑料类垃圾,如瓶子、容器等。 标注格式: YOLO格式,包含边界框和类别标签,适用于目标检测任务。 数据格式:图片来源于实际场景,格式为常见图像格式(如JPEG/PNG)。 二、适用场景 智能垃圾回收系统开发: 数据集支持目标检测任务,帮助构建能够自动识别和分类垃圾材料的AI模型,用于自动化废物分类和回收系统。 环境监测与废物管理: 集成至监控系统或机器人中,实时检测垃圾并分类,提升废物处理效率和环保水平。 学术研究与教育: 支持计算机视觉与环保领域的交叉研究,用于教学、实验和论文发表。 三、数据集优势 类别覆盖全面: 包含三种常见垃圾材料类别,覆盖日常生活中主要的可回收物类型,具有实际应用价值。 标注精准可靠: 采用YOLO标注格式,边界框定位精确,类别标签准确,便于模型直接训练和使用。 数据量适中合理: 训练集、验证集和测试集分布均衡,提供足够样本用于模型学习和评估。 任务适配性强: 标注兼容主流深度学习框架(如YOLO等),可直接用于目标检测任务,支持垃圾检测相关应用。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值