This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"prompt":"I need an API that can estimate the relative depth of objects from a single image. The output should be an inverse depth map.\n\n###\n\n","completion":" {'domain': 'Classification', 'api_call': \"model = torch.hub.load('intel-isl\/MiDaS', 'DPT_Hybrid', pretrained=True)\", 'api_provider': 'PyTorch', 'explanation': \"Load the pretrained MiDaS model for estimating relative depth from a single image, which outputs an inverse depth map.\", 'code': 'import torch\nmodel = torch.hub.load(\"intel-isl\/MiDaS\", \"DPT_Hybrid\", pretrained=True)'}###"} | |
{"prompt":"I need an API to detect different types of vehicles, people, and lanes in an image captured from a camera mounted on a self-driving car.\n\n###\n\n","completion":" {'domain': 'Object Detection', 'api_call': \"model = torch.hub.load('hustvl\/yolop', 'yolop', pretrained=True)\", 'api_provider': 'PyTorch', 'explanation': 'Load the YOLOP model from PyTorch Hub with pre-trained weights optimized for object detection, drivable area segmentation, and lane de |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function matchAll(str, re) { | |
let result = []; | |
let match = null; | |
while ((match = re.exec(str)) !== null) { | |
result.push(match); | |
} | |
return result; | |
} | |
// Example | |
// matchAll('1.a 2.b 3.c', /\d\.([a-z])/g) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew update && brew upgrade | |
brew install composer duti htop nvm pcap_dnsproxy pyenv tig telnet zsh | |
brew cask install font-anonymous-pro | |
brew cask install wechatwebdevtools —appdir=/Applications | |
brew cask install adobe-air atom baidunetdisk bettertouchtool charles cyberduck dingtalk iterm2 mpv qq qqmusic scroll-reverser sourcetree telegram-desktop thunder visual-studio-code wiznote youdaodict webstorm | |
brew cask install betterzipql qlcolorcode qlimagesize qlmarkdown qlprettypatch qlstephen qlvideo quicklook-csv quicklook-json quicklookase suspicious-package webpquicklook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm set registry https://registry.npm.taobao.org # 注册模块镜像 | |
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像 | |
## 以下选择添加 | |
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像 | |
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像 | |
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像 | |
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像 | |
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像 | |
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs # phantomjs 二进制包镜像 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 去除 google 搜索重定向 | |
// @namespace http://doctype-html.com | |
// @version 0.1 | |
// @description 去除 google 搜索重定向,提高访问速度 | |
// @author Weilao | |
// @include *//www.google.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UnicodeConverter = { | |
toUnicode: function(str) { | |
return escape(str).toLocaleLowerCase().replace(/%u/gi, '\\u'); | |
}, | |
fromUnicode: function(str) { | |
return unescape(str.replace(/\\u/gi, '%u')); | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Omit middle when a string is too long. | |
* Example: | |
* ``` | |
* omitMiddle('veryveryveryveryveryveryveryveryveryverylongfilename.txt') | |
* // result: 'very......name.txt' | |
* ``` | |
* @param str | |
* @param [replacement] Default: ...... | |
* @param [frontCount] How many words you want to keep in the front. Default: 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showElementEdges(el) { | |
[].forEach.call(el.querySelectorAll("*"), function(a) { | |
a.style.outline = "1px solid #" + (~~(Math.random() * (1 << 24))).toString(16) | |
}) | |
} |