一只妖孽的逗比人生

我的理想:过着猪一样的生活,瘦的像猴子一样

开启逗比人生

PyTorch tensor 翻转

June 18, 2019, 5:33 p.m.

read: 2881

转自https://discuss.pytorch.org/t/how-to-reverse-a-torch-tensor/382 形状为(10)的tensor翻转 tensor = torch.rand(10) # your tensor # create inverted indices idx = [i for i in range(tensor.size(0)-1, -1, -1)] idx = torch.LongTensor(idx) inverted_tensor = tensor.index_select(0, idx) 形状为(1,10,1)的tensor翻转 tensor…

二进制文件转npy文件(Python3)

June 17, 2019, 7:36 p.m.

read: 1407

以下demo只支持float格式,仅提供思路,其他数据类型需自行扩展: import numpy as np import struct def bin2npy(bin_file_path, npy_file_path, type='float'): assert type in ['float'] out_data = [] with open(bin_file_path, mode='rb') as bin_file: in_data = bin_file.read() for i in range(len(in_data)//4)…

Android 动态权限

June 12, 2019, 5:33 p.m.

read: 1169

1. 添加权限到 AndroidManifest.xml2. 添加以下语句到build.gradle=>dependenciesimplementation 'com.mylhyl:acp:1.2.0' 然后sync project 3.添加Java语句以动态请求权限Acp.getInstance(this).request(new AcpOptions.Builder() .setPermissions( Manifest.permission.RECORD_AUDIO, …

BCE Loss (PyTorch)

June 10, 2019, 9:10 p.m.

read: 1640

适合最后一层(输出层)为二分类,label==>1 为一个类别,label==> 0 为另一个类别两个样例: >>> target = torch.ones([10, 64], dtype=torch.float32) # 64 classes, batch size = 10 >>> output = torch.full([10, 64], 0.999) # A prediction (logit) >>> pos_weight = torch.ones([64]) # All weights are equal t…

寒肩煞与路冲

June 9, 2019, 2:07 p.m.

read: 1037

计院之寒肩煞凸字房寒肩屋犯探头煞第三种是凸字房寒肩屋犯探头煞。这种房屋结构本身中间高、两边低的凸字房犯寒肩煞,也属于探头煞的一种。房顶包袱房犯探头煞第四种是房顶包袱房犯探头煞。这种结构是房顶另外盖有较小的房间,被称作包袱房犯探头煞。尤其是后期单独建造的房上房,煞气更重。 路冲 路冲桥冲莫轻猜,快把元龙排起来,冲起旺宫无价宝,冲到衰宫化作灰。 某幼儿园

Android应用设置VoIP模式

Feb. 22, 2019, 4 p.m.

read: 1108

Android使用VoIP音频链路 AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION); audioManager.setSpeakerphoneOn(true);//true 底部喇叭播放,false 顶部喇叭

基于深度学习的行人检测(人体检测)系统

Feb. 3, 2019, 1:02 a.m.

read: 1416

监控在安保和巡查中发挥着重要作用,但也是一项非常乏味的任务,深度学习的出现在一定程度上将人类从这一任务中解放出来。本项目基于深度学习的目标检测去搭建了一个简单有效的监控系统,能够自动化进行人流统计和行人检测。项目地址:https://github.com/zhangpengpengpeng/PedestrianDetectionSystem

胡大炮的个人收藏

Jan. 26, 2019, 11:45 a.m.

read: 867

给ubuntu16.04 / 18.04 安装nvidia显卡驱动 sudo apt-get update sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get update sudo apt-get install nvidia-418

WAV降采样

Jan. 25, 2019, 4:18 p.m.

read: 1206

提供三种方案FFMpeg./ffmpeg -i in.wav -f wav -ar 16000 -ac 1 out.wav librosay, sr = librosa.load(filename, sr=48000) y_8k = librosa.resample(y,sr,8000) scipyimport scipy.signal as signal import scipy.io.wavfile as wavfile import numpy as np def wav_file_resample(file_path, source_sample=44100, dest_sampl…

Hello 2019

Jan. 1, 2019, 3:52 p.m.

read: 916

0x00 前言今天是2019年的第一天,也是元旦假期的第三天,时间过得很快,没什么感觉18年就过去了。这一年最大的收货也就是体重又有了明显的增长。元旦三天假期回呼市看对象啦。平时更新的不勤快,趁着难得的假期更新一篇博文。 0x01 正文第一天元旦三天假期过算得上是比较充实的。第一天赶着飞机赶了差不多整整一天吧,早上四点半起床去赶飞机。滴滴没打上,幸好在小区门口路过的出租车不少。打上车直奔机场。过安检就看到了汉堡王。得,早饭这就有着落啦。(平时汉堡王吃得多,体重增长很大程度上得归功于它了。)汉堡王里面的椒香鸡腿味道不错,皇堡的话,对里面的腌黄瓜味道不感冒。果断点上了厚蛋鸡腿堡+椒香鸡腿+可乐开…

企鹅邮箱添加黑名单绕过

Nov. 7, 2018, 8:05 p.m.

read: 919

0x00 起因被系统垃圾邮件骚扰,遂添加至黑名单 很恶心的事情,企鹅邮箱(含企业邮箱)添加黑名单 10000[AT]qq[DOT]com是无法添加的,见下图 0x01 分析添加此邮箱时,我们未发现网络请求,应该是前端实现,就是不知道有无后端校验,分析之分析js找到如下代码 function checkmyMail(_asEmail,_oInput) { if (_asEmail == "") { showError("添加的内容不能为空"); return -1; } if( _asEmail.length > 127 ) { showError("您输入的邮件地址过长,请重新输入")…

ubuntu 安装 jdk

Nov. 3, 2018, 12:20 p.m.

read: 935

Install the JDK Install JDK 8: sudo apt-get install openjdk-8-jdk On Ubuntu 14.04 LTS you must use a PPA: sudo add-apt-repository ppa:webupd8team/java sudo apt-get update && sudo apt-get install oracle-java8-installer

Ubuntu16.04 Desktop版本安装NVIDIA驱动

Nov. 3, 2018, 10:59 a.m.

read: 1023

显卡是GTX1080Ti sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get update sudo apt-get install nvidia-390 # NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running. # 挂载驱动 modprobe nvidia

CSRF详解

Oct. 26, 2018, 9:31 p.m.

read: 980

https://segmentfault.com/a/1190000016659945

yagmail发送带附件的邮件

Oct. 24, 2018, 5:27 p.m.

read: 1068

摘自知乎 import yagmail yag = yagmail.SMTP(user='joy_lmx@163.com', password='nicai?', host='smtp.163.com', port='25') yag.send(user, subject = "I now can send an attachment", attachments=['a.txt', 'b.jpg'])

Python 多个List按照某一个List进行排序

Oct. 17, 2018, 3:09 p.m.

read: 1492

实际场景是:现在有三个list分别是list1 list2 list3,分别代表学生的姓名,学号,成绩现在需要按照成绩排序,也就是:list 1, list 2, 按照list 3的顺序进行排序,给出代码: data = [(score, name, name2) for score, name, name2 in zip(list_3, list_1, list_2)] data.sort() list_3 = [score for score, name, name2 in data] list_1 = [name for score, name, nam…

Py3.5 Linux 安装 最新版本TensorFlow GPU版本

Oct. 17, 2018, 11:17 a.m.

read: 743

系统为Linux,已经通过anaconda 装上了 Python3.5打开官网,确认对应版本的CUDA和CUDNN都装上了。打开官网安装指南,找到找到url,执行:pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.11.0-cp35-cp35m-linux_x86_64.whl enjoy yourself.

Python 安装 OpenCV

Oct. 17, 2018, 10:15 a.m.

read: 805

Win:https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv Linux: if you need only main modules pip install opencv-python

此站点由 ASP.NETIIS 驱动 | © 2018-2023 hupeng.me. All Rights Reserved.