code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E5%89%8D%E7%AB%AF/page/2/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E5%89%8D%E7%AB%AF/page/2/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 前端 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">前端 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-19T21:27:46+08:00" content="2024-09-19"> 09-19 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/e90bb5b9/" itemprop="url"> <span itemprop="name">探路:雨课堂的字体加密。</span> </a> </div> </header> </article> </div> </div> <nav class="pagination"> <a class="extend prev" rel="prev" href="/tags/%E5%89%8D%E7%AB%AF/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/tags/%E5%89%8D%E7%AB%AF/">1</a><span class="page-number current">2</span> </nav> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/前端/page/2/index.html
HTML
unknown
24,401
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E5%8D%9A%E5%AE%A2/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E5%8D%9A%E5%AE%A2/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 博客 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">博客 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-10-11T18:09:21+08:00" content="2024-10-11"> 10-11 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/93f836cb/" itemprop="url"> <span itemprop="name">开往 友链接力!</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/博客/index.html
HTML
unknown
24,100
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E5%8D%9A%E5%AE%A2%E6%95%99%E7%A8%8B/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E5%8D%9A%E5%AE%A2%E6%95%99%E7%A8%8B/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 博客教程 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">博客教程 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-10-11T18:09:21+08:00" content="2024-10-11"> 10-11 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/93f836cb/" itemprop="url"> <span itemprop="name">开往 友链接力!</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/6ec2376e/" itemprop="url"> <span itemprop="name">hexo创建公益404界面</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-21T17:38:24+08:00" content="2024-09-21"> 09-21 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/42cabe35/" itemprop="url"> <span itemprop="name">hexo压缩资源,优化访问</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-20T18:58:27+08:00" content="2024-09-20"> 09-20 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/8403dd78/" itemprop="url"> <span itemprop="name">在hexo-next配置gitalk</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-20T17:22:58+08:00" content="2024-09-20"> 09-20 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f513b372/" itemprop="url"> <span itemprop="name">为hexo-next建立静态说说</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-19T07:59:02+08:00" content="2024-09-19"> 09-19 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/261d7eb2/" itemprop="url"> <span itemprop="name">为Hexo博客提供订阅服务</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-14T19:16:27+08:00" content="2024-09-14"> 09-14 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/62fedd1e/" itemprop="url"> <span itemprop="name">hexo创建一个友情链接页面</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-14T18:38:52+08:00" content="2024-09-14"> 09-14 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/69cc9e5f/" itemprop="url"> <span itemprop="name">hexo-next在侧边栏添加IP信息</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-04T16:03:03+08:00" content="2024-09-04"> 09-04 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/50aa0545/" itemprop="url"> <span itemprop="name">hexo-next在文章下添加版权信息</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-04T15:02:00+08:00" content="2024-09-04"> 09-04 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/59a1e261/" itemprop="url"> <span itemprop="name">hexon:hexo的可视化编辑</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/博客教程/index.html
HTML
unknown
29,105
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E5%93%88%E5%9F%BA%E7%B1%B3/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E5%93%88%E5%9F%BA%E7%B1%B3/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 哈基米 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">哈基米 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-16T13:27:19+08:00" content="2024-09-16"> 09-16 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/d09c70b/" itemprop="url"> <span itemprop="name">通过创建照片集学习 CSS 弹性盒子</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-06-21T21:15:25+08:00" content="2024-06-21"> 06-21 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/e855e869/" itemprop="url"> <span itemprop="name">哈基米</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/哈基米/index.html
HTML
unknown
24,676
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E5%A7%93%E4%BA%8E%E8%80%85/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E5%A7%93%E4%BA%8E%E8%80%85/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 姓于者 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">姓于者 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-29T13:13:39+08:00" content="2024-09-29"> 09-29 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/36c34667/" itemprop="url"> <span itemprop="name">learn Markdown</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/姓于者/index.html
HTML
unknown
24,118
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E5%BC%80%E5%BE%80/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E5%BC%80%E5%BE%80/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 开往 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">开往 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-10-11T18:09:21+08:00" content="2024-10-11"> 10-11 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/93f836cb/" itemprop="url"> <span itemprop="name">开往 友链接力!</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/开往/index.html
HTML
unknown
24,100
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E6%87%92%E5%BE%97%E5%8A%A8/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E6%87%92%E5%BE%97%E5%8A%A8/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 懒得动 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">懒得动 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/2283d3b7/" itemprop="url"> <span itemprop="name">本来想搬fishport_serverwiki来着</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/懒得动/index.html
HTML
unknown
24,141
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E6%88%91%E7%9A%84%E4%B8%96%E7%95%8C%E6%9C%8D%E5%8A%A1%E5%99%A8/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E6%88%91%E7%9A%84%E4%B8%96%E7%95%8C%E6%9C%8D%E5%8A%A1%E5%99%A8/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 我的世界服务器 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">我的世界服务器 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/2283d3b7/" itemprop="url"> <span itemprop="name">本来想搬fishport_serverwiki来着</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/我的世界服务器/index.html
HTML
unknown
24,237
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E6%8A%BD%E8%B1%A1/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E6%8A%BD%E8%B1%A1/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 抽象 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">抽象 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-03T20:55:09+08:00" content="2024-09-03"> 09-03 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/ceb862dd/" itemprop="url"> <span itemprop="name">whatgalgame</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/抽象/index.html
HTML
unknown
24,091
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E6%8F%92%E4%BB%B6/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E6%8F%92%E4%BB%B6/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 插件 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">插件 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-10-08T15:21:09+08:00" content="2024-10-08"> 10-08 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/37f315ff/" itemprop="url"> <span itemprop="name">解决国外人机验证不显示问题</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/插件/index.html
HTML
unknown
24,119
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E6%95%99%E7%A8%8B/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E6%95%99%E7%A8%8B/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 教程 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">教程 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-29T13:13:39+08:00" content="2024-09-29"> 09-29 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/36c34667/" itemprop="url"> <span itemprop="name">learn Markdown</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-28T20:48:54+08:00" content="2024-09-28"> 09-28 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/90edeb6d/" itemprop="url"> <span itemprop="name">信息技术基数实训-焊接爱心花灯</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:19:55+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/218fcad3/" itemprop="url"> <span itemprop="name">初识Vue3,有趣</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f899f771/" itemprop="url"> <span itemprop="name">LeetCode:2. 两数相加</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-25T20:42:35+08:00" content="2024-09-25"> 09-25 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/58ad3c48/" itemprop="url"> <span itemprop="name">连不上网了?可能的DNS解决方法</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-20T17:22:58+08:00" content="2024-09-20"> 09-20 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f513b372/" itemprop="url"> <span itemprop="name">为hexo-next建立静态说说</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-15T16:43:40+08:00" content="2024-09-15"> 09-15 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f7250b56/" itemprop="url"> <span itemprop="name">独立地写了一个调查表:)</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-15T12:28:24+08:00" content="2024-09-15"> 09-15 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/e10534d7/" itemprop="url"> <span itemprop="name">通过创建一组彩色笔学习 CSS 颜色</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-15T10:08:12+08:00" content="2024-09-15"> 09-15 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/fc7dd4b4/" itemprop="url"> <span itemprop="name">为github主页设计美化介绍</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-14T19:16:27+08:00" content="2024-09-14"> 09-14 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/62fedd1e/" itemprop="url"> <span itemprop="name">hexo创建一个友情链接页面</span> </a> </div> </header> </article> </div> </div> <nav class="pagination"> <span class="page-number current">1</span><a class="page-number" href="/tags/%E6%95%99%E7%A8%8B/page/2/">2</a><a class="extend next" rel="next" href="/tags/%E6%95%99%E7%A8%8B/page/2/"><i class="fa fa-angle-right" aria-label="下一页"></i></a> </nav> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/教程/index.html
HTML
unknown
29,365
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E6%95%99%E7%A8%8B/page/2/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E6%95%99%E7%A8%8B/page/2/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 教程 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">教程 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-14T18:38:52+08:00" content="2024-09-14"> 09-14 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/69cc9e5f/" itemprop="url"> <span itemprop="name">hexo-next在侧边栏添加IP信息</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-13T21:17:36+08:00" content="2024-09-13"> 09-13 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/36b96013/" itemprop="url"> <span itemprop="name">通过创建咖啡店菜单学习基础CSS</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-11T17:28:10+08:00" content="2024-09-11"> 09-11 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/c42bc0f8/" itemprop="url"> <span itemprop="name">给博客右上角添加github跳转图标</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-04T16:03:03+08:00" content="2024-09-04"> 09-04 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/50aa0545/" itemprop="url"> <span itemprop="name">hexo-next在文章下添加版权信息</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-04T15:02:00+08:00" content="2024-09-04"> 09-04 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/59a1e261/" itemprop="url"> <span itemprop="name">hexon:hexo的可视化编辑</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-06-23T16:33:26+08:00" content="2024-06-23"> 06-23 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f5bf34a0/" itemprop="url"> <span itemprop="name">forever</span> </a> </div> </header> </article> </div> </div> <nav class="pagination"> <a class="extend prev" rel="prev" href="/tags/%E6%95%99%E7%A8%8B/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/tags/%E6%95%99%E7%A8%8B/">1</a><span class="page-number current">2</span> </nav> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/教程/page/2/index.html
HTML
unknown
27,160
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E6%B5%8F%E8%A7%88%E5%99%A8/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E6%B5%8F%E8%A7%88%E5%99%A8/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 浏览器 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">浏览器 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-10-08T15:21:09+08:00" content="2024-10-08"> 10-08 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/37f315ff/" itemprop="url"> <span itemprop="name">解决国外人机验证不显示问题</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/浏览器/index.html
HTML
unknown
24,143
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E6%B8%B8%E6%88%8F/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E6%B8%B8%E6%88%8F/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 游戏 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">游戏 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/b6e6b630/" itemprop="url"> <span itemprop="name">玩文明六玩爽了</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/2283d3b7/" itemprop="url"> <span itemprop="name">本来想搬fishport_serverwiki来着</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-03T20:55:09+08:00" content="2024-09-03"> 09-03 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/ceb862dd/" itemprop="url"> <span itemprop="name">whatgalgame</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/游戏/index.html
HTML
unknown
25,189
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E6%B8%B8%E8%A7%88/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E6%B8%B8%E8%A7%88/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 游览 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">游览 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/ca82fca4/" itemprop="url"> <span itemprop="name">工业博物馆游览</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/游览/index.html
HTML
unknown
24,101
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E7%88%AC%E8%99%AB/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E7%88%AC%E8%99%AB/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 爬虫 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">爬虫 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-19T21:27:46+08:00" content="2024-09-19"> 09-19 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/e90bb5b9/" itemprop="url"> <span itemprop="name">探路:雨课堂的字体加密。</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/爬虫/index.html
HTML
unknown
24,114
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E7%88%B1%E7%8C%ABtv/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E7%88%B1%E7%8C%ABtv/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 爱猫tv | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">爱猫tv <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-16T13:27:19+08:00" content="2024-09-16"> 09-16 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/d09c70b/" itemprop="url"> <span itemprop="name">通过创建照片集学习 CSS 弹性盒子</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-06-21T21:15:25+08:00" content="2024-06-21"> 06-21 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/e855e869/" itemprop="url"> <span itemprop="name">哈基米</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/爱猫tv/index.html
HTML
unknown
24,660
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E7%A5%9E%E4%BA%BA/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E7%A5%9E%E4%BA%BA/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 神人 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">神人 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-23T15:01:26+08:00" content="2024-09-23"> 09-23 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/6af33c89/" itemprop="url"> <span itemprop="name">神人有感:先礼礼礼礼礼礼后兵</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/神人/index.html
HTML
unknown
24,120
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E7%AC%AC%E4%B8%80/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E7%AC%AC%E4%B8%80/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 第一 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">第一 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/38c422a2/" itemprop="url"> <span itemprop="name">我的第一个博客</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/第一/index.html
HTML
unknown
24,101
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E7%AC%AC%E4%B8%80%E6%AC%A1/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E7%AC%AC%E4%B8%80%E6%AC%A1/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 第一次 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">第一次 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:19:55+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/218fcad3/" itemprop="url"> <span itemprop="name">初识Vue3,有趣</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/38c422a2/" itemprop="url"> <span itemprop="name">我的第一个博客</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-20T18:58:27+08:00" content="2024-09-20"> 09-20 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/8403dd78/" itemprop="url"> <span itemprop="name">在hexo-next配置gitalk</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-19T07:59:02+08:00" content="2024-09-19"> 09-19 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/261d7eb2/" itemprop="url"> <span itemprop="name">为Hexo博客提供订阅服务</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-15T16:43:40+08:00" content="2024-09-15"> 09-15 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f7250b56/" itemprop="url"> <span itemprop="name">独立地写了一个调查表:)</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-14T18:38:52+08:00" content="2024-09-14"> 09-14 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/69cc9e5f/" itemprop="url"> <span itemprop="name">hexo-next在侧边栏添加IP信息</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-13T19:36:15+08:00" content="2024-09-13"> 09-13 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/dad78c45/" itemprop="url"> <span itemprop="name">第一次Pull requests :)</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-11T17:28:10+08:00" content="2024-09-11"> 09-11 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/c42bc0f8/" itemprop="url"> <span itemprop="name">给博客右上角添加github跳转图标</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-11T17:09:40+08:00" content="2024-09-11"> 09-11 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/6273631e/" itemprop="url"> <span itemprop="name">通过创建猫咪相册应用学习HTML</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-04T16:03:03+08:00" content="2024-09-04"> 09-04 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/50aa0545/" itemprop="url"> <span itemprop="name">hexo-next在文章下添加版权信息</span> </a> </div> </header> </article> </div> </div> <nav class="pagination"> <span class="page-number current">1</span><a class="page-number" href="/tags/%E7%AC%AC%E4%B8%80%E6%AC%A1/page/2/">2</a><a class="extend next" rel="next" href="/tags/%E7%AC%AC%E4%B8%80%E6%AC%A1/page/2/"><i class="fa fa-angle-right" aria-label="下一页"></i></a> </nav> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/第一次/index.html
HTML
unknown
29,400
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E7%AC%AC%E4%B8%80%E6%AC%A1/page/2/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E7%AC%AC%E4%B8%80%E6%AC%A1/page/2/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 第一次 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">第一次 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-04T15:02:00+08:00" content="2024-09-04"> 09-04 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/59a1e261/" itemprop="url"> <span itemprop="name">hexon:hexo的可视化编辑</span> </a> </div> </header> </article> </div> </div> <nav class="pagination"> <a class="extend prev" rel="prev" href="/tags/%E7%AC%AC%E4%B8%80%E6%AC%A1/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/tags/%E7%AC%AC%E4%B8%80%E6%AC%A1/">1</a><span class="page-number current">2</span> </nav> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/第一次/page/2/index.html
HTML
unknown
24,437
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E7%AE%97%E6%B3%95%E9%A2%98/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E7%AE%97%E6%B3%95%E9%A2%98/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 算法题 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">算法题 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f899f771/" itemprop="url"> <span itemprop="name">LeetCode:2. 两数相加</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-15T20:31:15+08:00" content="2024-09-15"> 09-15 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/2f3d653d/" itemprop="url"> <span itemprop="name">LeetCode:1. 两数之和</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/算法题/index.html
HTML
unknown
24,672
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E7%BD%91%E7%BB%9C/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E7%BD%91%E7%BB%9C/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 网络 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">网络 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-10-08T15:21:09+08:00" content="2024-10-08"> 10-08 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/37f315ff/" itemprop="url"> <span itemprop="name">解决国外人机验证不显示问题</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-25T20:42:35+08:00" content="2024-09-25"> 09-25 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/58ad3c48/" itemprop="url"> <span itemprop="name">连不上网了?可能的DNS解决方法</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/网络/index.html
HTML
unknown
24,681
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E8%A7%A3%E5%86%B3/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E8%A7%A3%E5%86%B3/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 解决 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">解决 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-10-08T15:21:09+08:00" content="2024-10-08"> 10-08 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/37f315ff/" itemprop="url"> <span itemprop="name">解决国外人机验证不显示问题</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-25T20:42:35+08:00" content="2024-09-25"> 09-25 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/58ad3c48/" itemprop="url"> <span itemprop="name">连不上网了?可能的DNS解决方法</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/解决/index.html
HTML
unknown
24,681
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E8%AE%B0%E5%BD%95/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E8%AE%B0%E5%BD%95/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 记录 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">记录 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-30T21:19:04+08:00" content="2024-09-30"> 09-30 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/b0f770c3/" itemprop="url"> <span itemprop="name">Vue:watch监视</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-28T20:48:54+08:00" content="2024-09-28"> 09-28 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/90edeb6d/" itemprop="url"> <span itemprop="name">信息技术基数实训-焊接爱心花灯</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:19:55+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/218fcad3/" itemprop="url"> <span itemprop="name">初识Vue3,有趣</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/d8587a7c/" itemprop="url"> <span itemprop="name">通过创建资产负债表学习 CSS 伪选择器</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/fcbe0bf5/" itemprop="url"> <span itemprop="name">学了点js</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/38c422a2/" itemprop="url"> <span itemprop="name">我的第一个博客</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/6ec2376e/" itemprop="url"> <span itemprop="name">hexo创建公益404界面</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/ca82fca4/" itemprop="url"> <span itemprop="name">工业博物馆游览</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-27T22:05:24+08:00" content="2024-09-27"> 09-27 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f899f771/" itemprop="url"> <span itemprop="name">LeetCode:2. 两数相加</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-25T20:42:35+08:00" content="2024-09-25"> 09-25 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/58ad3c48/" itemprop="url"> <span itemprop="name">连不上网了?可能的DNS解决方法</span> </a> </div> </header> </article> </div> </div> <nav class="pagination"> <span class="page-number current">1</span><a class="page-number" href="/tags/%E8%AE%B0%E5%BD%95/page/2/">2</a><span class="space">&hellip;</span><a class="page-number" href="/tags/%E8%AE%B0%E5%BD%95/page/4/">4</a><a class="extend next" rel="next" href="/tags/%E8%AE%B0%E5%BD%95/page/2/"><i class="fa fa-angle-right" aria-label="下一页"></i></a> </nav> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/记录/index.html
HTML
unknown
29,420
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E8%AE%B0%E5%BD%95/page/2/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E8%AE%B0%E5%BD%95/page/2/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 记录 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">记录 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-25T18:02:21+08:00" content="2024-09-25"> 09-25 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/c0981903/" itemprop="url"> <span itemprop="name">通过创建钢琴学习响应式网页设计</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-25T17:49:56+08:00" content="2024-09-25"> 09-25 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/52b92bfc/" itemprop="url"> <span itemprop="name">通过创建猫咪绘画学习中级 CSS</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-23T15:01:26+08:00" content="2024-09-23"> 09-23 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/6af33c89/" itemprop="url"> <span itemprop="name">神人有感:先礼礼礼礼礼礼后兵</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-21T21:01:13+08:00" content="2024-09-21"> 09-21 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/9f32bac9/" itemprop="url"> <span itemprop="name">通过创建小测验学习无障碍</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-21T17:38:24+08:00" content="2024-09-21"> 09-21 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/42cabe35/" itemprop="url"> <span itemprop="name">hexo压缩资源,优化访问</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-20T18:58:27+08:00" content="2024-09-20"> 09-20 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/8403dd78/" itemprop="url"> <span itemprop="name">在hexo-next配置gitalk</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-20T17:22:58+08:00" content="2024-09-20"> 09-20 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f513b372/" itemprop="url"> <span itemprop="name">为hexo-next建立静态说说</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-19T07:59:02+08:00" content="2024-09-19"> 09-19 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/261d7eb2/" itemprop="url"> <span itemprop="name">为Hexo博客提供订阅服务</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-16T13:27:19+08:00" content="2024-09-16"> 09-16 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/d09c70b/" itemprop="url"> <span itemprop="name">通过创建照片集学习 CSS 弹性盒子</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-16T11:18:02+08:00" content="2024-09-16"> 09-16 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/5129f3bd/" itemprop="url"> <span itemprop="name">通过创作罗斯科绘画学习 CSS 盒子模型</span> </a> </div> </header> </article> </div> </div> <nav class="pagination"> <a class="extend prev" rel="prev" href="/tags/%E8%AE%B0%E5%BD%95/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/tags/%E8%AE%B0%E5%BD%95/">1</a><span class="page-number current">2</span><a class="page-number" href="/tags/%E8%AE%B0%E5%BD%95/page/3/">3</a><a class="page-number" href="/tags/%E8%AE%B0%E5%BD%95/page/4/">4</a><a class="extend next" rel="next" href="/tags/%E8%AE%B0%E5%BD%95/page/3/"><i class="fa fa-angle-right" aria-label="下一页"></i></a> </nav> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/记录/page/2/index.html
HTML
unknown
29,687
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E8%AE%B0%E5%BD%95/page/3/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E8%AE%B0%E5%BD%95/page/3/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 记录 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">记录 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-15T16:43:40+08:00" content="2024-09-15"> 09-15 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f7250b56/" itemprop="url"> <span itemprop="name">独立地写了一个调查表:)</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-15T15:00:41+08:00" content="2024-09-15"> 09-15 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/5e40dbcf/" itemprop="url"> <span itemprop="name">通过创建注册表单学习 HTML 表单</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-15T12:28:24+08:00" content="2024-09-15"> 09-15 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/e10534d7/" itemprop="url"> <span itemprop="name">通过创建一组彩色笔学习 CSS 颜色</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-15T10:08:12+08:00" content="2024-09-15"> 09-15 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/fc7dd4b4/" itemprop="url"> <span itemprop="name">为github主页设计美化介绍</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-14T19:16:27+08:00" content="2024-09-14"> 09-14 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/62fedd1e/" itemprop="url"> <span itemprop="name">hexo创建一个友情链接页面</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-14T18:38:52+08:00" content="2024-09-14"> 09-14 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/69cc9e5f/" itemprop="url"> <span itemprop="name">hexo-next在侧边栏添加IP信息</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-13T21:17:36+08:00" content="2024-09-13"> 09-13 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/36b96013/" itemprop="url"> <span itemprop="name">通过创建咖啡店菜单学习基础CSS</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-13T19:36:15+08:00" content="2024-09-13"> 09-13 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/dad78c45/" itemprop="url"> <span itemprop="name">第一次Pull requests :)</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-11T17:28:10+08:00" content="2024-09-11"> 09-11 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/c42bc0f8/" itemprop="url"> <span itemprop="name">给博客右上角添加github跳转图标</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-04T16:03:03+08:00" content="2024-09-04"> 09-04 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/50aa0545/" itemprop="url"> <span itemprop="name">hexo-next在文章下添加版权信息</span> </a> </div> </header> </article> </div> </div> <nav class="pagination"> <a class="extend prev" rel="prev" href="/tags/%E8%AE%B0%E5%BD%95/page/2/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/tags/%E8%AE%B0%E5%BD%95/">1</a><a class="page-number" href="/tags/%E8%AE%B0%E5%BD%95/page/2/">2</a><span class="page-number current">3</span><a class="page-number" href="/tags/%E8%AE%B0%E5%BD%95/page/4/">4</a><a class="extend next" rel="next" href="/tags/%E8%AE%B0%E5%BD%95/page/4/"><i class="fa fa-angle-right" aria-label="下一页"></i></a> </nav> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/记录/page/3/index.html
HTML
unknown
29,696
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E8%AE%B0%E5%BD%95/page/4/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E8%AE%B0%E5%BD%95/page/4/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 记录 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">记录 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-04T15:02:00+08:00" content="2024-09-04"> 09-04 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/59a1e261/" itemprop="url"> <span itemprop="name">hexon:hexo的可视化编辑</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-06-23T16:33:26+08:00" content="2024-06-23"> 06-23 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/f5bf34a0/" itemprop="url"> <span itemprop="name">forever</span> </a> </div> </header> </article> </div> </div> <nav class="pagination"> <a class="extend prev" rel="prev" href="/tags/%E8%AE%B0%E5%BD%95/page/3/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/tags/%E8%AE%B0%E5%BD%95/">1</a><span class="space">&hellip;</span><a class="page-number" href="/tags/%E8%AE%B0%E5%BD%95/page/3/">3</a><span class="page-number current">4</span> </nav> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/记录/page/4/index.html
HTML
unknown
25,032
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E8%B0%B7%E6%AD%8C/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E8%B0%B7%E6%AD%8C/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 谷歌 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">谷歌 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-10-08T15:21:09+08:00" content="2024-10-08"> 10-08 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/37f315ff/" itemprop="url"> <span itemprop="name">解决国外人机验证不显示问题</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/谷歌/index.html
HTML
unknown
24,119
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E9%97%AE%E9%A2%98/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E9%97%AE%E9%A2%98/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 问题 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">问题 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-10-08T15:21:09+08:00" content="2024-10-08"> 10-08 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/37f315ff/" itemprop="url"> <span itemprop="name">解决国外人机验证不显示问题</span> </a> </div> </header> </article> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-09-25T20:42:35+08:00" content="2024-09-25"> 09-25 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/58ad3c48/" itemprop="url"> <span itemprop="name">连不上网了?可能的DNS解决方法</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/问题/index.html
HTML
unknown
24,681
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/tags/%E9%AA%8C%E8%AF%81%E7%A0%81/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/tags/%E9%AA%8C%E8%AF%81%E7%A0%81/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>标签: 验证码 | 姓王者的博客</title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content tag"> <div class="post-block"> <div class="posts-collapse"> <div class="collection-title"> <h2 class="collection-header">验证码 <small>标签</small> </h2> </div> <div class="collection-year"> <span class="collection-header">2024</span> </div> <article itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <div class="post-meta"> <time itemprop="dateCreated" datetime="2024-10-08T15:21:09+08:00" content="2024-10-08"> 10-08 </time> </div> <div class="post-title"> <a class="post-title-link" href="/posts/37f315ff/" itemprop="url"> <span itemprop="name">解决国外人机验证不显示问题</span> </a> </div> </header> </article> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
tags/验证码/index.html
HTML
unknown
24,143
importScripts('https://cdn.webpushr.com/sw-server.min.js');
2303_806435pww/xingwangzhe.github.io_moved
webpushr-sw.js
JavaScript
unknown
59
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta name="description" content=".links-content{ margin-top:1rem; } .link-navigation::after { content: &quot; &quot;; display: block; clear: both; } .c"> <meta property="og:type" content="website"> <meta property="og:title" content="友情链接"> <meta property="og:url" content="https://xingwangzhe.fun/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:description" content=".links-content{ margin-top:1rem; } .link-navigation::after { content: &quot; &quot;; display: block; clear: both; } .c"> <meta property="og:locale" content="zh_CN"> <meta property="og:image" content="https://avatars.githubusercontent.com/u/118451956?v=4"> <meta property="og:image" content="https://tech.yemengstar.com/wp-content/uploads/2024/04/cropped-yemenglogoNEW-32x32.png"> <meta property="og:image" content="https://www.langhai.net/assets/images/langhai-logo.png"> <meta property="og:image" content="https://cdn.jsdelivr.net/gh/fushaolei/img/20200524104925.jpg"> <meta property="og:image" content="https://dh.lt6.ltd/favicon.ico"> <meta property="og:image" content="https://www.fish9.cn/favicon.ico"> <meta property="og:image" content="https://t.cn/A6ZIn3XJ"> <meta property="og:image" content="https://source-admibrill.pages.dev/file/f69c9c86b22cb90df18a1.png"> <meta property="og:image" content="https://xingwangzhe.fun/images/apple-touch-icon-next.png"> <meta property="article:published_time" content="2024-10-12T05:33:22.347Z"> <meta property="article:modified_time" content="2024-10-12T05:33:22.347Z"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <meta name="twitter:image" content="https://avatars.githubusercontent.com/u/118451956?v=4"> <link rel="canonical" href="https://xingwangzhe.fun/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>友情链接 | 姓王者的博客 </title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content page posts-expand"> <div class="post-block" lang="zh-CN"> <header class="post-header"> <h1 class="post-title" itemprop="name headline">友情链接 </h1> <div class="post-meta"> </div> </header> <div class="post-body"> <div id="links"> <style> .links-content{ margin-top:1rem; } .link-navigation::after { content: " "; display: block; clear: both; } .card { width: 45%; font-size: 1rem; padding: 10px 20px; border-radius: 4px; transition-duration: 0.15s; margin-bottom: 1rem; display:flex; } .card:nth-child(odd) { float: left; } .card:nth-child(even) { float: right; } .card:hover { transform: scale(1.1); box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04); } .card a { border:none; } .card .ava { width: 3rem!important; height: 3rem!important; margin:0!important; margin-right: 1em!important; border-radius:4px; } .card .card-header { font-style: italic; overflow: hidden; width: 100%; } .card .card-header a { font-style: normal; color: #2bbc8a; font-weight: bold; text-decoration: none; } .card .card-header a:hover { color: #d480aa; text-decoration: none; } .card .card-header .info { font-style:normal; color:#a3a3a3; font-size:14px; min-width: 0; overflow: hidden; white-space: nowrap; } </style> <div class="links-content"> <div class="link-navigation"> <div class="card"> <img class="ava" src="https://avatars.githubusercontent.com/u/118451956?v=4" /> <div class="card-header"> <div> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.lilynet.work">Lily Ellenvia</a> </div> <div class="info">喜歡睡覺的普通人</div> </div> </div> <div class="card"> <img class="ava" src="https://tech.yemengstar.com/wp-content/uploads/2024/04/cropped-yemenglogoNEW-32x32.png" /> <div class="card-header"> <div> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tech.yemengstar.com/">夜梦星尘の折腾日记 </a> </div> <div class="info">眼底星河荡漾,踏着梦走过时光。</div> </div> </div> <div class="card"> <img class="ava" src="https://www.langhai.net/assets/images/langhai-logo.png" /> <div class="card-header"> <div> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.langhai.net/">浪海导航</a> </div> <div class="info">浪海导航 ~ 收录各种类型的博客以及论坛网站</div> </div> </div> <div class="card"> <img class="ava" src="https://cdn.jsdelivr.net/gh/fushaolei/img/20200524104925.jpg" /> <div class="card-header"> <div> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://fushaolei.fun/">琼西往事</a> </div> <div class="info">Do Not Be Sorry, Be Better</div> </div> </div> <div class="card"> <img class="ava" src="https://dh.lt6.ltd/favicon.ico" /> <div class="card-header"> <div> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://dh.lt6.ltd/">龙腾收录网</a> </div> <div class="info"> 我们致力于为广大站长提供一个纯净的精品网站收录,在龙腾收录网可互换友情链接,增加彼此网站曝光度!</div> </div> </div> <div class="card"> <img class="ava" src="https://www.fish9.cn/favicon.ico" /> <div class="card-header"> <div> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.fish9.cn/">吃猫的鱼</a> </div> <div class="info">吃猫的鱼--一个优质的技术博客!</div> </div> </div> <div class="card"> <img class="ava" src="https://t.cn/A6ZIn3XJ" /> <div class="card-header"> <div> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://ksh7.com/"> ksh</a> </div> <div class="info"> Life Oriented Programming</div> </div> </div> <div class="card"> <img class="ava" src="https://source-admibrill.pages.dev/file/f69c9c86b22cb90df18a1.png" /> <div class="card-header"> <div> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.qyadbr.top">Admibrill</a> </div> <div class="info">有志者,事竟成.</div> </div> </div> </div> </div> </div> </section> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> <h1 id="欢迎各位在评论区交换友链:)"><a href="#欢迎各位在评论区交换友链:)" class="headerlink" title="欢迎各位在评论区交换友链:)"></a>欢迎各位在评论区交换友链:)</h1><blockquote> <p><img src="https://xingwangzhe.fun/images/apple-touch-icon-next.png" alt="nihao"><br>博客名称:姓王者的博客<br>博客地址:<a href="https://xingwangzhe.fun/">https://xingwangzhe.fun/</a><br>logo:<a href="https://xingwangzhe.fun/images/apple-touch-icon-next.png">https://xingwangzhe.fun/images/apple-touch-icon-next.png</a><br>封面:<a target="_blank" rel="noopener external nofollow noreferrer" href="https://i.ibb.co/Wg9zLFX/2024-10-12-133038.png">https://i.ibb.co/Wg9zLFX/2024-10-12-133038.png</a><br>描述:记录学习生活的琐事,或者技术文章:)</p> </blockquote> <p>也可以向我发送邮箱<br><a href="mailto:&#120;&#x69;&#x6e;&#x67;&#119;&#97;&#x6e;&#x67;&#122;&#x68;&#x65;&#x40;&#x6f;&#117;&#x74;&#x6c;&#111;&#111;&#x6b;&#46;&#x63;&#111;&#109;" rel="external nofollow noreferrer">&#120;&#x69;&#x6e;&#x67;&#119;&#97;&#x6e;&#x67;&#122;&#x68;&#x65;&#x40;&#x6f;&#117;&#x74;&#x6c;&#111;&#111;&#x6b;&#46;&#x63;&#111;&#109;</a><br><a href="mailto:&#x78;&#x69;&#110;&#x67;&#119;&#x61;&#x6e;&#103;&#122;&#104;&#101;&#64;&#x78;&#105;&#x6e;&#103;&#x77;&#97;&#110;&#x67;&#122;&#104;&#x65;&#46;&#x66;&#117;&#x6e;" rel="external nofollow noreferrer">&#x78;&#x69;&#110;&#x67;&#119;&#x61;&#x6e;&#103;&#122;&#104;&#101;&#64;&#x78;&#105;&#x6e;&#103;&#x77;&#97;&#110;&#x67;&#122;&#104;&#x65;&#46;&#x66;&#117;&#x6e;</a></p> </div> </div> </div> <div class="tabs tabs-comment"> <ul class="nav-tabs"> <li class="tab"><a href="#comment-gitalk">gitalk</a></li> <li class="tab"><a href="#comment-livere">livere</a></li> </ul> <div class="tab-content"> <div class="tab-pane gitalk" id="comment-gitalk"> <div class="comments" id="gitalk-container"></div> </div> <div class="tab-pane livere" id="comment-livere"> <div class="comments"> <div id="lv-container" data-id="city" data-uid="MTAyMC81OTkzNi8zNjM5OQ=="></div> </div> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%AC%A2%E8%BF%8E%E5%90%84%E4%BD%8D%E5%9C%A8%E8%AF%84%E8%AE%BA%E5%8C%BA%E4%BA%A4%E6%8D%A2%E5%8F%8B%E9%93%BE%EF%BC%9A%EF%BC%89"><span class="nav-number">1.</span> <span class="nav-text">欢迎各位在评论区交换友链:)</span></a></li></ol></div> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css"> <script> NexT.utils.loadComments(document.querySelector('#gitalk-container'), () => { NexT.utils.getScript('//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js', () => { var gitalk = new Gitalk({ clientID : 'Ov23lifXHoq97dbVMtsq', clientSecret: '5b1323c3b64bd4fef3f3a56e2c7ada191b416bf4', repo : 'xingwangzhe.github.io', owner : 'xingwangzhe', admin : ['xingwangzhe'], id : 'f6d58a4d36bbc396bee841fdb591c337', language: 'zh-CN', distractionFreeMode: true }); gitalk.render('gitalk-container'); }, window.Gitalk); }); </script> <script> NexT.utils.loadComments(document.querySelector('#lv-container'), () => { window.livereOptions = { refer: location.pathname.replace(CONFIG.root, '').replace('index.html', '') }; (function(d, s) { var j, e = d.getElementsByTagName(s)[0]; if (typeof LivereTower === 'function') { return; } j = d.createElement(s); j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; j.async = true; e.parentNode.insertBefore(j, e); })(document, 'script'); }); </script> </body> </html>
2303_806435pww/xingwangzhe.github.io_moved
友情链接/index.html
HTML
unknown
34,481
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta property="og:type" content="website"> <meta property="og:title" content="姓王者的博客"> <meta property="og:url" content="https://xingwangzhe.fun/%E5%BC%80%E5%BE%80/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:locale" content="zh_CN"> <meta property="article:published_time" content="2024-09-22T07:08:39.000Z"> <meta property="article:modified_time" content="2024-09-22T07:13:27.620Z"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <link rel="canonical" href="https://xingwangzhe.fun/%E5%BC%80%E5%BE%80/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title> | 姓王者的博客 </title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content page posts-expand"> <div class="post-block" lang="zh-CN"> <header class="post-header"> <h1 class="post-title" itemprop="name headline"> </h1> <div class="post-meta"> </div> </header> <div class="post-body"> </div> </div> </div> <div class="tabs tabs-comment"> <ul class="nav-tabs"> <li class="tab"><a href="#comment-gitalk">gitalk</a></li> <li class="tab"><a href="#comment-livere">livere</a></li> </ul> <div class="tab-content"> <div class="tab-pane gitalk" id="comment-gitalk"> <div class="comments" id="gitalk-container"></div> </div> <div class="tab-pane livere" id="comment-livere"> <div class="comments"> <div id="lv-container" data-id="city" data-uid="MTAyMC81OTkzNi8zNjM5OQ=="></div> </div> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css"> <script> NexT.utils.loadComments(document.querySelector('#gitalk-container'), () => { NexT.utils.getScript('//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js', () => { var gitalk = new Gitalk({ clientID : 'Ov23lifXHoq97dbVMtsq', clientSecret: '5b1323c3b64bd4fef3f3a56e2c7ada191b416bf4', repo : 'xingwangzhe.github.io', owner : 'xingwangzhe', admin : ['xingwangzhe'], id : 'd6f9886256ecd4885f73edb87a6a0e8d', language: 'zh-CN', distractionFreeMode: true }); gitalk.render('gitalk-container'); }, window.Gitalk); }); </script> <script> NexT.utils.loadComments(document.querySelector('#lv-container'), () => { window.livereOptions = { refer: location.pathname.replace(CONFIG.root, '').replace('index.html', '') }; (function(d, s) { var j, e = d.getElementsByTagName(s)[0]; if (typeof LivereTower === 'function') { return; } j = d.createElement(s); j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; j.async = true; e.parentNode.insertBefore(j, e); })(document, 'script'); }); </script> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> </html>
2303_806435pww/xingwangzhe.github.io_moved
开往/index.html
HTML
unknown
25,595
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"> <meta name="theme-color" content="#222"> <meta name="generator" content="Hexo 7.2.0"> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o63weqvwcw"); </script> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"> <link rel="mask-icon" href="/images/logo.svg" color="#222"> <link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"> <script id="hexo-configurations"> var NexT = window.NexT || {}; var CONFIG = {"hostname":"xingwangzhe.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"text":true,"style":"tabs","count":true,"active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"}; </script> <meta name="description" content=".links-content { margin-top: 1rem; } .link-navigation::after { content: &quot; &quot;; display: block; clear: both; } .card { width: 45%; font-size: 1rem; padding: 10px 20px; bo"> <meta property="og:type" content="website"> <meta property="og:title" content="推荐网站"> <meta property="og:url" content="https://xingwangzhe.fun/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/index.html"> <meta property="og:site_name" content="姓王者的博客"> <meta property="og:description" content=".links-content { margin-top: 1rem; } .link-navigation::after { content: &quot; &quot;; display: block; clear: both; } .card { width: 45%; font-size: 1rem; padding: 10px 20px; bo"> <meta property="og:locale" content="zh_CN"> <meta property="og:image" content="https://www.neu.edu.cn/images/favicon.ico"> <meta property="og:image" content="https://xn--xhq44jb2fzpc.com/icons/favicon.ico"> <meta property="og:image" content="https://www.neu.edu.cn/images/favicon.ico"> <meta property="og:image" content="https://www.neumathe.cn/favicon.ico"> <meta property="og:image" content="https://course.educg.net/images/cgicon.png"> <meta property="og:image" content="https://ts4.cn.mm.bing.net/th?id=ODLS.625f3b20-705e-4a5b-948d-eac03f40229d&w=32&h=32&qlt=90&pcl=fffffa&o=6&pid=1.2"> <meta property="og:image" content="https://wiki.fishport.net/images/thumb/e/ee/Fishport.webp/188px-Fishport.webp.png"> <meta property="og:image" content="https://neu.sugrsertraline.cn/%E5%9B%BE%E4%B9%A6.png"> <meta property="og:image" content="https://tool.lu/favicon.ico"> <meta property="og:image" content="https://tb3.bdstatic.com/public/icon/favicon-v2.ico"> <meta property="og:image" content="https://www.travellings.cn/assets/favicon.png"> <meta property="og:image" content="https://www.foreverblog.cn/favicon.ico"> <meta property="article:published_time" content="2024-10-11T08:42:13.697Z"> <meta property="article:modified_time" content="2024-10-11T08:42:13.697Z"> <meta property="article:author" content="姓王者"> <meta property="article:tag" content="xingwangzhe,姓王者的博客,姓王者,姓王者的blog,姓王者无敌,王兴家,hexo,前端,web,js,html,css,vue,react,angular,node,python,java,go,rust,swift,php,mysql,mongodb,redis,linux,docker,kubernetes,git,github,markdown,seo,webpush,web-push,web-push-notification,web-push-api,web-push-protocol,web-push-service-worker,web-push-api-service-worker,web-push-api-service-worker-protocol,web-push-api-service-worker-specification,web-push-api-service-worker-specification-draft,web-push-api-service-worker-specification-draft-01,web-push-api-service-worker-specification-draft-02,web-push-api-service-worker-specification-draft-03,web-push-api-service-worker-specification-draft-04,web-push-api-service-worker-specification-draft"> <meta name="twitter:card" content="summary"> <meta name="twitter:image" content="https://www.neu.edu.cn/images/favicon.ico"> <link rel="canonical" href="https://xingwangzhe.fun/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/"> <script id="page-configurations"> // https://hexo.io/docs/variables.html CONFIG.page = { sidebar: "", isHome : false, isPost : false, lang : 'zh-CN' }; </script> <script async src="/lib/fireworks.js"></script> <title>推荐网站 | 姓王者的博客 </title> <noscript> <style> .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-header { opacity: initial; } .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion .logo-line-before i { left: initial; } .use-motion .logo-line-after i { right: initial; } </style> </noscript> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "o32sgd266v"); </script> <link rel="alternate" href="/atom.xml" title="姓王者的博客" type="application/atom+xml"> <link rel="alternate" href="/rss2.xml" title="姓王者的博客" type="application/rss+xml"> <style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head> <body> <!-- start webpushr code --> <script>(function(w,d, s, id) {if(typeof(w.webpushr)!=='undefined') return;w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.async=1;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('setup',{'key':'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script><!-- end webpushr code --> <body itemscope itemtype="http://schema.org/WebPage"> <div class="container use-motion"> <div class="headband"></div> <a href="https://github.com/xingwangzhe/" rel="external nofollow noreferrer" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"> <div class="site-brand-container"> <div class="site-nav-toggle"> <div class="toggle" aria-label="切换导航栏"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> </div> <div class="site-meta"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <h1 class="site-title">姓王者的博客</h1> <span class="logo-line-after"><i></i></span> </a> <p class="site-subtitle" itemprop="description">记录学习生活的琐事,或者技术文章:)</p> </div> <div class="site-nav-right"> <div class="toggle popup-trigger"> <i class="fa fa-search fa-fw fa-lg"></i> </div> </div> </div> <nav class="site-nav"> <ul id="menu" class="main-menu menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a> </li> <li class="menu-item menu-item-about"> <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a> </li> <li class="menu-item menu-item-categories"> <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a> </li> <li class="menu-item menu-item-开往"> <a href="https://www.travellings.cn/go.html" rel="noopener external nofollow noreferrer" target="_blank"><i class="fa fa-train fa-fw"></i>开往</a> </li> <li class="menu-item menu-item-友情链接"> <a href="/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/" rel="section"><i class="fa fa-link fa-fw"></i>友情链接</a> </li> <li class="menu-item menu-item-推荐网站"> <a href="/%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99/" rel="section"><i class="fa fa-link fa-fw"></i>推荐网站</a> </li> <li class="menu-item menu-item-说说"> <a href="/essay/" rel="section"><i class="fas fa-pen fa-fw"></i>说说</a> </li> <li class="menu-item menu-item-rss"> <a href="/atom.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a> </li> <li class="menu-item menu-item-search"> <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索 </a> </li> </ul> </nav> <div class="search-pop-overlay"> <div class="popup search-popup"> <div class="search-header"> <span class="search-icon"> <i class="fa fa-search"></i> </span> <div class="search-input-container"> <input autocomplete="off" autocapitalize="off" placeholder="搜索..." spellcheck="false" type="search" class="search-input"> </div> <span class="popup-btn-close"> <i class="fa fa-times-circle"></i> </span> </div> <div id="search-result"> <div id="no-result"> <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i> </div> </div> </div> </div> </div> </header> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> <span>0%</span> </div> <div class="reading-progress-bar"></div> <main class="main"> <div class="main-inner"> <div class="content-wrap"> <div class="content page posts-expand"> <div class="post-block" lang="zh-CN"> <header class="post-header"> <h1 class="post-title" itemprop="name headline">推荐网站 </h1> <div class="post-meta"> </div> </header> <div class="post-body"> <style> .links-content { margin-top: 1rem; } .link-navigation::after { content: " "; display: block; clear: both; } .card { width: 45%; font-size: 1rem; padding: 10px 20px; border-radius: 4px; transition-duration: 0.15s; margin-bottom: 1rem; display: flex; } .card:nth-child(odd) { float: left; } .card:nth-child(even) { float: right; } .card:hover { transform: scale(1.1); box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04); } .card a { border: none; } .card .ava { width: 3rem !important; height: 3rem !important; margin: 0 !important; margin-right: 1em !important; border-radius: 4px; } .card .card-header { font-style: italic; overflow: hidden; width: 100%; } .card .card-header a { font-style: normal; color: #2bbc8a; font-weight: bold; text-decoration: none; } .card .card-header a:hover { color: #d480aa; text-decoration: none; } .card .card-header .info { font-style: normal; color: #a3a3a3; font-size: 14px; min-width: 0; overflow: hidden; white-space: nowrap; } </style> <body> <div class="links-content"> <div class="link-navigation"> <div class="card"> <img class="ava" src="https://www.neu.edu.cn/images/favicon.ico" /> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="https://eone.neu.edu.cn/">东北大学一网通</a></div> <div class="info">自强不息,知行合一 </div> </div> </div> <div class="card"> <img class="ava" src="https://xn--xhq44jb2fzpc.com/icons/favicon.ico" /> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.东北大学.com/">NEU小站</a></div> <div class="info">助学业和生活中更加得心应手</div> </div> </div> <div class="card"> <img class="ava" src="https://www.neu.edu.cn/images/favicon.ico" /> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="http://mathe.neu.edu.cn/">东北大学机考网站</a></div> <div class="info">官方网站,主要用作考试与预约</div> </div> </div> <div class="card"> <img class="ava" src="https://www.neumathe.cn/favicon.ico" /> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.neumathe.cn/">东北大学机考题库</a></div> <div class="info">非官方网站,主要刷题用</div> </div> </div> <div class="card"> <img class="ava" src="https://course.educg.net/images/cgicon.png" /> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="http://neucsecg.neu.edu.cn/">cg平台</a></div> <div class="info">信息类课作业与考试平台</div> </div> </div> <div class="card"> <img class="ava" src="https://ts4.cn.mm.bing.net/th?id=ODLS.625f3b20-705e-4a5b-948d-eac03f40229d&w=32&h=32&qlt=90&pcl=fffffa&o=6&pid=1.2"> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.icourse163.org/">中国大学MOOC</a></div> <div class="info">别忘做作业哦:)</div> </div> </div> <div class="card"> <img class="ava" src="https://wiki.fishport.net/images/thumb/e/ee/Fishport.webp/188px-Fishport.webp.png"> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="https://wiki.fishport.net/">FishPort Wiki</a></div> <div class="info">一个我的世界服务器wiki站</div> </div> </div> <div class="card"> <img class="ava" src="https://neu.sugrsertraline.cn/图书.png"> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="https://neu.sugrsertraline.cn/">NEU-Wiki<a></div> <div class="info">为NEUer们提供的简单、快捷的校园信息查询</div> </div> </div> <div class="card"> <img class="ava" src="https://tool.lu/favicon.ico"> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/">在线工具</a></div> <div class="info">多功能的工具网站</div> </div> </div> <div class="card"> <img class="ava" src="https://tb3.bdstatic.com/public/icon/favicon-v2.ico"> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="https://tieba.baidu.com/f?kw=%E4%B8%9C%E5%8C%97%E5%A4%A7%E5%AD%A6&ie=utf-8">东北大学校园贴吧</a></div> <div class="info">东兵的聚集地</div> </div> </div> <div class="card"> <img class="ava" src="https://www.travellings.cn/assets/favicon.png"> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.travellings.cn/">开往</a></div> <div class="info">让传统友链“活跃”</div> </div> </div> <div class="card"> <img class="ava" src="https://www.foreverblog.cn/favicon.ico"> <div class="card-header"> <div><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.foreverblog.cn/">十年之约</a></div> <div class="info">一个人的寂寞,一群人的狂欢。</div> </div> </div> </div> <!-- hexo injector body_end start --><script data-pjax src="https://unpkg.com/oh-my-live2d"></script><script>const oml2d = OML2D.loadOml2d({libraryUrls:{"complete":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js","cubism2":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js","cubism5":"https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js"},mobileDisplay:false,models:[{"path":"/L2DMCVT_steve/L2DMCVT.model3.json","scale":0.11,"position":[-100,0],"mobileScale":0.08,"mobilePosition":[-100,0],"motionPreloadStrategy":"ALL","showHitAreaFrames":true,"mobileStageStyle":{"width":180},"stageStyle":{"width":250}}],parentElement:document.body,primaryColor:"var(--btn-bg)",sayHello:false,dockedPosition:"right",tips:{copyTips: {"message":["你复制了什么内容捏?记得注明出处哦~","ctrl+c复制,ctrl+v粘贴~","我们不生产文字,我们只是搬运工","我可是一直在盯着你:),我知道你在复制什么~"]},style: {"width":230,"height":120,"left":"calc(50% - 20px)","top":"-100px"},mobileStyle: {"width":180,"height":80,"left":"calc(50% - 30px)","top":"-100px"},idleTips:{interval:15000,message:["你好呀~","欢迎来到我的小站~"],wordTheDay:function(wordTheDayData){ return `${wordTheDayData.hitokoto} by.${wordTheDayData.from}`; } }},statusBar:{"restMessage":"你现在不能休息,周围有怪物在游荡"}});</script><!-- hexo injector body_end end --><script>(function (w, d, s, id) { if (typeof (w.webpushr) !== 'undefined') return; w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) }; var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.async = 1; js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window, document, 'script', 'webpushr-jssdk'));webpushr('setup', { 'key': 'BHV3kn7WLHGjPMT5Zz8kKEvzbDX44x9Rt3olfj_Q3QnCoQADtAW7h7dvBBmASSAi9xtRbIXoq2xEpmNWHaZb6NM' });</script></body> <h1 id="欢迎评论区留言推荐网站"><a href="#欢迎评论区留言推荐网站" class="headerlink" title="欢迎评论区留言推荐网站:)"></a>欢迎评论区留言推荐网站:)</h1> </div> </div> </div> <div class="tabs tabs-comment"> <ul class="nav-tabs"> <li class="tab"><a href="#comment-gitalk">gitalk</a></li> <li class="tab"><a href="#comment-livere">livere</a></li> </ul> <div class="tab-content"> <div class="tab-pane gitalk" id="comment-gitalk"> <div class="comments" id="gitalk-container"></div> </div> <div class="tab-pane livere" id="comment-livere"> <div class="comments"> <div id="lv-container" data-id="city" data-uid="MTAyMC81OTkzNi8zNjM5OQ=="></div> </div> </div> </div> </div> <script> window.addEventListener('tabs:register', () => { let { activeClass } = CONFIG.comments; if (CONFIG.comments.storage) { activeClass = localStorage.getItem('comments_active') || activeClass; } if (activeClass) { let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); if (activeTab) { activeTab.click(); } } }); if (CONFIG.comments.storage) { window.addEventListener('tabs:click', event => { if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; let commentClass = event.target.classList[1]; localStorage.setItem('comments_active', commentClass); }); } </script> </div> <div class="toggle sidebar-toggle"> <span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span> </div> <aside class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc"> 文章目录 </li> <li class="sidebar-nav-overview"> 站点概览 </li> </ul> <!--noindex--> <div class="post-toc-wrap sidebar-panel"> <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%AC%A2%E8%BF%8E%E8%AF%84%E8%AE%BA%E5%8C%BA%E7%95%99%E8%A8%80%E6%8E%A8%E8%8D%90%E7%BD%91%E7%AB%99"><span class="nav-number">1.</span> <span class="nav-text">欢迎评论区留言推荐网站:)</span></a></li></ol></div> </div> <!--/noindex--> <div class="site-overview-wrap sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="姓王者" src="/images/avatar.jpg"> <p class="site-author-name" itemprop="name">姓王者</p> <div class="site-description" itemprop="description"></div> </div> <div class="site-state-wrap motion-element"> <nav class="site-state"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">44</span> <span class="site-state-item-name">归档</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories/"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span></a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/"> <span class="site-state-item-count">48</span> <span class="site-state-item-name">标签</span></a> </div> </nav> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xingwangzhe" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;xingwangzhe" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="/xingwangzhe@outlook.com" title="E-Mail → xingwangzhe@outlook.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://space.bilibili.com/1987297874" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1987297874" rel="noopener external nofollow noreferrer" target="_blank"><i class="fab fa-youtube fa-fw"></i>Bilibili</a> </span> </div> <!-- CloudCalendar --> <div class="widget-wrap" style="width: 90%;margin-left: auto;margin-right: auto; opacity: 0.97;"> <div class="widget" id="CloudCalendar"></div> </div> </div> <div class="where is your ip"> <h3>访客信息</h3> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tool.lu/ip/"> <img src="https://tool.lu/netcard/"> </a> <a target="_blank" href="https://time.is/China" id="time_is_link" rel="nofollow noopener" style="font-size:20px">北京时间:</a> <span id="China_z43d" style="font-size:20px"></span> <script src="//widget.time.is/zh.js"></script> <script> time_is_widget.init({China_z43d:{template:"TIME<br>DATE<br>SUN", date_format:"year-monthnum-daynum dname", sun_format:"日出: srhour:srminute 日落: sshour:ssminute<br>昼长: dlhours时 dlminutes分", coords:"35.0000000,105.0000000"}}); </script> </div> </div> </aside> <div id="sidebar-dimmer"></div> </div> </main> <footer class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; <span itemprop="copyrightYear">2024</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">姓王者</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-chart-area"></i> </span> <span class="post-meta-item-text">站点总字数:</span> <span title="站点总字数">116k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"> <i class="fa fa-coffee"></i> </span> <span class="post-meta-item-text">站点阅读时长 &asymp;</span> <span title="站点阅读时长">1:45</span> </div> <div style="display: flex; align-items: center; justify-content: center;"> <a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener external nofollow noreferrer" title="开往-友链接力"> <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力" width="120"> </a> <a href="https://icp.dns163.cn/beian/ICP-2024100103.html" rel="external nofollow noreferrer" title="易AIA盟2024100103号" target="_blank" style="display: inline-flex; align-items: center; margin-right: 10px;"> <img src="https://icp.dns163.cn/static/picture/icplogoi.png" style="width: 20px; height: 20px; margin-right: 5px;"> 易AIA盟2024100103号 </a> <a target="_blank" href="https://beian.miit.cn.com/gov/search.php?query=xingwangzhe.fun" rel="external nofollow noreferrer" title="MIIT备20241054号" style="display: inline-flex; align-items: center;"> <img src="https://beian.miit.cn.com/logo.svg" alt="MIIT" width="20" style="margin-right: 5px;"> MIIT备20241054号 </a> <a href="https://www.gyfzlm.com/fanzha/NO-20240105.html" rel="external nofollow noreferrer" target="_blank"><img style="width:130px;height:45px;" src="https://www.gyfzlm.com/istatic/image/gyfzlogo.png" alt="公益反诈联盟成员单位"></a> </div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime() { var grt= new Date("6/21/2024 6:30:00"); //修改为你的网站开始运行的时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站正常运行 "+dnum+" 天 "; document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒."; } setInterval("createtime()",250); </script> <div class="busuanzi-count"> <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-user"></i> </span> <span class="site-uv" title="总访客量"> <span id="busuanzi_value_site_uv"></span> </span> </span> <span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"> <span class="post-meta-item-icon"> <i class="fa fa-eye"></i> </span> <span class="site-pv" title="总访问量"> <span id="busuanzi_value_site_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/lib/anime.min.js"></script> <script src="/lib/velocity/velocity.min.js"></script> <script src="/lib/velocity/velocity.ui.min.js"></script> <script src="/js/utils.js"></script> <script src="/js/motion.js"></script> <script src="/js/schemes/pisces.js"></script> <script src="/js/next-boot.js"></script> <script src="/js/local-search.js"></script> <!-- calendar widget --> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/calendar.min.js"></script> <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-calendar/languages.min.js"></script> <script> $(function() { $('#CloudCalendar').aCalendar('zh-CN', $.extend( '', { single:true, root:'/calendar/' } ) ); }); </script> <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css"> <script> NexT.utils.loadComments(document.querySelector('#gitalk-container'), () => { NexT.utils.getScript('//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js', () => { var gitalk = new Gitalk({ clientID : 'Ov23lifXHoq97dbVMtsq', clientSecret: '5b1323c3b64bd4fef3f3a56e2c7ada191b416bf4', repo : 'xingwangzhe.github.io', owner : 'xingwangzhe', admin : ['xingwangzhe'], id : 'bf281643dac5af82a584bd520e7ca8c0', language: 'zh-CN', distractionFreeMode: true }); gitalk.render('gitalk-container'); }, window.Gitalk); }); </script> <script> NexT.utils.loadComments(document.querySelector('#lv-container'), () => { window.livereOptions = { refer: location.pathname.replace(CONFIG.root, '').replace('index.html', '') }; (function(d, s) { var j, e = d.getElementsByTagName(s)[0]; if (typeof LivereTower === 'function') { return; } j = d.createElement(s); j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; j.async = true; e.parentNode.insertBefore(j, e); })(document, 'script'); }); </script> </body> </html>
2303_806435pww/xingwangzhe.github.io_moved
推荐网站/index.html
HTML
unknown
34,202
FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive # 安装依赖 RUN echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe" >> /etc/apt/sources.list && \ apt-get update && apt-get install -y \ binutils libc-dev libc++-dev libgcc-7-dev wget tar gzip unzip build-essential ca-certificates git && \ rm -rf /var/lib/apt/lists/* # 编译 OpenSSL WORKDIR /tmp RUN wget https://www.openssl.org/source/openssl-3.0.12.tar.gz && \ tar -xzf openssl-3.0.12.tar.gz && \ cd openssl-3.0.12 && ./config --prefix=/usr/local/openssl && make -j$(nproc) && make install && \ cd .. && rm -rf openssl-3.0.12* RUN echo "/usr/local/openssl/lib" >> /etc/ld.so.conf && ldconfig ENV OPENSSL_DIR=/usr/local/openssl ENV PATH="${OPENSSL_DIR}/bin:${PATH}" ENV LD_LIBRARY_PATH="${OPENSSL_DIR}/lib:${LD_LIBRARY_PATH}" # 下载并安装 Cangjie SDK WORKDIR /workspace RUN wget -O cangjie-sdk-linux-x64-1.0.0.tar.gz "https://cangjie-lang.cn/v1/files/auth/downLoad?nsId=142267&fileName=cangjie-sdk-linux-x64-1.0.0.tar.gz&objectKey=68637fc53bcda926055851db" && \ echo "8894e63a181bc0534af24263b449c2d8d4d9dfb16ff1270b793499fe06ce6dcf cangjie-sdk-linux-x64-1.0.0.tar.gz" | sha256sum -c && \ tar -xzf cangjie-sdk-linux-x64-1.0.0.tar.gz && \ rm cangjie-sdk-linux-x64-1.0.0.tar.gz # 下载 stdx RUN wget https://gitcode.com/Cangjie/cangjie-stdx-bin/releases/download/v1.0.1.1/cangjie-stdx-linux-x64-1.0.1.1.zip && \ unzip cangjie-stdx-linux-x64-1.0.1.1.zip && rm cangjie-stdx-linux-x64-1.0.1.1.zip # 设置环境变量(关键:包含 tools 目录) ENV CJ_HOME=/workspace/cangjie ENV PATH="${CJ_HOME}/bin:${CJ_HOME}/tools:${PATH}" ENV LD_LIBRARY_PATH="${CJ_HOME}/lib:${LD_LIBRARY_PATH}" # 核心修复:强制 bash 启动时加载环境 RUN echo "source ${CJ_HOME}/envsetup.sh" >> /root/.bashrc # 创建入口点脚本(打印信息 + 执行 bash) RUN echo '#!/bin/bash\n\ echo "=== Cangjie Environment Initialized ==="\n\ echo "Cangjie SDK location: ${CJ_HOME}"\n\ echo "stdx location: /workspace/linux_x86_64_llvm/dynamic/stdx"\n\ echo ""\n\ echo "Running: cjc -v"\ncjc -v\n\ echo ""\n\ echo "Running: cjpm --version"\ncjpm --version\n\ echo ""\n\ exec "$@"' > /entrypoint.sh && chmod +x /entrypoint.sh WORKDIR /workspace/projects ENTRYPOINT ["/entrypoint.sh"] CMD ["bash"]
2401_82796943/cangjie_docker
Dockerfile
Dockerfile
unknown
2,318
import os import re from pathlib import Path def clean_markdown(content): """清洗Markdown内容,移除所有标记符号""" # 1. 移除图片 ![alt](url) 或 ![alt][id] content = re.sub(r'!\[.*?\]\(.*?\)', '', content) content = re.sub(r'!\[.*?\]\[.*?\]', '', content) # 2. 移除链接 [text](url) 或 [text][id],但保留文本 content = re.sub(r'\[([^\]]*?)\]\([^\)]*?\)', r'\1', content) content = re.sub(r'\[([^\]]*?)\]\[.*?\]', r'\1', content) # 3. 移除重点符号(粗体、斜体) content = re.sub(r'\*\*(.*?)\*\*', r'\1', content) # **bold** content = re.sub(r'\*(.*?)\*', r'\1', content) # *italic* content = re.sub(r'__(.*?)__', r'\1', content) # __bold__ content = re.sub(r'_(.*?)_', r'\1', content) # _italic_ # 4. 移除标题标记 #, ##, ### 等 content = re.sub(r'^#{1,6}\s*', '', content, flags=re.MULTILINE) # 5. 移除引用标记 > content = re.sub(r'^>\s*', '', content, flags=re.MULTILINE) # 6. 移除列表标记 -, +, *, 数字. content = re.sub(r'^\s*[-+*]\s+', '', content, flags=re.MULTILINE) # 无序列表 content = re.sub(r'^\s*\d+\.\s+', '', content, flags=re.MULTILINE) # 有序列表 # 7. 移除代码块 ```...``` content = re.sub(r'```[\s\S]*?```', '', content) # 8. 移除行内代码 `code` content = re.sub(r'`([^`]+?)`', r'\1', content) # 9. 移除水平线 ---, ***, ___ content = re.sub(r'^[\*_\-]{3,}\s*$', '', content, flags=re.MULTILINE) # 10. 移除HTML标签 content = re.sub(r'<[^>]+>', '', content) # 11. 移除转义字符 content = content.replace('\\', '') # 12. 合并多个空行为一个空行 content = re.sub(r'\n\s*\n\s*\n+', '\n\n', content) # 13. 移除行尾空格 content = re.sub(r'[ \t]+$', '', content, flags=re.MULTILINE) return content def process_markdown_files(folder_path): """处理指定文件夹中的所有markdown文件""" folder = Path(folder_path) # 确保文件夹存在 if not folder.exists(): print(f"错误:文件夹 {folder_path} 不存在") return # 遍历所有.md文件 md_files = list(folder.glob("*.md")) if not md_files: print(f"在 {folder_path} 中没有找到 .md 文件") return print(f"找到 {len(md_files)} 个Markdown文件,开始清洗...") for md_file in md_files: try: # 读取文件内容 with open(md_file, 'r', encoding='utf-8') as f: content = f.read() # 清洗内容 cleaned_content = clean_markdown(content) # 生成输出文件名(相同文件名,.txt扩展名) output_file = folder / f"{md_file.stem}.txt" # 保存清洗后的内容 with open(output_file, 'w', encoding='utf-8') as f: f.write(cleaned_content) print(f"✓ 已处理: {md_file.name} -> {output_file.name}") except Exception as e: print(f"✗ 处理文件 {md_file.name} 时出错: {e}") print("\n清洗完成!") # 主程序 if __name__ == "__main__": # 使用相对路径 "all" 文件夹 folder_path = "all_md" process_markdown_files(folder_path)
2401_82796943/WeChat_OfficialAccount_DownloadToolchain
clean_markdown.py
Python
unknown
3,522
@echo on setlocal enabledelayedexpansion :: 创建目标文件夹 if not exist "all_md" mkdir all_md :: 遍历当前文件夹下的一级子文件夹 for /d %%i in (*) do ( :: 遍历每个子文件夹中的.md文件 for %%j in ("%%i\*.md") do ( :: 复制.md文件到目标文件夹 copy "%%j" "all_md\" ) ) pause
2401_82796943/WeChat_OfficialAccount_DownloadToolchain
md.bat
Batchfile
unknown
358
from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets import urllib.request, urllib.error, time from PyQt5.QtCore import Qt from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from test import QMainWindow_new class Ui_tensorboradshow(QMainWindow_new): def __init__(self): super(Ui_tensorboradshow, self).__init__() self.setupUi(self) def setupUi(self, tensorboradshow): label_backdrop = QLabel(self) label_backdrop.resize(1460, 800) label_backdrop.setStyleSheet("background-color: rgb(240, 250, 250);") label_title = QLabel(self) label_title.resize(1460, 50) label_title.setText(" 训练结果查看") label_title.setFont(QtGui.QFont("Adobe 黑体 Std R", 18)) label_title.setStyleSheet("background-color: rgb(50, 200, 200);") label_T = QLabel(self) label_T.resize(40, 40) label_T.move(5, 5) label_T.setPixmap(QPixmap(r"ui\label.jpg").scaled(label_T.size(), Qt.KeepAspectRatio, Qt.SmoothTransformation)) button_close = QPushButton(self) button_close.setStyleSheet("QPushButton {border: none;}") button_close.setIcon(QIcon(r"ui\close.png")) button_close.resize(50, 50) button_close.move(1410, 0) button_close.clicked.connect(self.close) button_min = QPushButton(self) button_min.setStyleSheet("QPushButton {border: none;}") button_min.setIcon(QIcon(r"ui\min.png")) button_min.resize(50, 50) button_min.move(1360, 0) button_min.clicked.connect(self.showMinimized) # ———————————————————————————————————————————————————————————— tensorboradshow.setObjectName("tensorboradshow") tensorboradshow.resize(1460, 800) tensorboradshow.setMinimumSize(QtCore.QSize(1460, 800)) tensorboradshow.setMaximumSize(QtCore.QSize(1460, 800)) self.t_url_state_textedit = QtWidgets.QTextEdit(tensorboradshow) self.t_url_state_textedit.setGeometry(QtCore.QRect(1240, 70, 200, 700)) self.t_url_state_textedit.setObjectName("t_url_state_textedit") # ———————————————————————————————————————————————————————————— ## 创建web窗体 ''' 在QT Designer里面,没有WebEngine窗体,只能在程序中创建,先将其他的部分放好。 ''' self.qwebengine = QtWebEngineWidgets.QWebEngineView(tensorboradshow) self.qwebengine.setGeometry(20, 70, 1200, 700) self.retranslateUi(tensorboradshow) QtCore.QMetaObject.connectSlotsByName(tensorboradshow) def retranslateUi(self, tensorboradshow): font = QtGui.QFont() font.setFamily("Adobe 黑体 Std R") font.setPointSize(10) font.setBold(True) font.setStyleStrategy(QtGui.QFont.PreferAntialias) _translate = QtCore.QCoreApplication.translate tensorboradshow.setWindowTitle(_translate("tensorborad", "tensorborad")) url = 'http://localhost:6006/#timeseries' self.qwebengine.load(QtCore.QUrl(url)) # 打开网页 self.get_error_mode(url) self.t_url_state_textedit.setFont(font) self.t_url_state_textedit.setReadOnly(True) def setCenter(self): screen = QDesktopWidget().screenGeometry() size = self.geometry() self.move(int((screen.width() - size.width()) / 2), int((screen.height() - size.height()) / 2)) ## 将获取网站状态码以及输出异常域名的功能写成函数,调用的时候只需要将文件路径放进参数即可 def get_error_mode(self, url): try: start = time.perf_counter() ## 配置超时时间 file = urllib.request.urlopen(url, timeout=100) ## 获取访问状态 elapsed = (time.perf_counter() - start) self.t_url_state_textedit.setText( str("%s可正常访问" % url) + '\n' + str("状态码:%s" % file.getcode() + '\n' + str("耗时:%s" % round(elapsed, 4)))) print("%s可正常访问" % url) print("状态码:%s" % file.getcode()) print("耗时:%s" % round(elapsed, 4)) # 异常域名会进入except,可以得到出错URLError except urllib.error.URLError as e: print("%s异常" % url) if hasattr(e, "code"): print("错误状态码: %s" % e.code) self.t_url_state_textedit.setText(str("%s异常" % url) + '\n' + str("错误状态码: %s" % e.code)) if hasattr(e, "reason"): print("出错原因:%s" % e.reason) self.t_url_state_textedit.setText(str("%s异常" % url) + '\n' + str("出错原因:%s" % e.reason))
2201_75373101/TargetSingleAndBinocularRanging
Tensorboradshow.py
Python
unknown
5,043
import yolo_train,yolo_predict from yolo_train import * from yolo_predict import * class myMain(QObject): font1 = QtGui.QFont("Adobe 黑体 Std R") font1.setPixelSize(36) font2 = QtGui.QFont("Adobe 黑体 Std R") font2.setPixelSize(72) def __init__(self): super(myMain, self).__init__() self.Ytrain = yolo_train.MyWindow() self.Ypredict = yolo_predict.myPredict() self.create_window() def create_window(self): self.mainWindow = QMainWindow_new() self.mWw = 1200 self.mWh = 600 self.mainWindow.resize(self.mWw, self.mWh) self.mainWindow.move(400, 400) self.mainWindow.setWindowTitle('鸟眼') self.mainWindow.setFixedSize(self.mWw, self.mWh) self.mainWindow.setWindowIcon(QIcon("./ui/label.jpg")) # self.window.setWindowIcon(QIcon(r'ui\image\title.ico')) label_backdrop = QLabel(self.mainWindow) label_backdrop.resize(self.mWw, self.mWh) label_backdrop.setStyleSheet("background-color: rgb(240, 250, 250);") label_title = QLabel(self.mainWindow) label_title.resize(self.mWw,50) label_title.setText(" 鸟眼") label_title.setFont(QtGui.QFont("Adobe 黑体 Std R", 16)) label_title.setStyleSheet("background-color: rgb(50, 200, 200);") label_T = QLabel(self.mainWindow) label_T.resize(40,40) label_T.move(5,5) label_T.setPixmap(QPixmap(r"ui\label.jpg").scaled(label_T.size(), Qt.KeepAspectRatio, Qt.SmoothTransformation)) button_close = QPushButton(self.mainWindow) button_close.setStyleSheet("QPushButton {border: none;}") button_close.setIcon(QIcon(r"ui\close.png")) button_close.resize(50, 50) button_close.move(self.mWw - 50, 0) button_close.clicked.connect(self.mainWindow.close) button_min = QPushButton(self.mainWindow) button_min.setStyleSheet("QPushButton {border: none;}") button_min.setIcon(QIcon(r"ui\min.png")) button_min.resize(50, 50) button_min.move(self.mWw - 100, 0) button_min.clicked.connect(self.mainWindow.showMinimized) label1 = QLabel(self.mainWindow) label1.move(self.mWw // 2 - 200, 70) label1.resize(600,200) label1.setText("欢 迎 使 用\n 鸟 眼 ") label1.setFont(self.font2) label_left = QLabel(self.mainWindow) label_left.setScaledContents(True) label_left.resize(400, 400) label_left.move(0, 150) movie = QMovie(r"ui\bird_1.gif") label_left.setMovie(movie) movie.start() label_right = QLabel(self.mainWindow) label_right.setScaledContents(True) label_right.resize(400,400) label_right.move(800,150) movie = QMovie(r"ui\bird.gif") label_right.setMovie(movie) movie.start() button_train = QPushButton(self.mainWindow) button_train.resize(300,100) button_train.move(self.mWw//2-150,self.mWh//2) button_train.setText("训 练 模 型") button_train.setFont(self.font1) button_train.clicked.connect(self.train_model) button_predict = QPushButton(self.mainWindow) button_predict.resize(300, 100) button_predict.move(self.mWw//2-150, self.mWh//2+150) button_predict.setText("检 测 目 标") button_predict.setFont(self.font1) button_predict.clicked.connect(self.predict_target) def train_model(self): self.Ytrain.show() def predict_target(self): self.Ypredict.mainWindow.show() if __name__=='__main__': QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) app = QApplication([]) mymain = myMain() mymain.mainWindow.show() app.exec_() sys.exit()
2201_75373101/TargetSingleAndBinocularRanging
main.py
Python
unknown
3,824
import os,sys import threading import time from PyQt5.QtWidgets import * from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import QSize, Qt, QCoreApplication from PyQt5.QtGui import QIcon, QPixmap from PyQt5.QtWidgets import QFileDialog, QListWidgetItem, QListView, QMessageBox, QDesktopWidget from test import QMainWindow_new l_photo = ['jpg', "JPG", "png", "PNG", "JPEG", "jpeg", "gif", "GIF", ".bmp"] # 图片类型 l_photo_point = ['.jpg', ".JPG", ".png", ".PNG", ".JPEG", ".jpeg", ".gif", ".GIF", ".bmp"] # 图片类型 class Ui_photoshower(QMainWindow_new): # 路径 Path = '' # 播放间隔.单位:s Interval = 0.3 # 当前照片计数 Index = 0 img = None scaled_img = None s_width_up = 0 # 记录变化 s_heigh_up = 0 s_width_down = 0 s_heigh_down = 0 scaled_img_width = 0 # 记录高宽 scaled_img_height = 0 count_all = 0 # 记录总数 count = 0 # 记录已经读取了多少张照片 flag_bar = False datasets_train = None datasets_val = None datasets_test = None def __init__(self): super(Ui_photoshower, self).__init__() self.setupUi(self) def setupUi(self, photoshower): font = QtGui.QFont() font.setPixelSize(26) font.setBold(True) # ———————————————————————————————————————————————————————————— label_backdrop = QLabel(self) label_backdrop.resize(1500, 865) label_backdrop.setStyleSheet("background-color: rgb(240, 250, 250);") label_title = QLabel(self) label_title.resize(1500, 50) label_title.setText(" 数据集查看") label_title.setFont(QtGui.QFont("Adobe 黑体 Std R", 16)) label_title.setStyleSheet("background-color: rgb(50, 200, 200);") label_T = QLabel(self) label_T.resize(40, 40) label_T.move(5, 5) label_T.setPixmap(QPixmap(r"ui\label.jpg").scaled(label_T.size(), Qt.KeepAspectRatio, Qt.SmoothTransformation)) button_close = QPushButton(self) button_close.setStyleSheet("QPushButton {border: none;}") button_close.setIcon(QIcon(r"ui\close.png")) button_close.resize(50, 50) button_close.move(1430, 0) button_close.clicked.connect(self.close) button_min = QPushButton(self) button_min.setStyleSheet("QPushButton {border: none;}") button_min.setIcon(QIcon(r"ui\min.png")) button_min.resize(50, 50) button_min.move(1380, 0) button_min.clicked.connect(self.showMinimized) # ———————————————————————————————————————————————————————————— photoshower.setObjectName("photoshower") photoshower.resize(1500, 865) photoshower.setMinimumSize(QtCore.QSize(1480, 865)) photoshower.setMaximumSize(QtCore.QSize(1480, 865)) self.p_page_groupBox = QtWidgets.QGroupBox(photoshower) self.p_page_groupBox.setGeometry(QtCore.QRect(0, 50, 1500, 815)) self.p_page_groupBox.setObjectName("p_page_groupBox") self.p_fuction_groupBox = QtWidgets.QGroupBox(self.p_page_groupBox) self.p_fuction_groupBox.setMinimumSize(QtCore.QSize(200, 0)) self.p_fuction_groupBox.setObjectName("p_fuction_groupBox") # ———————————————————————————————————————————————————————————— sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.p_fuction_groupBox.sizePolicy().hasHeightForWidth()) self.p_fuction_groupBox.setSizePolicy(sizePolicy) # ———————————————————————————————————————————————————————————— self.layoutWidget = QtWidgets.QWidget(self.p_fuction_groupBox) self.layoutWidget.setGeometry(QtCore.QRect(1320, 30, 130, 720)) self.layoutWidget.setObjectName("layoutWidget") self.verticalLayout = QtWidgets.QVBoxLayout(self.p_page_groupBox) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.layoutWidget) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") # ———————————————————————————————————————————————————————————— self.p_horizontalLayout_1 = QtWidgets.QHBoxLayout() self.p_horizontalLayout_1.setObjectName("p_horizontalLayout_1") self.p_horizontalLayout_2 = QtWidgets.QHBoxLayout() self.p_horizontalLayout_2.setSpacing(0) self.p_horizontalLayout_2.setObjectName("p_horizontalLayout_2") # ———————————————————————————————————————————————————————————— self.p_choosing_photo_label = QtWidgets.QLabel(self.p_fuction_groupBox) self.p_choosing_photo_label.setGeometry(QtCore.QRect(10, 750, 200, 30)) self.p_choosing_photo_label.setFont(font) self.p_choosing_photo_label.setObjectName("p_choosing_photo_label") # ———————————————————————————————————————————————————————————— self.p_photo_list_listwidget = QtWidgets.QListWidget(self.p_fuction_groupBox) self.p_photo_list_listwidget.setGeometry(QtCore.QRect(10, 60, 261, 651)) self.p_photo_list_listwidget.setObjectName("p_photo_list_listwidget") # ———————————————————————————————————————————————————————————— self.p_groupbox = QtWidgets.QGroupBox(self.p_fuction_groupBox) self.p_groupbox.setGeometry(QtCore.QRect(280, 50, 1031, 661)) self.p_groupbox.setFont(font) self.p_groupbox.setAlignment(QtCore.Qt.AlignCenter) self.p_groupbox.setObjectName("p_groupbox") # ———————————————————————————————————————————————————————————— self.p_show_photo_lable = QtWidgets.QLabel(self.p_groupbox) self.p_show_photo_lable.setStyleSheet("background-color: rgb(0, 0, 0);") self.p_show_photo_lable.setGeometry(QtCore.QRect(-90, 40, 1201, 601)) self.p_show_photo_lable.setObjectName("p_show_photo_lable") # ———————————————————————————————————————————————————————————— self.p_look_train_button = QtWidgets.QPushButton(self.layoutWidget) self.p_look_train_button.setFont(font) self.p_look_train_button.setObjectName("p_opening_photofile_button") self.verticalLayout_2.addWidget(self.p_look_train_button) # ———————————————————————————————————————————————————————————— self.p_look_val_button = QtWidgets.QPushButton(self.layoutWidget) self.p_look_val_button.setFont(font) self.p_look_val_button.setObjectName("p_opening_photo_button") self.verticalLayout_2.addWidget(self.p_look_val_button) # ———————————————————————————————————————————————————————————— self.p_look_test_button = QtWidgets.QPushButton(self.layoutWidget) self.p_look_test_button.setFont(font) self.p_look_test_button.setObjectName("p_opening_photo_button") self.verticalLayout_2.addWidget(self.p_look_test_button) # ———————————————————————————————————————————————————————————— self.p_upphoto_button = QtWidgets.QPushButton(self.layoutWidget) self.p_upphoto_button.setFont(font) self.p_upphoto_button.setObjectName("p_upphoto_button") self.verticalLayout_2.addWidget(self.p_upphoto_button) # ———————————————————————————————————————————————————————————— self.p_downphoto_button = QtWidgets.QPushButton(self.layoutWidget) self.p_downphoto_button.setFont(font) self.p_downphoto_button.setObjectName("p_downphoto_button") self.verticalLayout_2.addWidget(self.p_downphoto_button) # ———————————————————————————————————————————————————————————— self.p_auto_show_button = QtWidgets.QPushButton(self.layoutWidget) self.p_auto_show_button.setFont(font) self.p_auto_show_button.setObjectName("p_auto_show_button") self.verticalLayout_2.addWidget(self.p_auto_show_button) # ———————————————————————————————————————————————————————————— self.p_end_auto_show_button = QtWidgets.QPushButton(self.layoutWidget) self.p_end_auto_show_button.setFont(font) self.p_end_auto_show_button.setObjectName("p_end_auto_show_button") self.verticalLayout_2.addWidget(self.p_end_auto_show_button) # ———————————————————————————————————————————————————————————— self.p_little_button = QtWidgets.QPushButton(self.layoutWidget) self.p_little_button.setFont(font) self.p_little_button.setObjectName("p_little_button") self.verticalLayout_2.addWidget(self.p_little_button) # ———————————————————————————————————————————————————————————— self.p_big_button = QtWidgets.QPushButton(self.layoutWidget) self.p_big_button.setFont(font) self.p_big_button.setObjectName("p_big_button") self.verticalLayout_2.addWidget(self.p_big_button) # ———————————————————————————————————————————————————————————— self.p_photo_rode_label = QtWidgets.QLabel(self.p_fuction_groupBox) self.p_photo_rode_label.setGeometry(QtCore.QRect(180, 750, 650, 30)) # 路径 self.p_photo_rode_label.setFont(font) self.p_photo_rode_label.setText("图片路径") self.p_photo_rode_label.setObjectName("p_photo_rode_label") # ———————————————————————————————————————————————————————————— self.p_show_photo_name_label = QtWidgets.QLabel(self.p_fuction_groupBox) self.p_show_photo_name_label.setAlignment(Qt.AlignCenter) self.p_show_photo_name_label.setGeometry(QtCore.QRect(647, 710, 300, 30)) self.p_show_photo_name_label.setFont(font) self.p_show_photo_name_label.setObjectName("p_show_photo_name_label") # ———————————————————————————————————————————————————————————— self.p_bar_label = QtWidgets.QLabel(self.p_fuction_groupBox) self.p_bar_label.setGeometry(QtCore.QRect(900, 750, 250, 30)) self.p_bar_label.setFont(font) self.p_bar_label.setObjectName("p_bar_label") # ———————————————————————————————————————————————————————————— self.p_read_progressBar = QtWidgets.QProgressBar(self.p_fuction_groupBox) self.p_read_progressBar.setGeometry(QtCore.QRect(1100, 750, 360, 30)) self.p_read_progressBar.setProperty("value", 0) self.p_read_progressBar.setObjectName("p_read_progressBar") self.p_horizontalLayout_1.addWidget(self.p_fuction_groupBox) self.verticalLayout.addLayout(self.p_horizontalLayout_1) self.con() self.retranslateUi(photoshower) QtCore.QMetaObject.connectSlotsByName(photoshower) def retranslateUi(self, photoshower): _translate = QtCore.QCoreApplication.translate photoshower.setWindowTitle(_translate("photoshower", "查看数据集")) self.p_choosing_photo_label.setText(_translate("photoshower", "选择的图片集:")) self.p_groupbox.setTitle(_translate("photoshower", "图片显示")) self.p_look_train_button.setText(_translate("photoshower", "训 练 集")) self.p_look_val_button.setText(_translate("photoshower", "验 证 集")) self.p_look_test_button.setText(_translate("photoshower", "测 试 集")) self.p_upphoto_button.setText(_translate("photoshower", "上 一 张")) self.p_downphoto_button.setText(_translate("photoshower", "下 一 张")) self.p_auto_show_button.setText(_translate("photoshower", "自动播放")) self.p_end_auto_show_button.setText(_translate("photoshower", "退出播放")) self.p_little_button.setText(_translate("photoshower", "缩小图片")) self.p_big_button.setText(_translate("photoshower", "放大图片")) self.p_show_photo_name_label.setText(_translate("photoshower", "图片名称")) self.p_bar_label.setText(_translate("photoshower", "图片集读取进度:")) # self.p_photo_rode_label.setAlignment(Qt.AlignCenter) # 初始化禁用组件,避免误操作 self.p_upphoto_button.setDisabled(True) self.p_downphoto_button.setDisabled(True) self.p_auto_show_button.setDisabled(True) self.p_end_auto_show_button.setDisabled(True) self.p_big_button.setDisabled(True) self.p_little_button.setDisabled(True) # 解锁 def unlock(self): self.p_upphoto_button.setDisabled(False) self.p_downphoto_button.setDisabled(False) self.p_auto_show_button.setDisabled(False) self.p_big_button.setDisabled(False) self.p_little_button.setDisabled(False) # 图片名字 def show_photo_name(self): font = QtGui.QFont() font.setFamily("Adobe 黑体 Std R") font.setPixelSize(21) font.setBold(True) self.p_show_photo_name_label.setFont(font) self.p_show_photo_name_label.setAlignment(Qt.AlignCenter) self.p_show_photo_name_label.setText(self.img_paths_short[self.currentImgIdx]) def get_all_photo(self): #获得总数 for root, dirs, files in os.walk(self.Path): for file in files: ext = os.path.splitext(file)[-1].lower() if ext in l_photo_point: self.count_all += 1 return self.count_all def photo_read_bar(self): #进度条 file_list = os.listdir(self.Path) self.count_all = 0 self.count_all = self.get_all_photo() self.p_read_progressBar.setMaximum(self.count_all) self.flag_bar = True self.count = 0 while self.flag_bar: # 使用 with 语句创建一个进度条 for img_path in self.img_paths: if os.path.isfile(img_path): img_name = os.path.basename(img_path) item = QListWidgetItem(QIcon(img_path), img_name) self.p_photo_list_listwidget.setFlow(QListView.Flow(1)) # 0: left to right,1: top to bottom self.p_photo_list_listwidget.setIconSize(QSize(150, 100)) self.p_photo_list_listwidget.addItem(item) self.count += 1 self.p_read_progressBar.setValue(self.count) # qt的进度条 if self.count == self.count_all: #写入完成 break break def get_zoom_scale(self, image_height, image_width, label_height, label_width): # 获得比例 zoom_scale = 1 width_pus = image_width / label_width height_pus = image_height / label_height zoom_scale = max(width_pus, height_pus) return zoom_scale # 打开文件夹 def imgs_position(self,dir=None): self.p_photo_list_listwidget.clear() self.p_show_photo_lable.clear() self.p_show_photo_name_label.clear() self.p_upphoto_button.setDisabled(True) self.p_downphoto_button.setDisabled(True) self.p_auto_show_button.setDisabled(True) self.p_big_button.setDisabled(True) self.p_little_button.setDisabled(True) if dir=="train": directory = self.datasets_train elif dir=="val": directory = self.datasets_val elif dir=="test": directory = self.datasets_test else: directory = QFileDialog.getExistingDirectory(self, "选取文件夹", "./") # 起始路径 try: if directory != None: self.p_photo_list_listwidget.clear() self.p_show_photo_name_label.clear() self.flag_photo = False font = QtGui.QFont() font.setFamily("Adobe 黑体 Std R") font.setPixelSize(21) font.setBold(True) self.p_photo_rode_label.setFont(font) self.p_photo_rode_label.setText(str(directory)) filenames = os.listdir(directory) self.Path = os.path.join(directory) self.img_paths = [] self.img_paths_short = [] # 显示第几张图片 for file in filenames: if file[-3:] in l_photo: self.img_paths.append(os.path.join(directory, file)) self.img_paths_short.append(file) if len(self.img_paths) == 0: self.p_show_photo_name_label.clear() self.p_photo_rode_label.clear() QMessageBox.warning(self, "警告!", "读取的文件夹无所展示的图片类型") # 显示设置listWidget self.photo_read_bar() #进度条展示 self.p_photo_list_listwidget.setCurrentRow(0) # 初始化图片位置 else: QMessageBox.warning(self, "警告!", "读取的文件夹不存在或未选择文件夹路径") self.p_photo_rode_label.clear() except TypeError: QMessageBox.warning(self, "警告!", "信息读取失败") self.p_photo_rode_label.clear() # 加载文件夹里面的图片 def loadImage(self): self.unlock() # 解锁 self.currentImgIdx = self.p_photo_list_listwidget.currentIndex().row() if self.currentImgIdx in range(len(self.img_paths)): # self.show_photo.setScaledContents(False) # 防止失真 self.img = QPixmap(self.img_paths[self.currentImgIdx]) self.scaled_img = self.img if self.scaled_img: zoom_scale = self.get_zoom_scale(self.scaled_img.height(), self.scaled_img.width(),self.p_show_photo_lable.height(), self.p_show_photo_lable.width()) if self.scaled_img.width() <= self.p_show_photo_lable.width() and self.scaled_img.height() <= self.p_show_photo_lable.height(): currentImg = QtGui.QPixmap(self.img_paths[self.currentImgIdx]).scaled(self.scaled_img.width(),self.scaled_img.height()) else: currentImg = QtGui.QPixmap(self.img_paths[self.currentImgIdx]).scaled( self.scaled_img.width() // zoom_scale, self.scaled_img.height() // zoom_scale) self.p_show_photo_lable.setPixmap(currentImg) self.p_show_photo_lable.setAlignment(Qt.AlignCenter) self.show_photo_name() # 查看上一张 def lastimg(self): self.p_end_auto_show_button.setDisabled(True) self.s_width = 0 self.s_heigh = 0 self.currentImgIdx = self.currentImgIdx - 1 if self.currentImgIdx < 0: # 查看上一张时不循环查看 self.currentImgIdx = self.currentImgIdx + 1 QMessageBox.warning(self, "警告!", "无上一张图片") else: self.p_photo_list_listwidget.setCurrentRow(self.currentImgIdx) if self.currentImgIdx in range(len(self.img_paths)): self.p_show_photo_lable.setScaledContents(False) self.img = QPixmap(self.img_paths[self.currentImgIdx]) self.scaled_img = self.img if self.scaled_img: zoom_scale = self.get_zoom_scale(self.scaled_img.height(), self.scaled_img.width(),self.p_show_photo_lable.height(), self.p_show_photo_lable.width()) if self.scaled_img.width() <= self.p_show_photo_lable.width() and self.scaled_img.height() <= self.p_show_photo_lable.height(): currentImg = QtGui.QPixmap(self.img_paths[self.currentImgIdx]).scaled(self.scaled_img.width(),self.scaled_img.height()) else: currentImg = QtGui.QPixmap(self.img_paths[self.currentImgIdx]).scaled(self.scaled_img.width() // zoom_scale,self.scaled_img.height() // zoom_scale) self.p_show_photo_lable.setPixmap(currentImg) self.p_show_photo_lable.setAlignment(Qt.AlignCenter) self.show_photo_name() # 查看下一张 def nextimg(self): self.s_width = 0 self.s_heigh = 0 self.currentImgIdx = self.currentImgIdx + 1 if self.currentImgIdx > len(self.img_paths) - 1: self.currentImgIdx = self.currentImgIdx - 1 QMessageBox.warning(self, "警告!", "无下一张图片") else: self.p_photo_list_listwidget.setCurrentRow(self.currentImgIdx) # 设置listWidget if self.currentImgIdx in range(len(self.img_paths)): self.p_show_photo_lable.setScaledContents(False) self.img = QPixmap(self.img_paths[self.currentImgIdx]) self.scaled_img = self.img if self.scaled_img: zoom_scale = self.get_zoom_scale(self.scaled_img.height(), self.scaled_img.width(),self.p_show_photo_lable.height(), self.p_show_photo_lable.width()) if self.scaled_img.width() <= self.p_show_photo_lable.width() and self.scaled_img.height() <= self.p_show_photo_lable.height(): currentImg = QtGui.QPixmap(self.img_paths[self.currentImgIdx]).scaled(self.scaled_img.width(),self.scaled_img.height()) else: currentImg = QtGui.QPixmap(self.img_paths[self.currentImgIdx]).scaled( self.scaled_img.width() // zoom_scale, self.scaled_img.height() // zoom_scale) self.p_show_photo_lable.setPixmap(currentImg) self.p_show_photo_lable.setAlignment(Qt.AlignCenter) self.show_photo_name() return True return False # 放大 def amplify(self): self.p_show_photo_lable.setScaledContents(False) zoom_scale = self.get_zoom_scale(self.scaled_img.height(), self.scaled_img.width(),self.p_show_photo_lable.height(), self.p_show_photo_lable.width()) if self.scaled_img.width() <= self.p_show_photo_lable.width() and self.scaled_img.height() <= self.p_show_photo_lable.height(): self.scaled_img_width = self.scaled_img.width() + self.s_width_up self.scaled_img_height = self.scaled_img.height() + self.s_heigh_up if not self.flag_photo: currentImg = QtGui.QPixmap(self.img_paths[self.currentImgIdx]).scaled(self.scaled_img_width,self.scaled_img_height) else: currentImg = QtGui.QPixmap(self.img_paths[0]).scaled(self.scaled_img_width,self.scaled_img_height) self.s_width_up += 10 self.s_heigh_up += 10 else: self.scaled_img_width = self.scaled_img.width() // zoom_scale + self.s_width_up self.scaled_img_height = self.scaled_img.height() // zoom_scale + self.s_heigh_up if not self.flag_photo: currentImg = QtGui.QPixmap(self.img_paths[self.currentImgIdx]).scaled(self.scaled_img_width, self.scaled_img_height) else: currentImg = QtGui.QPixmap(self.img_paths[0]).scaled(self.scaled_img_width,self.scaled_img_height) if self.scaled_img.width() > self.scaled_img.height(): self.s_width_up += 10 self.s_heigh_up += 3 else: self.s_width_up += 3 self.s_heigh_up += 10 self.p_show_photo_lable.setPixmap(currentImg) self.p_show_photo_lable.setAlignment(Qt.AlignCenter) self.s_width_down = 0 self.s_heigh_down = 0 # 缩小 def shrink(self): self.p_show_photo_lable.setScaledContents(False) zoom_scale = self.get_zoom_scale(self.scaled_img.height(), self.scaled_img.width(),self.p_show_photo_lable.height(), self.p_show_photo_lable.width()) if self.scaled_img.width() <= self.p_show_photo_lable.width() and self.scaled_img.height() <= self.p_show_photo_lable.height(): self.scaled_img_width = self.scaled_img.width() - self.s_width_down self.scaled_img_height = self.scaled_img.height() - self.s_heigh_down if not self.flag_photo: currentImg = QtGui.QPixmap(self.img_paths[self.currentImgIdx]).scaled(self.scaled_img_width,self.scaled_img_height) else: currentImg = QtGui.QPixmap(self.img_paths[0]).scaled(self.scaled_img_width,self.scaled_img_height) self.s_width_down += 10 self.s_heigh_down += 10 else: self.scaled_img_width = self.scaled_img.width() // zoom_scale - self.s_width_down self.scaled_img_height = self.scaled_img.height() // zoom_scale - self.s_heigh_down if not self.flag_photo: currentImg = QtGui.QPixmap(self.img_paths[self.currentImgIdx]).scaled(self.scaled_img_width,self.scaled_img_height) else: currentImg = QtGui.QPixmap(self.img_paths[0]).scaled(self.scaled_img_width,self.scaled_img_height) if self.scaled_img.width() > self.scaled_img.height(): self.s_width_down += 10 self.s_heigh_down += 3 else: self.s_width_down += 3 self.s_heigh_down += 10 self.p_show_photo_lable.setPixmap(currentImg) self.p_show_photo_lable.setAlignment(Qt.AlignCenter) self.s_width_up = 0 self.s_heigh_up = 0 # 自动切换图片 def new_image_change(self): while self.flag: if self.currentImgIdx + 1 < len(self.img_paths): self.nextimg() else: self.end_img() time.sleep(self.Interval) # 开始自动切换图片 def start_img(self): self.p_look_train_button.setDisabled(True) self.p_look_val_button.setDisabled(True) self.p_look_test_button.setDisabled(True) self.p_upphoto_button.setDisabled(True) self.p_downphoto_button.setDisabled(True) self.p_auto_show_button.setDisabled(True) self.p_end_auto_show_button.setDisabled(False) # 解锁结束播放按钮 self.p_big_button.setDisabled(True) self.p_little_button.setDisabled(True) self.flag = True threading.Thread(target=self.new_image_change).start() # 结束自动切换图片 def end_img(self): self.flag = False self.currentImgIdx = self.p_photo_list_listwidget.currentIndex().row() self.p_look_train_button.setDisabled(False) self.p_look_val_button.setDisabled(False) self.p_look_test_button.setDisabled(False) self.p_upphoto_button.setDisabled(False) self.p_downphoto_button.setDisabled(False) self.p_auto_show_button.setDisabled(False) self.p_big_button.setDisabled(False) self.p_little_button.setDisabled(False) self.p_end_auto_show_button.setDisabled(True) # 禁用结束播放按钮 def con(self): self.p_photo_list_listwidget.itemSelectionChanged.connect(self.loadImage) self.p_look_train_button.clicked.connect(lambda :self.imgs_position(dir="train")) self.p_look_val_button.clicked.connect(lambda :self.imgs_position(dir="val")) self.p_look_test_button.clicked.connect(lambda :self.imgs_position(dir="test")) self.p_upphoto_button.clicked.connect(self.lastimg) self.p_downphoto_button.clicked.connect(self.nextimg) self.p_auto_show_button.clicked.connect(self.start_img) self.p_end_auto_show_button.clicked.connect(self.end_img) self.p_big_button.clicked.connect(self.amplify) self.p_little_button.clicked.connect(self.shrink) def setCenter(self): screen = QDesktopWidget().screenGeometry() size = self.geometry() self.move(int((screen.width() - size.width()) / 2), int((screen.height() - size.height()) / 2)) if __name__ =="__main__": QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) app = QApplication([]) s = Ui_photoshower() s.show() app.exec_() sys.exit()
2201_75373101/TargetSingleAndBinocularRanging
photoshower.py
Python
unknown
30,633
import sys from PyQt5.QtCore import Qt from PyQt5.QtWidgets import * from PyQt5.QtGui import * class QMainWindow_new(QMainWindow): def __init__(self, parent=None): super().__init__(parent) self.isDragging = False self.dragPos = None self.setWindowFlag(Qt.FramelessWindowHint) self.setWindowIcon(QIcon("./ui/label.jpg")) def mousePressEvent(self, event): if event.button() == Qt.LeftButton: self.isDragging = True self.dragPos = event.globalPos() - self.frameGeometry().topLeft() event.accept() self.setCursor(QCursor(Qt.OpenHandCursor)) def mouseMoveEvent(self, event): if self.isDragging: self.move(event.globalPos() - self.dragPos) event.accept() def mouseReleaseEvent(self, event): if self.isDragging and event.button() == Qt.LeftButton: self.isDragging = False self.setCursor(QCursor(Qt.ArrowCursor)) event.accept()
2201_75373101/TargetSingleAndBinocularRanging
test.py
Python
unknown
1,012
# Ultralytics YOLO 🚀, AGPL-3.0 license __version__ = "8.1.13" from ultralytics.data.explorer.explorer import Explorer from ultralytics.models import RTDETR, SAM, YOLO from ultralytics.models.fastsam import FastSAM from ultralytics.models.nas import NAS from ultralytics.utils import ASSETS, SETTINGS as settings from ultralytics.utils.checks import check_yolo as checks from ultralytics.utils.downloads import download __all__ = ( "__version__", "ASSETS", "YOLO", "NAS", "SAM", "FastSAM", "RTDETR", "checks", "download", "settings", "Explorer", )
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/__init__.py
Python
unknown
597
# Ultralytics YOLO 🚀, AGPL-3.0 license import contextlib import shutil import subprocess import sys from pathlib import Path from types import SimpleNamespace from typing import Dict, List, Union from ultralytics.utils import ( ASSETS, DEFAULT_CFG, DEFAULT_CFG_DICT, DEFAULT_CFG_PATH, LOGGER, RANK, ROOT, RUNS_DIR, SETTINGS, SETTINGS_YAML, TESTS_RUNNING, IterableSimpleNamespace, __version__, checks, colorstr, deprecation_warn, yaml_load, yaml_print, ) # Define valid tasks and modes MODES = "train", "val", "predict", "export", "track", "benchmark" TASKS = "detect", "segment", "classify", "pose", "obb" TASK2DATA = { "detect": "coco8.yaml", "segment": "coco8-seg.yaml", "classify": "imagenet10", "pose": "coco8-pose.yaml", "obb": "dota8.yaml", } TASK2MODEL = { "detect": "yolov8n.pt", "segment": "yolov8n-seg.pt", "classify": "yolov8n-cls.pt", "pose": "yolov8n-pose.pt", "obb": "yolov8n-obb.pt", } TASK2METRIC = { "detect": "metrics/mAP50-95(B)", "segment": "metrics/mAP50-95(M)", "classify": "metrics/accuracy_top1", "pose": "metrics/mAP50-95(P)", "obb": "metrics/mAP50-95(B)", } CLI_HELP_MSG = f""" Arguments received: {str(['yolo'] + sys.argv[1:])}. Ultralytics 'yolo' commands use the following syntax: yolo TASK MODE ARGS Where TASK (optional) is one of {TASKS} MODE (required) is one of {MODES} ARGS (optional) are any number of custom 'arg=value' pairs like 'imgsz=320' that override defaults. See all ARGS at https://docs.ultralytics.com/usage/cfg or with 'yolo cfg' 1. Train a detection model for 10 epochs with an initial learning_rate of 0.01 yolo train data=coco128.yaml model=yolov8n.pt epochs=10 lr0=0.01 2. Predict a YouTube video using a pretrained segmentation model at image size 320: yolo predict model=yolov8n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320 3. Val a pretrained detection model at batch-size 1 and image size 640: yolo val model=yolov8n.pt data=coco128.yaml batch=1 imgsz=640 4. Export a YOLOv8n classification model to ONNX format at image size 224 by 128 (no TASK required) yolo export model=yolov8n-cls.pt format=onnx imgsz=224,128 6. Explore your datasets using semantic search and SQL with a simple GUI powered by Ultralytics Explorer API yolo explorer 5. Run special commands: yolo help yolo checks yolo version yolo settings yolo copy-cfg yolo cfg Docs: https://docs.ultralytics.com Community: https://community.ultralytics.com GitHub: https://github.com/ultralytics/ultralytics """ # Define keys for arg type checks CFG_FLOAT_KEYS = "warmup_epochs", "box", "cls", "dfl", "degrees", "shear", "time" CFG_FRACTION_KEYS = ( "dropout", "iou", "lr0", "lrf", "momentum", "weight_decay", "warmup_momentum", "warmup_bias_lr", "label_smoothing", "hsv_h", "hsv_s", "hsv_v", "translate", "scale", "perspective", "flipud", "fliplr", "mosaic", "mixup", "copy_paste", "conf", "iou", "fraction", ) # fraction floats 0.0 - 1.0 CFG_INT_KEYS = ( "epochs", "patience", "batch", "workers", "seed", "close_mosaic", "mask_ratio", "max_det", "vid_stride", "line_width", "workspace", "nbs", "save_period", ) CFG_BOOL_KEYS = ( "save", "exist_ok", "verbose", "deterministic", "single_cls", "rect", "cos_lr", "overlap_mask", "val", "save_json", "save_hybrid", "half", "dnn", "plots", "show", "save_txt", "save_conf", "save_crop", "save_frames", "show_labels", "show_conf", "visualize", "augment", "agnostic_nms", "retina_masks", "show_boxes", "keras", "optimize", "int8", "dynamic", "simplify", "nms", "profile", "multi_scale", ) def cfg2dict(cfg): """ Convert a configuration object to a dictionary, whether it is a file path, a string, or a SimpleNamespace object. Args: cfg (str | Path | dict | SimpleNamespace): Configuration object to be converted to a dictionary. Returns: cfg (dict): Configuration object in dictionary format. """ if isinstance(cfg, (str, Path)): cfg = yaml_load(cfg) # load dict elif isinstance(cfg, SimpleNamespace): cfg = vars(cfg) # convert to dict return cfg def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, overrides: Dict = None): """ Load and merge configuration data from a file or dictionary. Args: cfg (str | Path | Dict | SimpleNamespace): Configuration data. overrides (str | Dict | optional): Overrides in the form of a file name or a dictionary. Default is None. Returns: (SimpleNamespace): Training arguments namespace. """ cfg = cfg2dict(cfg) # Merge overrides if overrides: overrides = cfg2dict(overrides) if "save_dir" not in cfg: overrides.pop("save_dir", None) # special override keys to ignore check_dict_alignment(cfg, overrides) cfg = {**cfg, **overrides} # merge cfg and overrides dicts (prefer overrides) # Special handling for numeric project/name for k in "project", "name": if k in cfg and isinstance(cfg[k], (int, float)): cfg[k] = str(cfg[k]) if cfg.get("name") == "model": # assign model to 'name' arg cfg["name"] = cfg.get("model", "").split(".")[0] LOGGER.warning(f"WARNING ⚠️ 'name=model' automatically updated to 'name={cfg['name']}'.") # Type and Value checks for k, v in cfg.items(): if v is not None: # None values may be from optional args if k in CFG_FLOAT_KEYS and not isinstance(v, (int, float)): raise TypeError( f"'{k}={v}' is of invalid type {type(v).__name__}. " f"Valid '{k}' types are int (i.e. '{k}=0') or float (i.e. '{k}=0.5')" ) elif k in CFG_FRACTION_KEYS: if not isinstance(v, (int, float)): raise TypeError( f"'{k}={v}' is of invalid type {type(v).__name__}. " f"Valid '{k}' types are int (i.e. '{k}=0') or float (i.e. '{k}=0.5')" ) if not (0.0 <= v <= 1.0): raise ValueError(f"'{k}={v}' is an invalid value. " f"Valid '{k}' values are between 0.0 and 1.0.") elif k in CFG_INT_KEYS and not isinstance(v, int): raise TypeError( f"'{k}={v}' is of invalid type {type(v).__name__}. " f"'{k}' must be an int (i.e. '{k}=8')" ) elif k in CFG_BOOL_KEYS and not isinstance(v, bool): raise TypeError( f"'{k}={v}' is of invalid type {type(v).__name__}. " f"'{k}' must be a bool (i.e. '{k}=True' or '{k}=False')" ) # Return instance return IterableSimpleNamespace(**cfg) def get_save_dir(args, name=None): """Return save_dir as created from train/val/predict arguments.""" if getattr(args, "save_dir", None): save_dir = args.save_dir else: from ultralytics.utils.files import increment_path project = args.project or (ROOT.parent / "tests/tmp/runs" if TESTS_RUNNING else RUNS_DIR) / args.task name = name or args.name or f"{args.mode}" save_dir = increment_path(Path(project) / name, exist_ok=args.exist_ok if RANK in (-1, 0) else True) return Path(save_dir) def _handle_deprecation(custom): """Hardcoded function to handle deprecated config keys.""" for key in custom.copy().keys(): if key == "boxes": deprecation_warn(key, "show_boxes") custom["show_boxes"] = custom.pop("boxes") if key == "hide_labels": deprecation_warn(key, "show_labels") custom["show_labels"] = custom.pop("hide_labels") == "False" if key == "hide_conf": deprecation_warn(key, "show_conf") custom["show_conf"] = custom.pop("hide_conf") == "False" if key == "line_thickness": deprecation_warn(key, "line_width") custom["line_width"] = custom.pop("line_thickness") return custom def check_dict_alignment(base: Dict, custom: Dict, e=None): """ This function checks for any mismatched keys between a custom configuration list and a base configuration list. If any mismatched keys are found, the function prints out similar keys from the base list and exits the program. Args: custom (dict): a dictionary of custom configuration options base (dict): a dictionary of base configuration options e (Error, optional): An optional error that is passed by the calling function. """ custom = _handle_deprecation(custom) base_keys, custom_keys = (set(x.keys()) for x in (base, custom)) mismatched = [k for k in custom_keys if k not in base_keys] if mismatched: from difflib import get_close_matches string = "" for x in mismatched: matches = get_close_matches(x, base_keys) # key list matches = [f"{k}={base[k]}" if base.get(k) is not None else k for k in matches] match_str = f"Similar arguments are i.e. {matches}." if matches else "" string += f"'{colorstr('red', 'bold', x)}' is not a valid YOLO argument. {match_str}\n" raise SyntaxError(string + CLI_HELP_MSG) from e def merge_equals_args(args: List[str]) -> List[str]: """ Merges arguments around isolated '=' args in a list of strings. The function considers cases where the first argument ends with '=' or the second starts with '=', as well as when the middle one is an equals sign. Args: args (List[str]): A list of strings where each element is an argument. Returns: (List[str]): A list of strings where the arguments around isolated '=' are merged. """ new_args = [] for i, arg in enumerate(args): if arg == "=" and 0 < i < len(args) - 1: # merge ['arg', '=', 'val'] new_args[-1] += f"={args[i + 1]}" del args[i + 1] elif arg.endswith("=") and i < len(args) - 1 and "=" not in args[i + 1]: # merge ['arg=', 'val'] new_args.append(f"{arg}{args[i + 1]}") del args[i + 1] elif arg.startswith("=") and i > 0: # merge ['arg', '=val'] new_args[-1] += arg else: new_args.append(arg) return new_args def handle_yolo_hub(args: List[str]) -> None: """ Handle Ultralytics HUB command-line interface (CLI) commands. This function processes Ultralytics HUB CLI commands such as login and logout. It should be called when executing a script with arguments related to HUB authentication. Args: args (List[str]): A list of command line arguments Example: ```bash python my_script.py hub login your_api_key ``` """ from ultralytics import hub if args[0] == "login": key = args[1] if len(args) > 1 else "" # Log in to Ultralytics HUB using the provided API key hub.login(key) elif args[0] == "logout": # Log out from Ultralytics HUB hub.logout() def handle_yolo_settings(args: List[str]) -> None: """ Handle YOLO settings command-line interface (CLI) commands. This function processes YOLO settings CLI commands such as reset. It should be called when executing a script with arguments related to YOLO settings management. Args: args (List[str]): A list of command line arguments for YOLO settings management. Example: ```bash python my_script.py yolo settings reset ``` """ url = "https://docs.ultralytics.com/quickstart/#ultralytics-settings" # help URL try: if any(args): if args[0] == "reset": SETTINGS_YAML.unlink() # delete the settings file SETTINGS.reset() # create new settings LOGGER.info("Settings reset successfully") # inform the user that settings have been reset else: # save a new setting new = dict(parse_key_value_pair(a) for a in args) check_dict_alignment(SETTINGS, new) SETTINGS.update(new) LOGGER.info(f"💡 Learn about settings at {url}") yaml_print(SETTINGS_YAML) # print the current settings except Exception as e: LOGGER.warning(f"WARNING ⚠️ settings error: '{e}'. Please see {url} for help.") def handle_explorer(): """Open the Ultralytics Explorer GUI.""" checks.check_requirements("streamlit") LOGGER.info(f"💡 Loading Explorer dashboard...") subprocess.run(["streamlit", "run", ROOT / "data/explorer/gui/dash.py", "--server.maxMessageSize", "2048"]) def parse_key_value_pair(pair): """Parse one 'key=value' pair and return key and value.""" k, v = pair.split("=", 1) # split on first '=' sign k, v = k.strip(), v.strip() # remove spaces assert v, f"missing '{k}' value" return k, smart_value(v) def smart_value(v): """Convert a string to an underlying type such as int, float, bool, etc.""" v_lower = v.lower() if v_lower == "none": return None elif v_lower == "true": return True elif v_lower == "false": return False else: with contextlib.suppress(Exception): return eval(v) return v def entrypoint(debug=""): """ This function is the ultralytics package entrypoint, it's responsible for parsing the command line arguments passed to the package. This function allows for: - passing mandatory YOLO args as a list of strings - specifying the task to be performed, either 'detect', 'segment' or 'classify' - specifying the mode, either 'train', 'val', 'test', or 'predict' - running special modes like 'checks' - passing overrides to the package's configuration It uses the package's default cfg and initializes it using the passed overrides. Then it calls the CLI function with the composed cfg """ args = (debug.split(" ") if debug else sys.argv)[1:] if not args: # no arguments passed LOGGER.info(CLI_HELP_MSG) return special = { "help": lambda: LOGGER.info(CLI_HELP_MSG), "checks": checks.collect_system_info, "version": lambda: LOGGER.info(__version__), "settings": lambda: handle_yolo_settings(args[1:]), "cfg": lambda: yaml_print(DEFAULT_CFG_PATH), "hub": lambda: handle_yolo_hub(args[1:]), "login": lambda: handle_yolo_hub(args), "copy-cfg": copy_default_cfg, "explorer": lambda: handle_explorer(), } full_args_dict = {**DEFAULT_CFG_DICT, **{k: None for k in TASKS}, **{k: None for k in MODES}, **special} # Define common misuses of special commands, i.e. -h, -help, --help special.update({k[0]: v for k, v in special.items()}) # singular special.update({k[:-1]: v for k, v in special.items() if len(k) > 1 and k.endswith("s")}) # singular special = {**special, **{f"-{k}": v for k, v in special.items()}, **{f"--{k}": v for k, v in special.items()}} overrides = {} # basic overrides, i.e. imgsz=320 for a in merge_equals_args(args): # merge spaces around '=' sign if a.startswith("--"): LOGGER.warning(f"WARNING ⚠️ '{a}' does not require leading dashes '--', updating to '{a[2:]}'.") a = a[2:] if a.endswith(","): LOGGER.warning(f"WARNING ⚠️ '{a}' does not require trailing comma ',', updating to '{a[:-1]}'.") a = a[:-1] if "=" in a: try: k, v = parse_key_value_pair(a) if k == "cfg" and v is not None: # custom.yaml passed LOGGER.info(f"Overriding {DEFAULT_CFG_PATH} with {v}") overrides = {k: val for k, val in yaml_load(checks.check_yaml(v)).items() if k != "cfg"} else: overrides[k] = v except (NameError, SyntaxError, ValueError, AssertionError) as e: check_dict_alignment(full_args_dict, {a: ""}, e) elif a in TASKS: overrides["task"] = a elif a in MODES: overrides["mode"] = a elif a.lower() in special: special[a.lower()]() return elif a in DEFAULT_CFG_DICT and isinstance(DEFAULT_CFG_DICT[a], bool): overrides[a] = True # auto-True for default bool args, i.e. 'yolo show' sets show=True elif a in DEFAULT_CFG_DICT: raise SyntaxError( f"'{colorstr('red', 'bold', a)}' is a valid YOLO argument but is missing an '=' sign " f"to set its value, i.e. try '{a}={DEFAULT_CFG_DICT[a]}'\n{CLI_HELP_MSG}" ) else: check_dict_alignment(full_args_dict, {a: ""}) # Check keys check_dict_alignment(full_args_dict, overrides) # Mode mode = overrides.get("mode") if mode is None: mode = DEFAULT_CFG.mode or "predict" LOGGER.warning(f"WARNING ⚠️ 'mode' is missing. Valid modes are {MODES}. Using default 'mode={mode}'.") elif mode not in MODES: raise ValueError(f"Invalid 'mode={mode}'. Valid modes are {MODES}.\n{CLI_HELP_MSG}") # Task task = overrides.pop("task", None) if task: if task not in TASKS: raise ValueError(f"Invalid 'task={task}'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}") if "model" not in overrides: overrides["model"] = TASK2MODEL[task] # Model model = overrides.pop("model", DEFAULT_CFG.model) if model is None: model = "yolov8n.pt" LOGGER.warning(f"WARNING ⚠️ 'model' is missing. Using default 'model={model}'.") overrides["model"] = model stem = Path(model).stem.lower() if "rtdetr" in stem: # guess architecture from ultralytics import RTDETR model = RTDETR(model) # no task argument elif "fastsam" in stem: from ultralytics import FastSAM model = FastSAM(model) elif "sam" in stem: from ultralytics import SAM model = SAM(model) else: from ultralytics import YOLO model = YOLO(model, task=task) if isinstance(overrides.get("pretrained"), str): model.load(overrides["pretrained"]) # Task Update if task != model.task: if task: LOGGER.warning( f"WARNING ⚠️ conflicting 'task={task}' passed with 'task={model.task}' model. " f"Ignoring 'task={task}' and updating to 'task={model.task}' to match model." ) task = model.task # Mode if mode in ("predict", "track") and "source" not in overrides: overrides["source"] = DEFAULT_CFG.source or ASSETS LOGGER.warning(f"WARNING ⚠️ 'source' is missing. Using default 'source={overrides['source']}'.") elif mode in ("train", "val"): if "data" not in overrides and "resume" not in overrides: overrides["data"] = DEFAULT_CFG.data or TASK2DATA.get(task or DEFAULT_CFG.task, DEFAULT_CFG.data) LOGGER.warning(f"WARNING ⚠️ 'data' is missing. Using default 'data={overrides['data']}'.") elif mode == "export": if "format" not in overrides: overrides["format"] = DEFAULT_CFG.format or "torchscript" LOGGER.warning(f"WARNING ⚠️ 'format' is missing. Using default 'format={overrides['format']}'.") # Run command in python getattr(model, mode)(**overrides) # default args from model # Show help LOGGER.info(f"💡 Learn more at https://docs.ultralytics.com/modes/{mode}") # Special modes -------------------------------------------------------------------------------------------------------- def copy_default_cfg(): """Copy and create a new default configuration file with '_copy' appended to its name.""" new_file = Path.cwd() / DEFAULT_CFG_PATH.name.replace(".yaml", "_copy.yaml") shutil.copy2(DEFAULT_CFG_PATH, new_file) LOGGER.info( f"{DEFAULT_CFG_PATH} copied to {new_file}\n" f"Example YOLO command with this new custom cfg:\n yolo cfg='{new_file}' imgsz=320 batch=8" ) if __name__ == "__main__": # Example: entrypoint(debug='yolo predict model=yolov8n.pt') entrypoint(debug="")
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/cfg/__init__.py
Python
unknown
20,768
# Ultralytics YOLO 🚀, AGPL-3.0 license from .base import BaseDataset from .build import build_dataloader, build_yolo_dataset, load_inference_source from .dataset import ClassificationDataset, SemanticDataset, YOLODataset __all__ = ( "BaseDataset", "ClassificationDataset", "SemanticDataset", "YOLODataset", "build_yolo_dataset", "build_dataloader", "load_inference_source", )
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/__init__.py
Python
unknown
409
# Ultralytics YOLO 🚀, AGPL-3.0 license from pathlib import Path from ultralytics import SAM, YOLO def auto_annotate(data, det_model="yolov8x.pt", sam_model="sam_b.pt", device="", output_dir=None): """ Automatically annotates images using a YOLO object detection model and a SAM segmentation model. Args: data (str): Path to a folder containing images to be annotated. det_model (str, optional): Pre-trained YOLO detection model. Defaults to 'yolov8x.pt'. sam_model (str, optional): Pre-trained SAM segmentation model. Defaults to 'sam_b.pt'. device (str, optional): Device to run the models on. Defaults to an empty string (CPU or GPU, if available). output_dir (str | None | optional): Directory to save the annotated results. Defaults to a 'labels' folder in the same directory as 'data'. Example: ```python from ultralytics.data.annotator import auto_annotate auto_annotate(data='ultralytics/assets', det_model='yolov8n.pt', sam_model='mobile_sam.pt') ``` """ det_model = YOLO(det_model) sam_model = SAM(sam_model) data = Path(data) if not output_dir: output_dir = data.parent / f"{data.stem}_auto_annotate_labels" Path(output_dir).mkdir(exist_ok=True, parents=True) det_results = det_model(data, stream=True, device=device) for result in det_results: class_ids = result.boxes.cls.int().tolist() # noqa if len(class_ids): boxes = result.boxes.xyxy # Boxes object for bbox outputs sam_results = sam_model(result.orig_img, bboxes=boxes, verbose=False, save=False, device=device) segments = sam_results[0].masks.xyn # noqa with open(f"{Path(output_dir) / Path(result.path).stem}.txt", "w") as f: for i in range(len(segments)): s = segments[i] if len(s) == 0: continue segment = map(str, segments[i].reshape(-1).tolist()) f.write(f"{class_ids[i]} " + " ".join(segment) + "\n")
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/annotator.py
Python
unknown
2,117
# Ultralytics YOLO 🚀, AGPL-3.0 license import math import random from copy import deepcopy import cv2 import numpy as np import torch import torchvision.transforms as T from ultralytics.utils import LOGGER, colorstr from ultralytics.utils.checks import check_version from ultralytics.utils.instance import Instances from ultralytics.utils.metrics import bbox_ioa from ultralytics.utils.ops import segment2box, xyxyxyxy2xywhr from ultralytics.utils.torch_utils import TORCHVISION_0_10, TORCHVISION_0_11, TORCHVISION_0_13 from .utils import polygons2masks, polygons2masks_overlap DEFAULT_MEAN = (0.0, 0.0, 0.0) DEFAULT_STD = (1.0, 1.0, 1.0) DEFAULT_CROP_FTACTION = 1.0 # TODO: we might need a BaseTransform to make all these augments be compatible with both classification and semantic class BaseTransform: """ Base class for image transformations. This is a generic transformation class that can be extended for specific image processing needs. The class is designed to be compatible with both classification and semantic segmentation tasks. Methods: __init__: Initializes the BaseTransform object. apply_image: Applies image transformation to labels. apply_instances: Applies transformations to object instances in labels. apply_semantic: Applies semantic segmentation to an image. __call__: Applies all label transformations to an image, instances, and semantic masks. """ def __init__(self) -> None: """Initializes the BaseTransform object.""" pass def apply_image(self, labels): """Applies image transformations to labels.""" pass def apply_instances(self, labels): """Applies transformations to object instances in labels.""" pass def apply_semantic(self, labels): """Applies semantic segmentation to an image.""" pass def __call__(self, labels): """Applies all label transformations to an image, instances, and semantic masks.""" self.apply_image(labels) self.apply_instances(labels) self.apply_semantic(labels) class Compose: """Class for composing multiple image transformations.""" def __init__(self, transforms): """Initializes the Compose object with a list of transforms.""" self.transforms = transforms def __call__(self, data): """Applies a series of transformations to input data.""" for t in self.transforms: data = t(data) return data def append(self, transform): """Appends a new transform to the existing list of transforms.""" self.transforms.append(transform) def tolist(self): """Converts the list of transforms to a standard Python list.""" return self.transforms def __repr__(self): """Returns a string representation of the object.""" return f"{self.__class__.__name__}({', '.join([f'{t}' for t in self.transforms])})" class BaseMixTransform: """ Class for base mix (MixUp/Mosaic) transformations. This implementation is from mmyolo. """ def __init__(self, dataset, pre_transform=None, p=0.0) -> None: """Initializes the BaseMixTransform object with dataset, pre_transform, and probability.""" self.dataset = dataset self.pre_transform = pre_transform self.p = p def __call__(self, labels): """Applies pre-processing transforms and mixup/mosaic transforms to labels data.""" if random.uniform(0, 1) > self.p: return labels # Get index of one or three other images indexes = self.get_indexes() if isinstance(indexes, int): indexes = [indexes] # Get images information will be used for Mosaic or MixUp mix_labels = [self.dataset.get_image_and_label(i) for i in indexes] if self.pre_transform is not None: for i, data in enumerate(mix_labels): mix_labels[i] = self.pre_transform(data) labels["mix_labels"] = mix_labels # Mosaic or MixUp labels = self._mix_transform(labels) labels.pop("mix_labels", None) return labels def _mix_transform(self, labels): """Applies MixUp or Mosaic augmentation to the label dictionary.""" raise NotImplementedError def get_indexes(self): """Gets a list of shuffled indexes for mosaic augmentation.""" raise NotImplementedError class Mosaic(BaseMixTransform): """ Mosaic augmentation. This class performs mosaic augmentation by combining multiple (4 or 9) images into a single mosaic image. The augmentation is applied to a dataset with a given probability. Attributes: dataset: The dataset on which the mosaic augmentation is applied. imgsz (int, optional): Image size (height and width) after mosaic pipeline of a single image. Default to 640. p (float, optional): Probability of applying the mosaic augmentation. Must be in the range 0-1. Default to 1.0. n (int, optional): The grid size, either 4 (for 2x2) or 9 (for 3x3). """ def __init__(self, dataset, imgsz=640, p=1.0, n=4): """Initializes the object with a dataset, image size, probability, and border.""" assert 0 <= p <= 1.0, f"The probability should be in range [0, 1], but got {p}." assert n in (4, 9), "grid must be equal to 4 or 9." super().__init__(dataset=dataset, p=p) self.dataset = dataset self.imgsz = imgsz self.border = (-imgsz // 2, -imgsz // 2) # width, height self.n = n def get_indexes(self, buffer=True): """Return a list of random indexes from the dataset.""" if buffer: # select images from buffer return random.choices(list(self.dataset.buffer), k=self.n - 1) else: # select any images return [random.randint(0, len(self.dataset) - 1) for _ in range(self.n - 1)] def _mix_transform(self, labels): """Apply mixup transformation to the input image and labels.""" assert labels.get("rect_shape", None) is None, "rect and mosaic are mutually exclusive." assert len(labels.get("mix_labels", [])), "There are no other images for mosaic augment." return ( self._mosaic3(labels) if self.n == 3 else self._mosaic4(labels) if self.n == 4 else self._mosaic9(labels) ) # This code is modified for mosaic3 method. def _mosaic3(self, labels): """Create a 1x3 image mosaic.""" mosaic_labels = [] s = self.imgsz for i in range(3): labels_patch = labels if i == 0 else labels["mix_labels"][i - 1] # Load image img = labels_patch["img"] h, w = labels_patch.pop("resized_shape") # Place img in img3 if i == 0: # center img3 = np.full((s * 3, s * 3, img.shape[2]), 114, dtype=np.uint8) # base image with 3 tiles h0, w0 = h, w c = s, s, s + w, s + h # xmin, ymin, xmax, ymax (base) coordinates elif i == 1: # right c = s + w0, s, s + w0 + w, s + h elif i == 2: # left c = s - w, s + h0 - h, s, s + h0 padw, padh = c[:2] x1, y1, x2, y2 = (max(x, 0) for x in c) # allocate coords img3[y1:y2, x1:x2] = img[y1 - padh :, x1 - padw :] # img3[ymin:ymax, xmin:xmax] # hp, wp = h, w # height, width previous for next iteration # Labels assuming imgsz*2 mosaic size labels_patch = self._update_labels(labels_patch, padw + self.border[0], padh + self.border[1]) mosaic_labels.append(labels_patch) final_labels = self._cat_labels(mosaic_labels) final_labels["img"] = img3[-self.border[0] : self.border[0], -self.border[1] : self.border[1]] return final_labels def _mosaic4(self, labels): """Create a 2x2 image mosaic.""" mosaic_labels = [] s = self.imgsz yc, xc = (int(random.uniform(-x, 2 * s + x)) for x in self.border) # mosaic center x, y for i in range(4): labels_patch = labels if i == 0 else labels["mix_labels"][i - 1] # Load image img = labels_patch["img"] h, w = labels_patch.pop("resized_shape") # Place img in img4 if i == 0: # top left img4 = np.full((s * 2, s * 2, img.shape[2]), 114, dtype=np.uint8) # base image with 4 tiles x1a, y1a, x2a, y2a = max(xc - w, 0), max(yc - h, 0), xc, yc # xmin, ymin, xmax, ymax (large image) x1b, y1b, x2b, y2b = w - (x2a - x1a), h - (y2a - y1a), w, h # xmin, ymin, xmax, ymax (small image) elif i == 1: # top right x1a, y1a, x2a, y2a = xc, max(yc - h, 0), min(xc + w, s * 2), yc x1b, y1b, x2b, y2b = 0, h - (y2a - y1a), min(w, x2a - x1a), h elif i == 2: # bottom left x1a, y1a, x2a, y2a = max(xc - w, 0), yc, xc, min(s * 2, yc + h) x1b, y1b, x2b, y2b = w - (x2a - x1a), 0, w, min(y2a - y1a, h) elif i == 3: # bottom right x1a, y1a, x2a, y2a = xc, yc, min(xc + w, s * 2), min(s * 2, yc + h) x1b, y1b, x2b, y2b = 0, 0, min(w, x2a - x1a), min(y2a - y1a, h) img4[y1a:y2a, x1a:x2a] = img[y1b:y2b, x1b:x2b] # img4[ymin:ymax, xmin:xmax] padw = x1a - x1b padh = y1a - y1b labels_patch = self._update_labels(labels_patch, padw, padh) mosaic_labels.append(labels_patch) final_labels = self._cat_labels(mosaic_labels) final_labels["img"] = img4 return final_labels def _mosaic9(self, labels): """Create a 3x3 image mosaic.""" mosaic_labels = [] s = self.imgsz hp, wp = -1, -1 # height, width previous for i in range(9): labels_patch = labels if i == 0 else labels["mix_labels"][i - 1] # Load image img = labels_patch["img"] h, w = labels_patch.pop("resized_shape") # Place img in img9 if i == 0: # center img9 = np.full((s * 3, s * 3, img.shape[2]), 114, dtype=np.uint8) # base image with 4 tiles h0, w0 = h, w c = s, s, s + w, s + h # xmin, ymin, xmax, ymax (base) coordinates elif i == 1: # top c = s, s - h, s + w, s elif i == 2: # top right c = s + wp, s - h, s + wp + w, s elif i == 3: # right c = s + w0, s, s + w0 + w, s + h elif i == 4: # bottom right c = s + w0, s + hp, s + w0 + w, s + hp + h elif i == 5: # bottom c = s + w0 - w, s + h0, s + w0, s + h0 + h elif i == 6: # bottom left c = s + w0 - wp - w, s + h0, s + w0 - wp, s + h0 + h elif i == 7: # left c = s - w, s + h0 - h, s, s + h0 elif i == 8: # top left c = s - w, s + h0 - hp - h, s, s + h0 - hp padw, padh = c[:2] x1, y1, x2, y2 = (max(x, 0) for x in c) # allocate coords # Image img9[y1:y2, x1:x2] = img[y1 - padh :, x1 - padw :] # img9[ymin:ymax, xmin:xmax] hp, wp = h, w # height, width previous for next iteration # Labels assuming imgsz*2 mosaic size labels_patch = self._update_labels(labels_patch, padw + self.border[0], padh + self.border[1]) mosaic_labels.append(labels_patch) final_labels = self._cat_labels(mosaic_labels) final_labels["img"] = img9[-self.border[0] : self.border[0], -self.border[1] : self.border[1]] return final_labels @staticmethod def _update_labels(labels, padw, padh): """Update labels.""" nh, nw = labels["img"].shape[:2] labels["instances"].convert_bbox(format="xyxy") labels["instances"].denormalize(nw, nh) labels["instances"].add_padding(padw, padh) return labels def _cat_labels(self, mosaic_labels): """Return labels with mosaic border instances clipped.""" if len(mosaic_labels) == 0: return {} cls = [] instances = [] imgsz = self.imgsz * 2 # mosaic imgsz for labels in mosaic_labels: cls.append(labels["cls"]) instances.append(labels["instances"]) # Final labels final_labels = { "im_file": mosaic_labels[0]["im_file"], "ori_shape": mosaic_labels[0]["ori_shape"], "resized_shape": (imgsz, imgsz), "cls": np.concatenate(cls, 0), "instances": Instances.concatenate(instances, axis=0), "mosaic_border": self.border, } final_labels["instances"].clip(imgsz, imgsz) good = final_labels["instances"].remove_zero_area_boxes() final_labels["cls"] = final_labels["cls"][good] return final_labels class MixUp(BaseMixTransform): """Class for applying MixUp augmentation to the dataset.""" def __init__(self, dataset, pre_transform=None, p=0.0) -> None: """Initializes MixUp object with dataset, pre_transform, and probability of applying MixUp.""" super().__init__(dataset=dataset, pre_transform=pre_transform, p=p) def get_indexes(self): """Get a random index from the dataset.""" return random.randint(0, len(self.dataset) - 1) def _mix_transform(self, labels): """Applies MixUp augmentation as per https://arxiv.org/pdf/1710.09412.pdf.""" r = np.random.beta(32.0, 32.0) # mixup ratio, alpha=beta=32.0 labels2 = labels["mix_labels"][0] labels["img"] = (labels["img"] * r + labels2["img"] * (1 - r)).astype(np.uint8) labels["instances"] = Instances.concatenate([labels["instances"], labels2["instances"]], axis=0) labels["cls"] = np.concatenate([labels["cls"], labels2["cls"]], 0) return labels class RandomPerspective: """ Implements random perspective and affine transformations on images and corresponding bounding boxes, segments, and keypoints. These transformations include rotation, translation, scaling, and shearing. The class also offers the option to apply these transformations conditionally with a specified probability. Attributes: degrees (float): Degree range for random rotations. translate (float): Fraction of total width and height for random translation. scale (float): Scaling factor interval, e.g., a scale factor of 0.1 allows a resize between 90%-110%. shear (float): Shear intensity (angle in degrees). perspective (float): Perspective distortion factor. border (tuple): Tuple specifying mosaic border. pre_transform (callable): A function/transform to apply to the image before starting the random transformation. Methods: affine_transform(img, border): Applies a series of affine transformations to the image. apply_bboxes(bboxes, M): Transforms bounding boxes using the calculated affine matrix. apply_segments(segments, M): Transforms segments and generates new bounding boxes. apply_keypoints(keypoints, M): Transforms keypoints. __call__(labels): Main method to apply transformations to both images and their corresponding annotations. box_candidates(box1, box2): Filters out bounding boxes that don't meet certain criteria post-transformation. """ def __init__( self, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, border=(0, 0), pre_transform=None ): """Initializes RandomPerspective object with transformation parameters.""" self.degrees = degrees self.translate = translate self.scale = scale self.shear = shear self.perspective = perspective self.border = border # mosaic border self.pre_transform = pre_transform def affine_transform(self, img, border): """ Applies a sequence of affine transformations centered around the image center. Args: img (ndarray): Input image. border (tuple): Border dimensions. Returns: img (ndarray): Transformed image. M (ndarray): Transformation matrix. s (float): Scale factor. """ # Center C = np.eye(3, dtype=np.float32) C[0, 2] = -img.shape[1] / 2 # x translation (pixels) C[1, 2] = -img.shape[0] / 2 # y translation (pixels) # Perspective P = np.eye(3, dtype=np.float32) P[2, 0] = random.uniform(-self.perspective, self.perspective) # x perspective (about y) P[2, 1] = random.uniform(-self.perspective, self.perspective) # y perspective (about x) # Rotation and Scale R = np.eye(3, dtype=np.float32) a = random.uniform(-self.degrees, self.degrees) # a += random.choice([-180, -90, 0, 90]) # add 90deg rotations to small rotations s = random.uniform(1 - self.scale, 1 + self.scale) # s = 2 ** random.uniform(-scale, scale) R[:2] = cv2.getRotationMatrix2D(angle=a, center=(0, 0), scale=s) # Shear S = np.eye(3, dtype=np.float32) S[0, 1] = math.tan(random.uniform(-self.shear, self.shear) * math.pi / 180) # x shear (deg) S[1, 0] = math.tan(random.uniform(-self.shear, self.shear) * math.pi / 180) # y shear (deg) # Translation T = np.eye(3, dtype=np.float32) T[0, 2] = random.uniform(0.5 - self.translate, 0.5 + self.translate) * self.size[0] # x translation (pixels) T[1, 2] = random.uniform(0.5 - self.translate, 0.5 + self.translate) * self.size[1] # y translation (pixels) # Combined rotation matrix M = T @ S @ R @ P @ C # order of operations (right to left) is IMPORTANT # Affine image if (border[0] != 0) or (border[1] != 0) or (M != np.eye(3)).any(): # image changed if self.perspective: img = cv2.warpPerspective(img, M, dsize=self.size, borderValue=(114, 114, 114)) else: # affine img = cv2.warpAffine(img, M[:2], dsize=self.size, borderValue=(114, 114, 114)) return img, M, s def apply_bboxes(self, bboxes, M): """ Apply affine to bboxes only. Args: bboxes (ndarray): list of bboxes, xyxy format, with shape (num_bboxes, 4). M (ndarray): affine matrix. Returns: new_bboxes (ndarray): bboxes after affine, [num_bboxes, 4]. """ n = len(bboxes) if n == 0: return bboxes xy = np.ones((n * 4, 3), dtype=bboxes.dtype) xy[:, :2] = bboxes[:, [0, 1, 2, 3, 0, 3, 2, 1]].reshape(n * 4, 2) # x1y1, x2y2, x1y2, x2y1 xy = xy @ M.T # transform xy = (xy[:, :2] / xy[:, 2:3] if self.perspective else xy[:, :2]).reshape(n, 8) # perspective rescale or affine # Create new boxes x = xy[:, [0, 2, 4, 6]] y = xy[:, [1, 3, 5, 7]] return np.concatenate((x.min(1), y.min(1), x.max(1), y.max(1)), dtype=bboxes.dtype).reshape(4, n).T def apply_segments(self, segments, M): """ Apply affine to segments and generate new bboxes from segments. Args: segments (ndarray): list of segments, [num_samples, 500, 2]. M (ndarray): affine matrix. Returns: new_segments (ndarray): list of segments after affine, [num_samples, 500, 2]. new_bboxes (ndarray): bboxes after affine, [N, 4]. """ n, num = segments.shape[:2] if n == 0: return [], segments xy = np.ones((n * num, 3), dtype=segments.dtype) segments = segments.reshape(-1, 2) xy[:, :2] = segments xy = xy @ M.T # transform xy = xy[:, :2] / xy[:, 2:3] segments = xy.reshape(n, -1, 2) bboxes = np.stack([segment2box(xy, self.size[0], self.size[1]) for xy in segments], 0) segments[..., 0] = segments[..., 0].clip(bboxes[:, 0:1], bboxes[:, 2:3]) segments[..., 1] = segments[..., 1].clip(bboxes[:, 1:2], bboxes[:, 3:4]) return bboxes, segments def apply_keypoints(self, keypoints, M): """ Apply affine to keypoints. Args: keypoints (ndarray): keypoints, [N, 17, 3]. M (ndarray): affine matrix. Returns: new_keypoints (ndarray): keypoints after affine, [N, 17, 3]. """ n, nkpt = keypoints.shape[:2] if n == 0: return keypoints xy = np.ones((n * nkpt, 3), dtype=keypoints.dtype) visible = keypoints[..., 2].reshape(n * nkpt, 1) xy[:, :2] = keypoints[..., :2].reshape(n * nkpt, 2) xy = xy @ M.T # transform xy = xy[:, :2] / xy[:, 2:3] # perspective rescale or affine out_mask = (xy[:, 0] < 0) | (xy[:, 1] < 0) | (xy[:, 0] > self.size[0]) | (xy[:, 1] > self.size[1]) visible[out_mask] = 0 return np.concatenate([xy, visible], axis=-1).reshape(n, nkpt, 3) def __call__(self, labels): """ Affine images and targets. Args: labels (dict): a dict of `bboxes`, `segments`, `keypoints`. """ if self.pre_transform and "mosaic_border" not in labels: labels = self.pre_transform(labels) labels.pop("ratio_pad", None) # do not need ratio pad img = labels["img"] cls = labels["cls"] instances = labels.pop("instances") # Make sure the coord formats are right instances.convert_bbox(format="xyxy") instances.denormalize(*img.shape[:2][::-1]) border = labels.pop("mosaic_border", self.border) self.size = img.shape[1] + border[1] * 2, img.shape[0] + border[0] * 2 # w, h # M is affine matrix # Scale for func:`box_candidates` img, M, scale = self.affine_transform(img, border) bboxes = self.apply_bboxes(instances.bboxes, M) segments = instances.segments keypoints = instances.keypoints # Update bboxes if there are segments. if len(segments): bboxes, segments = self.apply_segments(segments, M) if keypoints is not None: keypoints = self.apply_keypoints(keypoints, M) new_instances = Instances(bboxes, segments, keypoints, bbox_format="xyxy", normalized=False) # Clip new_instances.clip(*self.size) # Filter instances instances.scale(scale_w=scale, scale_h=scale, bbox_only=True) # Make the bboxes have the same scale with new_bboxes i = self.box_candidates( box1=instances.bboxes.T, box2=new_instances.bboxes.T, area_thr=0.01 if len(segments) else 0.10 ) labels["instances"] = new_instances[i] labels["cls"] = cls[i] labels["img"] = img labels["resized_shape"] = img.shape[:2] return labels def box_candidates(self, box1, box2, wh_thr=2, ar_thr=100, area_thr=0.1, eps=1e-16): """ Compute box candidates based on a set of thresholds. This method compares the characteristics of the boxes before and after augmentation to decide whether a box is a candidate for further processing. Args: box1 (numpy.ndarray): The 4,n bounding box before augmentation, represented as [x1, y1, x2, y2]. box2 (numpy.ndarray): The 4,n bounding box after augmentation, represented as [x1, y1, x2, y2]. wh_thr (float, optional): The width and height threshold in pixels. Default is 2. ar_thr (float, optional): The aspect ratio threshold. Default is 100. area_thr (float, optional): The area ratio threshold. Default is 0.1. eps (float, optional): A small epsilon value to prevent division by zero. Default is 1e-16. Returns: (numpy.ndarray): A boolean array indicating which boxes are candidates based on the given thresholds. """ w1, h1 = box1[2] - box1[0], box1[3] - box1[1] w2, h2 = box2[2] - box2[0], box2[3] - box2[1] ar = np.maximum(w2 / (h2 + eps), h2 / (w2 + eps)) # aspect ratio return (w2 > wh_thr) & (h2 > wh_thr) & (w2 * h2 / (w1 * h1 + eps) > area_thr) & (ar < ar_thr) # candidates class RandomHSV: """ This class is responsible for performing random adjustments to the Hue, Saturation, and Value (HSV) channels of an image. The adjustments are random but within limits set by hgain, sgain, and vgain. """ def __init__(self, hgain=0.5, sgain=0.5, vgain=0.5) -> None: """ Initialize RandomHSV class with gains for each HSV channel. Args: hgain (float, optional): Maximum variation for hue. Default is 0.5. sgain (float, optional): Maximum variation for saturation. Default is 0.5. vgain (float, optional): Maximum variation for value. Default is 0.5. """ self.hgain = hgain self.sgain = sgain self.vgain = vgain def __call__(self, labels): """ Applies random HSV augmentation to an image within the predefined limits. The modified image replaces the original image in the input 'labels' dict. """ img = labels["img"] if self.hgain or self.sgain or self.vgain: r = np.random.uniform(-1, 1, 3) * [self.hgain, self.sgain, self.vgain] + 1 # random gains hue, sat, val = cv2.split(cv2.cvtColor(img, cv2.COLOR_BGR2HSV)) dtype = img.dtype # uint8 x = np.arange(0, 256, dtype=r.dtype) lut_hue = ((x * r[0]) % 180).astype(dtype) lut_sat = np.clip(x * r[1], 0, 255).astype(dtype) lut_val = np.clip(x * r[2], 0, 255).astype(dtype) im_hsv = cv2.merge((cv2.LUT(hue, lut_hue), cv2.LUT(sat, lut_sat), cv2.LUT(val, lut_val))) cv2.cvtColor(im_hsv, cv2.COLOR_HSV2BGR, dst=img) # no return needed return labels class RandomFlip: """ Applies a random horizontal or vertical flip to an image with a given probability. Also updates any instances (bounding boxes, keypoints, etc.) accordingly. """ def __init__(self, p=0.5, direction="horizontal", flip_idx=None) -> None: """ Initializes the RandomFlip class with probability and direction. Args: p (float, optional): The probability of applying the flip. Must be between 0 and 1. Default is 0.5. direction (str, optional): The direction to apply the flip. Must be 'horizontal' or 'vertical'. Default is 'horizontal'. flip_idx (array-like, optional): Index mapping for flipping keypoints, if any. """ assert direction in ["horizontal", "vertical"], f"Support direction `horizontal` or `vertical`, got {direction}" assert 0 <= p <= 1.0 self.p = p self.direction = direction self.flip_idx = flip_idx def __call__(self, labels): """ Applies random flip to an image and updates any instances like bounding boxes or keypoints accordingly. Args: labels (dict): A dictionary containing the keys 'img' and 'instances'. 'img' is the image to be flipped. 'instances' is an object containing bounding boxes and optionally keypoints. Returns: (dict): The same dict with the flipped image and updated instances under the 'img' and 'instances' keys. """ img = labels["img"] instances = labels.pop("instances") instances.convert_bbox(format="xywh") h, w = img.shape[:2] h = 1 if instances.normalized else h w = 1 if instances.normalized else w # Flip up-down if self.direction == "vertical" and random.random() < self.p: img = np.flipud(img) instances.flipud(h) if self.direction == "horizontal" and random.random() < self.p: img = np.fliplr(img) instances.fliplr(w) # For keypoints if self.flip_idx is not None and instances.keypoints is not None: instances.keypoints = np.ascontiguousarray(instances.keypoints[:, self.flip_idx, :]) labels["img"] = np.ascontiguousarray(img) labels["instances"] = instances return labels class LetterBox: """Resize image and padding for detection, instance segmentation, pose.""" def __init__(self, new_shape=(640, 640), auto=False, scaleFill=False, scaleup=True, center=True, stride=32): """Initialize LetterBox object with specific parameters.""" self.new_shape = new_shape self.auto = auto self.scaleFill = scaleFill self.scaleup = scaleup self.stride = stride self.center = center # Put the image in the middle or top-left def __call__(self, labels=None, image=None): """Return updated labels and image with added border.""" if labels is None: labels = {} img = labels.get("img") if image is None else image shape = img.shape[:2] # current shape [height, width] new_shape = labels.pop("rect_shape", self.new_shape) if isinstance(new_shape, int): new_shape = (new_shape, new_shape) # Scale ratio (new / old) r = min(new_shape[0] / shape[0], new_shape[1] / shape[1]) if not self.scaleup: # only scale down, do not scale up (for better val mAP) r = min(r, 1.0) # Compute padding ratio = r, r # width, height ratios new_unpad = int(round(shape[1] * r)), int(round(shape[0] * r)) dw, dh = new_shape[1] - new_unpad[0], new_shape[0] - new_unpad[1] # wh padding if self.auto: # minimum rectangle dw, dh = np.mod(dw, self.stride), np.mod(dh, self.stride) # wh padding elif self.scaleFill: # stretch dw, dh = 0.0, 0.0 new_unpad = (new_shape[1], new_shape[0]) ratio = new_shape[1] / shape[1], new_shape[0] / shape[0] # width, height ratios if self.center: dw /= 2 # divide padding into 2 sides dh /= 2 if shape[::-1] != new_unpad: # resize img = cv2.resize(img, new_unpad, interpolation=cv2.INTER_LINEAR) top, bottom = int(round(dh - 0.1)) if self.center else 0, int(round(dh + 0.1)) left, right = int(round(dw - 0.1)) if self.center else 0, int(round(dw + 0.1)) img = cv2.copyMakeBorder( img, top, bottom, left, right, cv2.BORDER_CONSTANT, value=(114, 114, 114) ) # add border if labels.get("ratio_pad"): labels["ratio_pad"] = (labels["ratio_pad"], (left, top)) # for evaluation if len(labels): labels = self._update_labels(labels, ratio, dw, dh) labels["img"] = img labels["resized_shape"] = new_shape return labels else: return img def _update_labels(self, labels, ratio, padw, padh): """Update labels.""" labels["instances"].convert_bbox(format="xyxy") labels["instances"].denormalize(*labels["img"].shape[:2][::-1]) labels["instances"].scale(*ratio) labels["instances"].add_padding(padw, padh) return labels class CopyPaste: """ Implements the Copy-Paste augmentation as described in the paper https://arxiv.org/abs/2012.07177. This class is responsible for applying the Copy-Paste augmentation on images and their corresponding instances. """ def __init__(self, p=0.5) -> None: """ Initializes the CopyPaste class with a given probability. Args: p (float, optional): The probability of applying the Copy-Paste augmentation. Must be between 0 and 1. Default is 0.5. """ self.p = p def __call__(self, labels): """ Applies the Copy-Paste augmentation to the given image and instances. Args: labels (dict): A dictionary containing: - 'img': The image to augment. - 'cls': Class labels associated with the instances. - 'instances': Object containing bounding boxes, and optionally, keypoints and segments. Returns: (dict): Dict with augmented image and updated instances under the 'img', 'cls', and 'instances' keys. Notes: 1. Instances are expected to have 'segments' as one of their attributes for this augmentation to work. 2. This method modifies the input dictionary 'labels' in place. """ im = labels["img"] cls = labels["cls"] h, w = im.shape[:2] instances = labels.pop("instances") instances.convert_bbox(format="xyxy") instances.denormalize(w, h) if self.p and len(instances.segments): n = len(instances) _, w, _ = im.shape # height, width, channels im_new = np.zeros(im.shape, np.uint8) # Calculate ioa first then select indexes randomly ins_flip = deepcopy(instances) ins_flip.fliplr(w) ioa = bbox_ioa(ins_flip.bboxes, instances.bboxes) # intersection over area, (N, M) indexes = np.nonzero((ioa < 0.30).all(1))[0] # (N, ) n = len(indexes) for j in random.sample(list(indexes), k=round(self.p * n)): cls = np.concatenate((cls, cls[[j]]), axis=0) instances = Instances.concatenate((instances, ins_flip[[j]]), axis=0) cv2.drawContours(im_new, instances.segments[[j]].astype(np.int32), -1, (1, 1, 1), cv2.FILLED) result = cv2.flip(im, 1) # augment segments (flip left-right) i = cv2.flip(im_new, 1).astype(bool) im[i] = result[i] labels["img"] = im labels["cls"] = cls labels["instances"] = instances return labels class Albumentations: """ Albumentations transformations. Optional, uninstall package to disable. Applies Blur, Median Blur, convert to grayscale, Contrast Limited Adaptive Histogram Equalization, random change of brightness and contrast, RandomGamma and lowering of image quality by compression. """ def __init__(self, p=1.0): """Initialize the transform object for YOLO bbox formatted params.""" self.p = p self.transform = None prefix = colorstr("albumentations: ") try: import albumentations as A check_version(A.__version__, "1.0.3", hard=True) # version requirement # Transforms T = [ A.Blur(p=0.01), A.MedianBlur(p=0.01), A.ToGray(p=0.01), A.CLAHE(p=0.01), A.RandomBrightnessContrast(p=0.0), A.RandomGamma(p=0.0), A.ImageCompression(quality_lower=75, p=0.0), ] self.transform = A.Compose(T, bbox_params=A.BboxParams(format="yolo", label_fields=["class_labels"])) LOGGER.info(prefix + ", ".join(f"{x}".replace("always_apply=False, ", "") for x in T if x.p)) except ImportError: # package not installed, skip pass except Exception as e: LOGGER.info(f"{prefix}{e}") def __call__(self, labels): """Generates object detections and returns a dictionary with detection results.""" im = labels["img"] cls = labels["cls"] if len(cls): labels["instances"].convert_bbox("xywh") labels["instances"].normalize(*im.shape[:2][::-1]) bboxes = labels["instances"].bboxes # TODO: add supports of segments and keypoints if self.transform and random.random() < self.p: new = self.transform(image=im, bboxes=bboxes, class_labels=cls) # transformed if len(new["class_labels"]) > 0: # skip update if no bbox in new im labels["img"] = new["image"] labels["cls"] = np.array(new["class_labels"]) bboxes = np.array(new["bboxes"], dtype=np.float32) labels["instances"].update(bboxes=bboxes) return labels # TODO: technically this is not an augmentation, maybe we should put this to another files class Format: """ Formats image annotations for object detection, instance segmentation, and pose estimation tasks. The class standardizes the image and instance annotations to be used by the `collate_fn` in PyTorch DataLoader. Attributes: bbox_format (str): Format for bounding boxes. Default is 'xywh'. normalize (bool): Whether to normalize bounding boxes. Default is True. return_mask (bool): Return instance masks for segmentation. Default is False. return_keypoint (bool): Return keypoints for pose estimation. Default is False. mask_ratio (int): Downsample ratio for masks. Default is 4. mask_overlap (bool): Whether to overlap masks. Default is True. batch_idx (bool): Keep batch indexes. Default is True. """ def __init__( self, bbox_format="xywh", normalize=True, return_mask=False, return_keypoint=False, return_obb=False, mask_ratio=4, mask_overlap=True, batch_idx=True, ): """Initializes the Format class with given parameters.""" self.bbox_format = bbox_format self.normalize = normalize self.return_mask = return_mask # set False when training detection only self.return_keypoint = return_keypoint self.return_obb = return_obb self.mask_ratio = mask_ratio self.mask_overlap = mask_overlap self.batch_idx = batch_idx # keep the batch indexes def __call__(self, labels): """Return formatted image, classes, bounding boxes & keypoints to be used by 'collate_fn'.""" img = labels.pop("img") h, w = img.shape[:2] cls = labels.pop("cls") instances = labels.pop("instances") instances.convert_bbox(format=self.bbox_format) instances.denormalize(w, h) nl = len(instances) if self.return_mask: if nl: masks, instances, cls = self._format_segments(instances, cls, w, h) masks = torch.from_numpy(masks) else: masks = torch.zeros( 1 if self.mask_overlap else nl, img.shape[0] // self.mask_ratio, img.shape[1] // self.mask_ratio ) labels["masks"] = masks if self.normalize: instances.normalize(w, h) labels["img"] = self._format_img(img) labels["cls"] = torch.from_numpy(cls) if nl else torch.zeros(nl) labels["bboxes"] = torch.from_numpy(instances.bboxes) if nl else torch.zeros((nl, 4)) if self.return_keypoint: labels["keypoints"] = torch.from_numpy(instances.keypoints) if self.return_obb: labels["bboxes"] = ( xyxyxyxy2xywhr(torch.from_numpy(instances.segments)) if len(instances.segments) else torch.zeros((0, 5)) ) # Then we can use collate_fn if self.batch_idx: labels["batch_idx"] = torch.zeros(nl) return labels def _format_img(self, img): """Format the image for YOLO from Numpy array to PyTorch tensor.""" if len(img.shape) < 3: img = np.expand_dims(img, -1) img = np.ascontiguousarray(img.transpose(2, 0, 1)[::-1]) img = torch.from_numpy(img) return img def _format_segments(self, instances, cls, w, h): """Convert polygon points to bitmap.""" segments = instances.segments if self.mask_overlap: masks, sorted_idx = polygons2masks_overlap((h, w), segments, downsample_ratio=self.mask_ratio) masks = masks[None] # (640, 640) -> (1, 640, 640) instances = instances[sorted_idx] cls = cls[sorted_idx] else: masks = polygons2masks((h, w), segments, color=1, downsample_ratio=self.mask_ratio) return masks, instances, cls def v8_transforms(dataset, imgsz, hyp, stretch=False): """Convert images to a size suitable for YOLOv8 training.""" pre_transform = Compose( [ Mosaic(dataset, imgsz=imgsz, p=hyp.mosaic), CopyPaste(p=hyp.copy_paste), RandomPerspective( degrees=hyp.degrees, translate=hyp.translate, scale=hyp.scale, shear=hyp.shear, perspective=hyp.perspective, pre_transform=None if stretch else LetterBox(new_shape=(imgsz, imgsz)), ), ] ) flip_idx = dataset.data.get("flip_idx", []) # for keypoints augmentation if dataset.use_keypoints: kpt_shape = dataset.data.get("kpt_shape", None) if len(flip_idx) == 0 and hyp.fliplr > 0.0: hyp.fliplr = 0.0 LOGGER.warning("WARNING ⚠️ No 'flip_idx' array defined in data.yaml, setting augmentation 'fliplr=0.0'") elif flip_idx and (len(flip_idx) != kpt_shape[0]): raise ValueError(f"data.yaml flip_idx={flip_idx} length must be equal to kpt_shape[0]={kpt_shape[0]}") return Compose( [ pre_transform, MixUp(dataset, pre_transform=pre_transform, p=hyp.mixup), Albumentations(p=1.0), RandomHSV(hgain=hyp.hsv_h, sgain=hyp.hsv_s, vgain=hyp.hsv_v), RandomFlip(direction="vertical", p=hyp.flipud), RandomFlip(direction="horizontal", p=hyp.fliplr, flip_idx=flip_idx), ] ) # transforms # Classification augmentations ----------------------------------------------------------------------------------------- def classify_transforms( size=224, mean=DEFAULT_MEAN, std=DEFAULT_STD, interpolation: T.InterpolationMode = T.InterpolationMode.BILINEAR, crop_fraction: float = DEFAULT_CROP_FTACTION, ): """ Classification transforms for evaluation/inference. Inspired by timm/data/transforms_factory.py. Args: size (int): image size mean (tuple): mean values of RGB channels std (tuple): std values of RGB channels interpolation (T.InterpolationMode): interpolation mode. default is T.InterpolationMode.BILINEAR. crop_fraction (float): fraction of image to crop. default is 1.0. Returns: (T.Compose): torchvision transforms """ if isinstance(size, (tuple, list)): assert len(size) == 2 scale_size = tuple(math.floor(x / crop_fraction) for x in size) else: scale_size = math.floor(size / crop_fraction) scale_size = (scale_size, scale_size) # aspect ratio is preserved, crops center within image, no borders are added, image is lost if scale_size[0] == scale_size[1]: # simple case, use torchvision built-in Resize w/ shortest edge mode (scalar size arg) tfl = [T.Resize(scale_size[0], interpolation=interpolation)] else: # resize shortest edge to matching target dim for non-square target tfl = [T.Resize(scale_size)] tfl += [T.CenterCrop(size)] tfl += [ T.ToTensor(), T.Normalize( mean=torch.tensor(mean), std=torch.tensor(std), ), ] return T.Compose(tfl) # Classification augmentations train --------------------------------------------------------------------------------------- def classify_augmentations( size=224, mean=DEFAULT_MEAN, std=DEFAULT_STD, scale=None, ratio=None, hflip=0.5, vflip=0.0, auto_augment=None, hsv_h=0.015, # image HSV-Hue augmentation (fraction) hsv_s=0.4, # image HSV-Saturation augmentation (fraction) hsv_v=0.4, # image HSV-Value augmentation (fraction) force_color_jitter=False, erasing=0.0, interpolation: T.InterpolationMode = T.InterpolationMode.BILINEAR, ): """ Classification transforms with augmentation for training. Inspired by timm/data/transforms_factory.py. Args: size (int): image size scale (tuple): scale range of the image. default is (0.08, 1.0) ratio (tuple): aspect ratio range of the image. default is (3./4., 4./3.) mean (tuple): mean values of RGB channels std (tuple): std values of RGB channels hflip (float): probability of horizontal flip vflip (float): probability of vertical flip auto_augment (str): auto augmentation policy. can be 'randaugment', 'augmix', 'autoaugment' or None. hsv_h (float): image HSV-Hue augmentation (fraction) hsv_s (float): image HSV-Saturation augmentation (fraction) hsv_v (float): image HSV-Value augmentation (fraction) force_color_jitter (bool): force to apply color jitter even if auto augment is enabled erasing (float): probability of random erasing interpolation (T.InterpolationMode): interpolation mode. default is T.InterpolationMode.BILINEAR. Returns: (T.Compose): torchvision transforms """ # Transforms to apply if albumentations not installed if not isinstance(size, int): raise TypeError(f"classify_transforms() size {size} must be integer, not (list, tuple)") scale = tuple(scale or (0.08, 1.0)) # default imagenet scale range ratio = tuple(ratio or (3.0 / 4.0, 4.0 / 3.0)) # default imagenet ratio range primary_tfl = [T.RandomResizedCrop(size, scale=scale, ratio=ratio, interpolation=interpolation)] if hflip > 0.0: primary_tfl += [T.RandomHorizontalFlip(p=hflip)] if vflip > 0.0: primary_tfl += [T.RandomVerticalFlip(p=vflip)] secondary_tfl = [] disable_color_jitter = False if auto_augment: assert isinstance(auto_augment, str) # color jitter is typically disabled if AA/RA on, # this allows override without breaking old hparm cfgs disable_color_jitter = not force_color_jitter if auto_augment == "randaugment": if TORCHVISION_0_11: secondary_tfl += [T.RandAugment(interpolation=interpolation)] else: LOGGER.warning('"auto_augment=randaugment" requires torchvision >= 0.11.0. Disabling it.') elif auto_augment == "augmix": if TORCHVISION_0_13: secondary_tfl += [T.AugMix(interpolation=interpolation)] else: LOGGER.warning('"auto_augment=augmix" requires torchvision >= 0.13.0. Disabling it.') elif auto_augment == "autoaugment": if TORCHVISION_0_10: secondary_tfl += [T.AutoAugment(interpolation=interpolation)] else: LOGGER.warning('"auto_augment=autoaugment" requires torchvision >= 0.10.0. Disabling it.') else: raise ValueError( f'Invalid auto_augment policy: {auto_augment}. Should be one of "randaugment", ' f'"augmix", "autoaugment" or None' ) if not disable_color_jitter: secondary_tfl += [T.ColorJitter(brightness=hsv_v, contrast=hsv_v, saturation=hsv_s, hue=hsv_h)] final_tfl = [ T.ToTensor(), T.Normalize(mean=torch.tensor(mean), std=torch.tensor(std)), T.RandomErasing(p=erasing, inplace=True), ] return T.Compose(primary_tfl + secondary_tfl + final_tfl) # NOTE: keep this class for backward compatibility class ClassifyLetterBox: """ YOLOv8 LetterBox class for image preprocessing, designed to be part of a transformation pipeline, e.g., T.Compose([LetterBox(size), ToTensor()]). Attributes: h (int): Target height of the image. w (int): Target width of the image. auto (bool): If True, automatically solves for short side using stride. stride (int): The stride value, used when 'auto' is True. """ def __init__(self, size=(640, 640), auto=False, stride=32): """ Initializes the ClassifyLetterBox class with a target size, auto-flag, and stride. Args: size (Union[int, Tuple[int, int]]): The target dimensions (height, width) for the letterbox. auto (bool): If True, automatically calculates the short side based on stride. stride (int): The stride value, used when 'auto' is True. """ super().__init__() self.h, self.w = (size, size) if isinstance(size, int) else size self.auto = auto # pass max size integer, automatically solve for short side using stride self.stride = stride # used with auto def __call__(self, im): """ Resizes the image and pads it with a letterbox method. Args: im (numpy.ndarray): The input image as a numpy array of shape HWC. Returns: (numpy.ndarray): The letterboxed and resized image as a numpy array. """ imh, imw = im.shape[:2] r = min(self.h / imh, self.w / imw) # ratio of new/old dimensions h, w = round(imh * r), round(imw * r) # resized image dimensions # Calculate padding dimensions hs, ws = (math.ceil(x / self.stride) * self.stride for x in (h, w)) if self.auto else (self.h, self.w) top, left = round((hs - h) / 2 - 0.1), round((ws - w) / 2 - 0.1) # Create padded image im_out = np.full((hs, ws, 3), 114, dtype=im.dtype) im_out[top : top + h, left : left + w] = cv2.resize(im, (w, h), interpolation=cv2.INTER_LINEAR) return im_out # NOTE: keep this class for backward compatibility class CenterCrop: """YOLOv8 CenterCrop class for image preprocessing, designed to be part of a transformation pipeline, e.g., T.Compose([CenterCrop(size), ToTensor()]). """ def __init__(self, size=640): """Converts an image from numpy array to PyTorch tensor.""" super().__init__() self.h, self.w = (size, size) if isinstance(size, int) else size def __call__(self, im): """ Resizes and crops the center of the image using a letterbox method. Args: im (numpy.ndarray): The input image as a numpy array of shape HWC. Returns: (numpy.ndarray): The center-cropped and resized image as a numpy array. """ imh, imw = im.shape[:2] m = min(imh, imw) # min dimension top, left = (imh - m) // 2, (imw - m) // 2 return cv2.resize(im[top : top + m, left : left + m], (self.w, self.h), interpolation=cv2.INTER_LINEAR) # NOTE: keep this class for backward compatibility class ToTensor: """YOLOv8 ToTensor class for image preprocessing, i.e., T.Compose([LetterBox(size), ToTensor()]).""" def __init__(self, half=False): """Initialize YOLOv8 ToTensor object with optional half-precision support.""" super().__init__() self.half = half def __call__(self, im): """ Transforms an image from a numpy array to a PyTorch tensor, applying optional half-precision and normalization. Args: im (numpy.ndarray): Input image as a numpy array with shape (H, W, C) in BGR order. Returns: (torch.Tensor): The transformed image as a PyTorch tensor in float32 or float16, normalized to [0, 1]. """ im = np.ascontiguousarray(im.transpose((2, 0, 1))[::-1]) # HWC to CHW -> BGR to RGB -> contiguous im = torch.from_numpy(im) # to torch im = im.half() if self.half else im.float() # uint8 to fp16/32 im /= 255.0 # 0-255 to 0.0-1.0 return im
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/augment.py
Python
unknown
52,000
# Ultralytics YOLO 🚀, AGPL-3.0 license import glob import math import os import random from copy import deepcopy from multiprocessing.pool import ThreadPool from pathlib import Path from typing import Optional import cv2 import numpy as np import psutil from torch.utils.data import Dataset from ultralytics.utils import DEFAULT_CFG, LOCAL_RANK, LOGGER, NUM_THREADS, TQDM from .utils import HELP_URL, IMG_FORMATS class BaseDataset(Dataset): """ Base dataset class for loading and processing image data. Args: img_path (str): Path to the folder containing images. imgsz (int, optional): Image size. Defaults to 640. cache (bool, optional): Cache images to RAM or disk during training. Defaults to False. augment (bool, optional): If True, data augmentation is applied. Defaults to True. hyp (dict, optional): Hyperparameters to apply data augmentation. Defaults to None. prefix (str, optional): Prefix to print in log messages. Defaults to ''. rect (bool, optional): If True, rectangular training is used. Defaults to False. batch_size (int, optional): Size of batches. Defaults to None. stride (int, optional): Stride. Defaults to 32. pad (float, optional): Padding. Defaults to 0.0. single_cls (bool, optional): If True, single class training is used. Defaults to False. classes (list): List of included classes. Default is None. fraction (float): Fraction of dataset to utilize. Default is 1.0 (use all data). Attributes: im_files (list): List of image file paths. labels (list): List of label data dictionaries. ni (int): Number of images in the dataset. ims (list): List of loaded images. npy_files (list): List of numpy file paths. transforms (callable): Image transformation function. """ def __init__( self, img_path, imgsz=640, cache=False, augment=True, hyp=DEFAULT_CFG, prefix="", rect=False, batch_size=16, stride=32, pad=0.5, single_cls=False, classes=None, fraction=1.0, ): """Initialize BaseDataset with given configuration and options.""" super().__init__() self.img_path = img_path self.imgsz = imgsz self.augment = augment self.single_cls = single_cls self.prefix = prefix self.fraction = fraction self.im_files = self.get_img_files(self.img_path) self.labels = self.get_labels() self.update_labels(include_class=classes) # single_cls and include_class self.ni = len(self.labels) # number of images self.rect = rect self.batch_size = batch_size self.stride = stride self.pad = pad if self.rect: assert self.batch_size is not None self.set_rectangle() # Buffer thread for mosaic images self.buffer = [] # buffer size = batch size self.max_buffer_length = min((self.ni, self.batch_size * 8, 1000)) if self.augment else 0 # Cache images if cache == "ram" and not self.check_cache_ram(): cache = False self.ims, self.im_hw0, self.im_hw = [None] * self.ni, [None] * self.ni, [None] * self.ni self.npy_files = [Path(f).with_suffix(".npy") for f in self.im_files] if cache: self.cache_images(cache) # Transforms self.transforms = self.build_transforms(hyp=hyp) def get_img_files(self, img_path): """Read image files.""" try: f = [] # image files for p in img_path if isinstance(img_path, list) else [img_path]: p = Path(p) # os-agnostic if p.is_dir(): # dir f += glob.glob(str(p / "**" / "*.*"), recursive=True) # F = list(p.rglob('*.*')) # pathlib elif p.is_file(): # file with open(p) as t: t = t.read().strip().splitlines() parent = str(p.parent) + os.sep f += [x.replace("./", parent) if x.startswith("./") else x for x in t] # local to global path # F += [p.parent / x.lstrip(os.sep) for x in t] # local to global path (pathlib) else: raise FileNotFoundError(f"{self.prefix}{p} does not exist") im_files = sorted(x.replace("/", os.sep) for x in f if x.split(".")[-1].lower() in IMG_FORMATS) # self.img_files = sorted([x for x in f if x.suffix[1:].lower() in IMG_FORMATS]) # pathlib assert im_files, f"{self.prefix}No images found in {img_path}" except Exception as e: raise FileNotFoundError(f"{self.prefix}Error loading data from {img_path}\n{HELP_URL}") from e if self.fraction < 1: im_files = im_files[: round(len(im_files) * self.fraction)] return im_files def update_labels(self, include_class: Optional[list]): """Update labels to include only these classes (optional).""" include_class_array = np.array(include_class).reshape(1, -1) for i in range(len(self.labels)): if include_class is not None: cls = self.labels[i]["cls"] bboxes = self.labels[i]["bboxes"] segments = self.labels[i]["segments"] keypoints = self.labels[i]["keypoints"] j = (cls == include_class_array).any(1) self.labels[i]["cls"] = cls[j] self.labels[i]["bboxes"] = bboxes[j] if segments: self.labels[i]["segments"] = [segments[si] for si, idx in enumerate(j) if idx] if keypoints is not None: self.labels[i]["keypoints"] = keypoints[j] if self.single_cls: self.labels[i]["cls"][:, 0] = 0 def load_image(self, i, rect_mode=True): """Loads 1 image from dataset index 'i', returns (im, resized hw).""" im, f, fn = self.ims[i], self.im_files[i], self.npy_files[i] if im is None: # not cached in RAM if fn.exists(): # load npy try: im = np.load(fn) except Exception as e: LOGGER.warning(f"{self.prefix}WARNING ⚠️ Removing corrupt *.npy image file {fn} due to: {e}") Path(fn).unlink(missing_ok=True) im = cv2.imread(f) # BGR else: # read image im = cv2.imread(f) # BGR if im is None: raise FileNotFoundError(f"Image Not Found {f}") h0, w0 = im.shape[:2] # orig hw if rect_mode: # resize long side to imgsz while maintaining aspect ratio r = self.imgsz / max(h0, w0) # ratio if r != 1: # if sizes are not equal w, h = (min(math.ceil(w0 * r), self.imgsz), min(math.ceil(h0 * r), self.imgsz)) im = cv2.resize(im, (w, h), interpolation=cv2.INTER_LINEAR) elif not (h0 == w0 == self.imgsz): # resize by stretching image to square imgsz im = cv2.resize(im, (self.imgsz, self.imgsz), interpolation=cv2.INTER_LINEAR) # Add to buffer if training with augmentations if self.augment: self.ims[i], self.im_hw0[i], self.im_hw[i] = im, (h0, w0), im.shape[:2] # im, hw_original, hw_resized self.buffer.append(i) if len(self.buffer) >= self.max_buffer_length: j = self.buffer.pop(0) self.ims[j], self.im_hw0[j], self.im_hw[j] = None, None, None return im, (h0, w0), im.shape[:2] return self.ims[i], self.im_hw0[i], self.im_hw[i] def cache_images(self, cache): """Cache images to memory or disk.""" b, gb = 0, 1 << 30 # bytes of cached images, bytes per gigabytes fcn = self.cache_images_to_disk if cache == "disk" else self.load_image with ThreadPool(NUM_THREADS) as pool: results = pool.imap(fcn, range(self.ni)) pbar = TQDM(enumerate(results), total=self.ni, disable=LOCAL_RANK > 0) for i, x in pbar: if cache == "disk": b += self.npy_files[i].stat().st_size else: # 'ram' self.ims[i], self.im_hw0[i], self.im_hw[i] = x # im, hw_orig, hw_resized = load_image(self, i) b += self.ims[i].nbytes pbar.desc = f"{self.prefix}Caching images ({b / gb:.1f}GB {cache})" pbar.close() def cache_images_to_disk(self, i): """Saves an image as an *.npy file for faster loading.""" f = self.npy_files[i] if not f.exists(): np.save(f.as_posix(), cv2.imread(self.im_files[i]), allow_pickle=False) def check_cache_ram(self, safety_margin=0.5): """Check image caching requirements vs available memory.""" b, gb = 0, 1 << 30 # bytes of cached images, bytes per gigabytes n = min(self.ni, 30) # extrapolate from 30 random images for _ in range(n): im = cv2.imread(random.choice(self.im_files)) # sample image ratio = self.imgsz / max(im.shape[0], im.shape[1]) # max(h, w) # ratio b += im.nbytes * ratio**2 mem_required = b * self.ni / n * (1 + safety_margin) # GB required to cache dataset into RAM mem = psutil.virtual_memory() cache = mem_required < mem.available # to cache or not to cache, that is the question if not cache: LOGGER.info( f'{self.prefix}{mem_required / gb:.1f}GB RAM required to cache images ' f'with {int(safety_margin * 100)}% safety margin but only ' f'{mem.available / gb:.1f}/{mem.total / gb:.1f}GB available, ' f"{'caching images ✅' if cache else 'not caching images ⚠️'}" ) return cache def set_rectangle(self): """Sets the shape of bounding boxes for YOLO detections as rectangles.""" bi = np.floor(np.arange(self.ni) / self.batch_size).astype(int) # batch index nb = bi[-1] + 1 # number of batches s = np.array([x.pop("shape") for x in self.labels]) # hw ar = s[:, 0] / s[:, 1] # aspect ratio irect = ar.argsort() self.im_files = [self.im_files[i] for i in irect] self.labels = [self.labels[i] for i in irect] ar = ar[irect] # Set training image shapes shapes = [[1, 1]] * nb for i in range(nb): ari = ar[bi == i] mini, maxi = ari.min(), ari.max() if maxi < 1: shapes[i] = [maxi, 1] elif mini > 1: shapes[i] = [1, 1 / mini] self.batch_shapes = np.ceil(np.array(shapes) * self.imgsz / self.stride + self.pad).astype(int) * self.stride self.batch = bi # batch index of image def __getitem__(self, index): """Returns transformed label information for given index.""" return self.transforms(self.get_image_and_label(index)) def get_image_and_label(self, index): """Get and return label information from the dataset.""" label = deepcopy(self.labels[index]) # requires deepcopy() https://github.com/ultralytics/ultralytics/pull/1948 label.pop("shape", None) # shape is for rect, remove it label["img"], label["ori_shape"], label["resized_shape"] = self.load_image(index) label["ratio_pad"] = ( label["resized_shape"][0] / label["ori_shape"][0], label["resized_shape"][1] / label["ori_shape"][1], ) # for evaluation if self.rect: label["rect_shape"] = self.batch_shapes[self.batch[index]] return self.update_labels_info(label) def __len__(self): """Returns the length of the labels list for the dataset.""" return len(self.labels) def update_labels_info(self, label): """Custom your label format here.""" return label def build_transforms(self, hyp=None): """ Users can customize augmentations here. Example: ```python if self.augment: # Training transforms return Compose([]) else: # Val transforms return Compose([]) ``` """ raise NotImplementedError def get_labels(self): """ Users can customize their own format here. Note: Ensure output is a dictionary with the following keys: ```python dict( im_file=im_file, shape=shape, # format: (height, width) cls=cls, bboxes=bboxes, # xywh segments=segments, # xy keypoints=keypoints, # xy normalized=True, # or False bbox_format="xyxy", # or xywh, ltwh ) ``` """ raise NotImplementedError
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/base.py
Python
unknown
13,216
# Ultralytics YOLO 🚀, AGPL-3.0 license import os import random from pathlib import Path import numpy as np import torch from PIL import Image from torch.utils.data import dataloader, distributed from ultralytics.data.loaders import ( LOADERS, LoadImages, LoadPilAndNumpy, LoadScreenshots, LoadStreams, LoadTensor, SourceTypes, autocast_list, ) from ultralytics.data.utils import IMG_FORMATS, VID_FORMATS from ultralytics.utils import RANK, colorstr from ultralytics.utils.checks import check_file from .dataset import YOLODataset from .utils import PIN_MEMORY class InfiniteDataLoader(dataloader.DataLoader): """ Dataloader that reuses workers. Uses same syntax as vanilla DataLoader. """ def __init__(self, *args, **kwargs): """Dataloader that infinitely recycles workers, inherits from DataLoader.""" super().__init__(*args, **kwargs) object.__setattr__(self, "batch_sampler", _RepeatSampler(self.batch_sampler)) self.iterator = super().__iter__() def __len__(self): """Returns the length of the batch sampler's sampler.""" return len(self.batch_sampler.sampler) def __iter__(self): """Creates a sampler that repeats indefinitely.""" for _ in range(len(self)): yield next(self.iterator) def reset(self): """ Reset iterator. This is useful when we want to modify settings of dataset while training. """ self.iterator = self._get_iterator() class _RepeatSampler: """ Sampler that repeats forever. Args: sampler (Dataset.sampler): The sampler to repeat. """ def __init__(self, sampler): """Initializes an object that repeats a given sampler indefinitely.""" self.sampler = sampler def __iter__(self): """Iterates over the 'sampler' and yields its contents.""" while True: yield from iter(self.sampler) def seed_worker(worker_id): # noqa """Set dataloader worker seed https://pytorch.org/docs/stable/notes/randomness.html#dataloader.""" worker_seed = torch.initial_seed() % 2**32 np.random.seed(worker_seed) random.seed(worker_seed) def build_yolo_dataset(cfg, img_path, batch, data, mode="train", rect=False, stride=32): """Build YOLO Dataset.""" return YOLODataset( img_path=img_path, imgsz=cfg.imgsz, batch_size=batch, augment=mode == "train", # augmentation hyp=cfg, # TODO: probably add a get_hyps_from_cfg function rect=cfg.rect or rect, # rectangular batches cache=cfg.cache or None, single_cls=cfg.single_cls or False, stride=int(stride), pad=0.0 if mode == "train" else 0.5, prefix=colorstr(f"{mode}: "), task=cfg.task, classes=cfg.classes, data=data, fraction=cfg.fraction if mode == "train" else 1.0, ) def build_dataloader(dataset, batch, workers, shuffle=True, rank=-1): """Return an InfiniteDataLoader or DataLoader for training or validation set.""" batch = min(batch, len(dataset)) nd = torch.cuda.device_count() # number of CUDA devices nw = min([os.cpu_count() // max(nd, 1), workers]) # number of workers sampler = None if rank == -1 else distributed.DistributedSampler(dataset, shuffle=shuffle) generator = torch.Generator() generator.manual_seed(6148914691236517205 + RANK) return InfiniteDataLoader( dataset=dataset, batch_size=batch, shuffle=shuffle and sampler is None, num_workers=nw, sampler=sampler, pin_memory=PIN_MEMORY, collate_fn=getattr(dataset, "collate_fn", None), worker_init_fn=seed_worker, generator=generator, ) def check_source(source): """Check source type and return corresponding flag values.""" webcam, screenshot, from_img, in_memory, tensor = False, False, False, False, False if isinstance(source, (str, int, Path)): # int for local usb camera source = str(source) is_file = Path(source).suffix[1:] in (IMG_FORMATS + VID_FORMATS) is_url = source.lower().startswith(("https://", "http://", "rtsp://", "rtmp://", "tcp://")) webcam = source.isnumeric() or source.endswith(".streams") or (is_url and not is_file) screenshot = source.lower() == "screen" if is_url and is_file: source = check_file(source) # download elif isinstance(source, LOADERS): in_memory = True elif isinstance(source, (list, tuple)): source = autocast_list(source) # convert all list elements to PIL or np arrays from_img = True elif isinstance(source, (Image.Image, np.ndarray)): from_img = True elif isinstance(source, torch.Tensor): tensor = True else: raise TypeError("Unsupported image type. For supported types see https://docs.ultralytics.com/modes/predict") return source, webcam, screenshot, from_img, in_memory, tensor def load_inference_source(source=None, vid_stride=1, buffer=False): """ Loads an inference source for object detection and applies necessary transformations. Args: source (str, Path, Tensor, PIL.Image, np.ndarray): The input source for inference. vid_stride (int, optional): The frame interval for video sources. Default is 1. buffer (bool, optional): Determined whether stream frames will be buffered. Default is False. Returns: dataset (Dataset): A dataset object for the specified input source. """ source, webcam, screenshot, from_img, in_memory, tensor = check_source(source) source_type = source.source_type if in_memory else SourceTypes(webcam, screenshot, from_img, tensor) # Dataloader if tensor: dataset = LoadTensor(source) elif in_memory: dataset = source elif webcam: dataset = LoadStreams(source, vid_stride=vid_stride, buffer=buffer) elif screenshot: dataset = LoadScreenshots(source) elif from_img: dataset = LoadPilAndNumpy(source) else: dataset = LoadImages(source, vid_stride=vid_stride) # Attach source types to the dataset setattr(dataset, "source_type", source_type) return dataset
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/build.py
Python
unknown
6,293
# Ultralytics YOLO 🚀, AGPL-3.0 license import json from collections import defaultdict from pathlib import Path import cv2 import numpy as np from ultralytics.utils import LOGGER, TQDM from ultralytics.utils.files import increment_path def coco91_to_coco80_class(): """ Converts 91-index COCO class IDs to 80-index COCO class IDs. Returns: (list): A list of 91 class IDs where the index represents the 80-index class ID and the value is the corresponding 91-index class ID. """ return [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, None, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, None, 24, 25, None, None, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, None, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, None, 60, None, None, 61, None, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, None, 73, 74, 75, 76, 77, 78, 79, None, ] def coco80_to_coco91_class(): """ Converts 80-index (val2014) to 91-index (paper). For details see https://tech.amikelive.com/node-718/what-object-categories-labels-are-in-coco-dataset/. Example: ```python import numpy as np a = np.loadtxt('data/coco.names', dtype='str', delimiter='\n') b = np.loadtxt('data/coco_paper.names', dtype='str', delimiter='\n') x1 = [list(a[i] == b).index(True) + 1 for i in range(80)] # darknet to coco x2 = [list(b[i] == a).index(True) if any(b[i] == a) else None for i in range(91)] # coco to darknet ``` """ return [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90, ] def convert_coco( labels_dir="../coco/annotations/", save_dir="coco_converted/", use_segments=False, use_keypoints=False, cls91to80=True, ): """ Converts COCO dataset annotations to a YOLO annotation format suitable for training YOLO models. Args: labels_dir (str, optional): Path to directory containing COCO dataset annotation files. save_dir (str, optional): Path to directory to save results to. use_segments (bool, optional): Whether to include segmentation masks in the output. use_keypoints (bool, optional): Whether to include keypoint annotations in the output. cls91to80 (bool, optional): Whether to map 91 COCO class IDs to the corresponding 80 COCO class IDs. Example: ```python from ultralytics.data.converter import convert_coco convert_coco('../datasets/coco/annotations/', use_segments=True, use_keypoints=False, cls91to80=True) ``` Output: Generates output files in the specified output directory. """ # Create dataset directory save_dir = increment_path(save_dir) # increment if save directory already exists for p in save_dir / "labels", save_dir / "images": p.mkdir(parents=True, exist_ok=True) # make dir # Convert classes coco80 = coco91_to_coco80_class() # Import json for json_file in sorted(Path(labels_dir).resolve().glob("*.json")): fn = Path(save_dir) / "labels" / json_file.stem.replace("instances_", "") # folder name fn.mkdir(parents=True, exist_ok=True) with open(json_file) as f: data = json.load(f) # Create image dict images = {f'{x["id"]:d}': x for x in data["images"]} # Create image-annotations dict imgToAnns = defaultdict(list) for ann in data["annotations"]: imgToAnns[ann["image_id"]].append(ann) # Write labels file for img_id, anns in TQDM(imgToAnns.items(), desc=f"Annotations {json_file}"): img = images[f"{img_id:d}"] h, w, f = img["height"], img["width"], img["file_name"] bboxes = [] segments = [] keypoints = [] for ann in anns: if ann["iscrowd"]: continue # The COCO box format is [top left x, top left y, width, height] box = np.array(ann["bbox"], dtype=np.float64) box[:2] += box[2:] / 2 # xy top-left corner to center box[[0, 2]] /= w # normalize x box[[1, 3]] /= h # normalize y if box[2] <= 0 or box[3] <= 0: # if w <= 0 and h <= 0 continue cls = coco80[ann["category_id"] - 1] if cls91to80 else ann["category_id"] - 1 # class box = [cls] + box.tolist() if box not in bboxes: bboxes.append(box) if use_segments and ann.get("segmentation") is not None: if len(ann["segmentation"]) == 0: segments.append([]) continue elif len(ann["segmentation"]) > 1: s = merge_multi_segment(ann["segmentation"]) s = (np.concatenate(s, axis=0) / np.array([w, h])).reshape(-1).tolist() else: s = [j for i in ann["segmentation"] for j in i] # all segments concatenated s = (np.array(s).reshape(-1, 2) / np.array([w, h])).reshape(-1).tolist() s = [cls] + s segments.append(s) if use_keypoints and ann.get("keypoints") is not None: keypoints.append( box + (np.array(ann["keypoints"]).reshape(-1, 3) / np.array([w, h, 1])).reshape(-1).tolist() ) # Write with open((fn / f).with_suffix(".txt"), "a") as file: for i in range(len(bboxes)): if use_keypoints: line = (*(keypoints[i]),) # cls, box, keypoints else: line = ( *(segments[i] if use_segments and len(segments[i]) > 0 else bboxes[i]), ) # cls, box or segments file.write(("%g " * len(line)).rstrip() % line + "\n") LOGGER.info(f"COCO data converted successfully.\nResults saved to {save_dir.resolve()}") def convert_dota_to_yolo_obb(dota_root_path: str): """ Converts DOTA dataset annotations to YOLO OBB (Oriented Bounding Box) format. The function processes images in the 'train' and 'val' folders of the DOTA dataset. For each image, it reads the associated label from the original labels directory and writes new labels in YOLO OBB format to a new directory. Args: dota_root_path (str): The root directory path of the DOTA dataset. Example: ```python from ultralytics.data.converter import convert_dota_to_yolo_obb convert_dota_to_yolo_obb('path/to/DOTA') ``` Notes: The directory structure assumed for the DOTA dataset: - DOTA ├─ images │ ├─ train │ └─ val └─ labels ├─ train_original └─ val_original After execution, the function will organize the labels into: - DOTA └─ labels ├─ train └─ val """ dota_root_path = Path(dota_root_path) # Class names to indices mapping class_mapping = { "plane": 0, "ship": 1, "storage-tank": 2, "baseball-diamond": 3, "tennis-court": 4, "basketball-court": 5, "ground-track-field": 6, "harbor": 7, "bridge": 8, "large-vehicle": 9, "small-vehicle": 10, "helicopter": 11, "roundabout": 12, "soccer-ball-field": 13, "swimming-pool": 14, "container-crane": 15, "airport": 16, "helipad": 17, } def convert_label(image_name, image_width, image_height, orig_label_dir, save_dir): """Converts a single image's DOTA annotation to YOLO OBB format and saves it to a specified directory.""" orig_label_path = orig_label_dir / f"{image_name}.txt" save_path = save_dir / f"{image_name}.txt" with orig_label_path.open("r") as f, save_path.open("w") as g: lines = f.readlines() for line in lines: parts = line.strip().split() if len(parts) < 9: continue class_name = parts[8] class_idx = class_mapping[class_name] coords = [float(p) for p in parts[:8]] normalized_coords = [ coords[i] / image_width if i % 2 == 0 else coords[i] / image_height for i in range(8) ] formatted_coords = ["{:.6g}".format(coord) for coord in normalized_coords] g.write(f"{class_idx} {' '.join(formatted_coords)}\n") for phase in ["train", "val"]: image_dir = dota_root_path / "images" / phase orig_label_dir = dota_root_path / "labels" / f"{phase}_original" save_dir = dota_root_path / "labels" / phase save_dir.mkdir(parents=True, exist_ok=True) image_paths = list(image_dir.iterdir()) for image_path in TQDM(image_paths, desc=f"Processing {phase} images"): if image_path.suffix != ".png": continue image_name_without_ext = image_path.stem img = cv2.imread(str(image_path)) h, w = img.shape[:2] convert_label(image_name_without_ext, w, h, orig_label_dir, save_dir) def min_index(arr1, arr2): """ Find a pair of indexes with the shortest distance between two arrays of 2D points. Args: arr1 (np.array): A NumPy array of shape (N, 2) representing N 2D points. arr2 (np.array): A NumPy array of shape (M, 2) representing M 2D points. Returns: (tuple): A tuple containing the indexes of the points with the shortest distance in arr1 and arr2 respectively. """ dis = ((arr1[:, None, :] - arr2[None, :, :]) ** 2).sum(-1) return np.unravel_index(np.argmin(dis, axis=None), dis.shape) def merge_multi_segment(segments): """ Merge multiple segments into one list by connecting the coordinates with the minimum distance between each segment. This function connects these coordinates with a thin line to merge all segments into one. Args: segments (List[List]): Original segmentations in COCO's JSON file. Each element is a list of coordinates, like [segmentation1, segmentation2,...]. Returns: s (List[np.ndarray]): A list of connected segments represented as NumPy arrays. """ s = [] segments = [np.array(i).reshape(-1, 2) for i in segments] idx_list = [[] for _ in range(len(segments))] # Record the indexes with min distance between each segment for i in range(1, len(segments)): idx1, idx2 = min_index(segments[i - 1], segments[i]) idx_list[i - 1].append(idx1) idx_list[i].append(idx2) # Use two round to connect all the segments for k in range(2): # Forward connection if k == 0: for i, idx in enumerate(idx_list): # Middle segments have two indexes, reverse the index of middle segments if len(idx) == 2 and idx[0] > idx[1]: idx = idx[::-1] segments[i] = segments[i][::-1, :] segments[i] = np.roll(segments[i], -idx[0], axis=0) segments[i] = np.concatenate([segments[i], segments[i][:1]]) # Deal with the first segment and the last one if i in [0, len(idx_list) - 1]: s.append(segments[i]) else: idx = [0, idx[1] - idx[0]] s.append(segments[i][idx[0] : idx[1] + 1]) else: for i in range(len(idx_list) - 1, -1, -1): if i not in [0, len(idx_list) - 1]: idx = idx_list[i] nidx = abs(idx[1] - idx[0]) s.append(segments[i][nidx:]) return s def yolo_bbox2segment(im_dir, save_dir=None, sam_model="sam_b.pt"): """ Converts existing object detection dataset (bounding boxes) to segmentation dataset or oriented bounding box (OBB) in YOLO format. Generates segmentation data using SAM auto-annotator as needed. Args: im_dir (str | Path): Path to image directory to convert. save_dir (str | Path): Path to save the generated labels, labels will be saved into `labels-segment` in the same directory level of `im_dir` if save_dir is None. Default: None. sam_model (str): Segmentation model to use for intermediate segmentation data; optional. Notes: The input directory structure assumed for dataset: - im_dir ├─ 001.jpg ├─ .. └─ NNN.jpg - labels ├─ 001.txt ├─ .. └─ NNN.txt """ from ultralytics.data import YOLODataset from ultralytics.utils.ops import xywh2xyxy from ultralytics.utils import LOGGER from ultralytics import SAM from tqdm import tqdm # NOTE: add placeholder to pass class index check dataset = YOLODataset(im_dir, data=dict(names=list(range(1000)))) if len(dataset.labels[0]["segments"]) > 0: # if it's segment data LOGGER.info("Segmentation labels detected, no need to generate new ones!") return LOGGER.info("Detection labels detected, generating segment labels by SAM model!") sam_model = SAM(sam_model) for l in tqdm(dataset.labels, total=len(dataset.labels), desc="Generating segment labels"): h, w = l["shape"] boxes = l["bboxes"] if len(boxes) == 0: # skip empty labels continue boxes[:, [0, 2]] *= w boxes[:, [1, 3]] *= h im = cv2.imread(l["im_file"]) sam_results = sam_model(im, bboxes=xywh2xyxy(boxes), verbose=False, save=False) l["segments"] = sam_results[0].masks.xyn save_dir = Path(save_dir) if save_dir else Path(im_dir).parent / "labels-segment" save_dir.mkdir(parents=True, exist_ok=True) for l in dataset.labels: texts = [] lb_name = Path(l["im_file"]).with_suffix(".txt").name txt_file = save_dir / lb_name cls = l["cls"] for i, s in enumerate(l["segments"]): line = (int(cls[i]), *s.reshape(-1)) texts.append(("%g " * len(line)).rstrip() % line) if texts: with open(txt_file, "a") as f: f.writelines(text + "\n" for text in texts) LOGGER.info(f"Generated segment labels saved in {save_dir}")
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/converter.py
Python
unknown
16,499
# Ultralytics YOLO 🚀, AGPL-3.0 license import contextlib from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path import cv2 import numpy as np import torch import torchvision from PIL import Image from ultralytics.utils import LOCAL_RANK, NUM_THREADS, TQDM, colorstr, is_dir_writeable from ultralytics.utils.ops import resample_segments from .augment import Compose, Format, Instances, LetterBox, classify_augmentations, classify_transforms, v8_transforms from .base import BaseDataset from .utils import HELP_URL, LOGGER, get_hash, img2label_paths, verify_image, verify_image_label # Ultralytics dataset *.cache version, >= 1.0.0 for YOLOv8 DATASET_CACHE_VERSION = "1.0.3" class YOLODataset(BaseDataset): """ Dataset class for loading object detection and/or segmentation labels in YOLO format. Args: data (dict, optional): A dataset YAML dictionary. Defaults to None. task (str): An explicit arg to point current task, Defaults to 'detect'. Returns: (torch.utils.data.Dataset): A PyTorch dataset object that can be used for training an object detection model. """ def __init__(self, *args, data=None, task="detect", **kwargs): """Initializes the YOLODataset with optional configurations for segments and keypoints.""" self.use_segments = task == "segment" self.use_keypoints = task == "pose" self.use_obb = task == "obb" self.data = data assert not (self.use_segments and self.use_keypoints), "Can not use both segments and keypoints." super().__init__(*args, **kwargs) def cache_labels(self, path=Path("./labels.cache")): """ Cache dataset labels, check images and read shapes. Args: path (Path): Path where to save the cache file. Default is Path('./labels.cache'). Returns: (dict): labels. """ x = {"labels": []} nm, nf, ne, nc, msgs = 0, 0, 0, 0, [] # number missing, found, empty, corrupt, messages desc = f"{self.prefix}Scanning {path.parent / path.stem}..." total = len(self.im_files) nkpt, ndim = self.data.get("kpt_shape", (0, 0)) if self.use_keypoints and (nkpt <= 0 or ndim not in (2, 3)): raise ValueError( "'kpt_shape' in data.yaml missing or incorrect. Should be a list with [number of " "keypoints, number of dims (2 for x,y or 3 for x,y,visible)], i.e. 'kpt_shape: [17, 3]'" ) with ThreadPool(NUM_THREADS) as pool: results = pool.imap( func=verify_image_label, iterable=zip( self.im_files, self.label_files, repeat(self.prefix), repeat(self.use_keypoints), repeat(len(self.data["names"])), repeat(nkpt), repeat(ndim), ), ) pbar = TQDM(results, desc=desc, total=total) for im_file, lb, shape, segments, keypoint, nm_f, nf_f, ne_f, nc_f, msg in pbar: nm += nm_f nf += nf_f ne += ne_f nc += nc_f if im_file: x["labels"].append( dict( im_file=im_file, shape=shape, cls=lb[:, 0:1], # n, 1 bboxes=lb[:, 1:], # n, 4 segments=segments, keypoints=keypoint, normalized=True, bbox_format="xywh", ) ) if msg: msgs.append(msg) pbar.desc = f"{desc} {nf} images, {nm + ne} backgrounds, {nc} corrupt" pbar.close() if msgs: LOGGER.info("\n".join(msgs)) if nf == 0: LOGGER.warning(f"{self.prefix}WARNING ⚠️ No labels found in {path}. {HELP_URL}") x["hash"] = get_hash(self.label_files + self.im_files) x["results"] = nf, nm, ne, nc, len(self.im_files) x["msgs"] = msgs # warnings save_dataset_cache_file(self.prefix, path, x) return x def get_labels(self): """Returns dictionary of labels for YOLO training.""" self.label_files = img2label_paths(self.im_files) cache_path = Path(self.label_files[0]).parent.with_suffix(".cache") try: cache, exists = load_dataset_cache_file(cache_path), True # attempt to load a *.cache file assert cache["version"] == DATASET_CACHE_VERSION # matches current version assert cache["hash"] == get_hash(self.label_files + self.im_files) # identical hash except (FileNotFoundError, AssertionError, AttributeError): cache, exists = self.cache_labels(cache_path), False # run cache ops # Display cache nf, nm, ne, nc, n = cache.pop("results") # found, missing, empty, corrupt, total if exists and LOCAL_RANK in (-1, 0): d = f"Scanning {cache_path}... {nf} images, {nm + ne} backgrounds, {nc} corrupt" TQDM(None, desc=self.prefix + d, total=n, initial=n) # display results if cache["msgs"]: LOGGER.info("\n".join(cache["msgs"])) # display warnings # Read cache [cache.pop(k) for k in ("hash", "version", "msgs")] # remove items labels = cache["labels"] if not labels: LOGGER.warning(f"WARNING ⚠️ No images found in {cache_path}, training may not work correctly. {HELP_URL}") self.im_files = [lb["im_file"] for lb in labels] # update im_files # Check if the dataset is all boxes or all segments lengths = ((len(lb["cls"]), len(lb["bboxes"]), len(lb["segments"])) for lb in labels) len_cls, len_boxes, len_segments = (sum(x) for x in zip(*lengths)) if len_segments and len_boxes != len_segments: LOGGER.warning( f"WARNING ⚠️ Box and segment counts should be equal, but got len(segments) = {len_segments}, " f"len(boxes) = {len_boxes}. To resolve this only boxes will be used and all segments will be removed. " "To avoid this please supply either a detect or segment dataset, not a detect-segment mixed dataset." ) for lb in labels: lb["segments"] = [] if len_cls == 0: LOGGER.warning(f"WARNING ⚠️ No labels found in {cache_path}, training may not work correctly. {HELP_URL}") return labels def build_transforms(self, hyp=None): """Builds and appends transforms to the list.""" if self.augment: hyp.mosaic = hyp.mosaic if self.augment and not self.rect else 0.0 hyp.mixup = hyp.mixup if self.augment and not self.rect else 0.0 transforms = v8_transforms(self, self.imgsz, hyp) else: transforms = Compose([LetterBox(new_shape=(self.imgsz, self.imgsz), scaleup=False)]) transforms.append( Format( bbox_format="xywh", normalize=True, return_mask=self.use_segments, return_keypoint=self.use_keypoints, return_obb=self.use_obb, batch_idx=True, mask_ratio=hyp.mask_ratio, mask_overlap=hyp.overlap_mask, ) ) return transforms def close_mosaic(self, hyp): """Sets mosaic, copy_paste and mixup options to 0.0 and builds transformations.""" hyp.mosaic = 0.0 # set mosaic ratio=0.0 hyp.copy_paste = 0.0 # keep the same behavior as previous v8 close-mosaic hyp.mixup = 0.0 # keep the same behavior as previous v8 close-mosaic self.transforms = self.build_transforms(hyp) def update_labels_info(self, label): """ Custom your label format here. Note: cls is not with bboxes now, classification and semantic segmentation need an independent cls label Can also support classification and semantic segmentation by adding or removing dict keys there. """ bboxes = label.pop("bboxes") segments = label.pop("segments", []) keypoints = label.pop("keypoints", None) bbox_format = label.pop("bbox_format") normalized = label.pop("normalized") # NOTE: do NOT resample oriented boxes segment_resamples = 100 if self.use_obb else 1000 if len(segments) > 0: # list[np.array(1000, 2)] * num_samples # (N, 1000, 2) segments = np.stack(resample_segments(segments, n=segment_resamples), axis=0) else: segments = np.zeros((0, segment_resamples, 2), dtype=np.float32) label["instances"] = Instances(bboxes, segments, keypoints, bbox_format=bbox_format, normalized=normalized) return label @staticmethod def collate_fn(batch): """Collates data samples into batches.""" new_batch = {} keys = batch[0].keys() values = list(zip(*[list(b.values()) for b in batch])) for i, k in enumerate(keys): value = values[i] if k == "img": value = torch.stack(value, 0) if k in ["masks", "keypoints", "bboxes", "cls", "segments", "obb"]: value = torch.cat(value, 0) new_batch[k] = value new_batch["batch_idx"] = list(new_batch["batch_idx"]) for i in range(len(new_batch["batch_idx"])): new_batch["batch_idx"][i] += i # add target image index for build_targets() new_batch["batch_idx"] = torch.cat(new_batch["batch_idx"], 0) return new_batch # Classification dataloaders ------------------------------------------------------------------------------------------- class ClassificationDataset(torchvision.datasets.ImageFolder): """ YOLO Classification Dataset. Args: root (str): Dataset path. Attributes: cache_ram (bool): True if images should be cached in RAM, False otherwise. cache_disk (bool): True if images should be cached on disk, False otherwise. samples (list): List of samples containing file, index, npy, and im. torch_transforms (callable): torchvision transforms applied to the dataset. album_transforms (callable, optional): Albumentations transforms applied to the dataset if augment is True. """ def __init__(self, root, args, augment=False, cache=False, prefix=""): """ Initialize YOLO object with root, image size, augmentations, and cache settings. Args: root (str): Dataset path. args (Namespace): Argument parser containing dataset related settings. augment (bool, optional): True if dataset should be augmented, False otherwise. Defaults to False. cache (bool | str | optional): Cache setting, can be True, False, 'ram' or 'disk'. Defaults to False. """ super().__init__(root=root) if augment and args.fraction < 1.0: # reduce training fraction self.samples = self.samples[: round(len(self.samples) * args.fraction)] self.prefix = colorstr(f"{prefix}: ") if prefix else "" self.cache_ram = cache is True or cache == "ram" self.cache_disk = cache == "disk" self.samples = self.verify_images() # filter out bad images self.samples = [list(x) + [Path(x[0]).with_suffix(".npy"), None] for x in self.samples] # file, index, npy, im scale = (1.0 - args.scale, 1.0) # (0.08, 1.0) self.torch_transforms = ( classify_augmentations( size=args.imgsz, scale=scale, hflip=args.fliplr, vflip=args.flipud, erasing=args.erasing, auto_augment=args.auto_augment, hsv_h=args.hsv_h, hsv_s=args.hsv_s, hsv_v=args.hsv_v, ) if augment else classify_transforms(size=args.imgsz, crop_fraction=args.crop_fraction) ) def __getitem__(self, i): """Returns subset of data and targets corresponding to given indices.""" f, j, fn, im = self.samples[i] # filename, index, filename.with_suffix('.npy'), image if self.cache_ram and im is None: im = self.samples[i][3] = cv2.imread(f) elif self.cache_disk: if not fn.exists(): # load npy np.save(fn.as_posix(), cv2.imread(f), allow_pickle=False) im = np.load(fn) else: # read image im = cv2.imread(f) # BGR # Convert NumPy array to PIL image im = Image.fromarray(cv2.cvtColor(im, cv2.COLOR_BGR2RGB)) sample = self.torch_transforms(im) return {"img": sample, "cls": j} def __len__(self) -> int: """Return the total number of samples in the dataset.""" return len(self.samples) def verify_images(self): """Verify all images in dataset.""" desc = f"{self.prefix}Scanning {self.root}..." path = Path(self.root).with_suffix(".cache") # *.cache file path with contextlib.suppress(FileNotFoundError, AssertionError, AttributeError): cache = load_dataset_cache_file(path) # attempt to load a *.cache file assert cache["version"] == DATASET_CACHE_VERSION # matches current version assert cache["hash"] == get_hash([x[0] for x in self.samples]) # identical hash nf, nc, n, samples = cache.pop("results") # found, missing, empty, corrupt, total if LOCAL_RANK in (-1, 0): d = f"{desc} {nf} images, {nc} corrupt" TQDM(None, desc=d, total=n, initial=n) if cache["msgs"]: LOGGER.info("\n".join(cache["msgs"])) # display warnings return samples # Run scan if *.cache retrieval failed nf, nc, msgs, samples, x = 0, 0, [], [], {} with ThreadPool(NUM_THREADS) as pool: results = pool.imap(func=verify_image, iterable=zip(self.samples, repeat(self.prefix))) pbar = TQDM(results, desc=desc, total=len(self.samples)) for sample, nf_f, nc_f, msg in pbar: if nf_f: samples.append(sample) if msg: msgs.append(msg) nf += nf_f nc += nc_f pbar.desc = f"{desc} {nf} images, {nc} corrupt" pbar.close() if msgs: LOGGER.info("\n".join(msgs)) x["hash"] = get_hash([x[0] for x in self.samples]) x["results"] = nf, nc, len(samples), samples x["msgs"] = msgs # warnings save_dataset_cache_file(self.prefix, path, x) return samples def load_dataset_cache_file(path): """Load an Ultralytics *.cache dictionary from path.""" import gc gc.disable() # reduce pickle load time https://github.com/ultralytics/ultralytics/pull/1585 cache = np.load(str(path), allow_pickle=True).item() # load dict gc.enable() return cache def save_dataset_cache_file(prefix, path, x): """Save an Ultralytics dataset *.cache dictionary x to path.""" x["version"] = DATASET_CACHE_VERSION # add cache version if is_dir_writeable(path.parent): if path.exists(): path.unlink() # remove *.cache file if exists np.save(str(path), x) # save cache for next time path.with_suffix(".cache.npy").rename(path) # remove .npy suffix LOGGER.info(f"{prefix}New cache created: {path}") else: LOGGER.warning(f"{prefix}WARNING ⚠️ Cache directory {path.parent} is not writeable, cache not saved.") # TODO: support semantic segmentation class SemanticDataset(BaseDataset): """ Semantic Segmentation Dataset. This class is responsible for handling datasets used for semantic segmentation tasks. It inherits functionalities from the BaseDataset class. Note: This class is currently a placeholder and needs to be populated with methods and attributes for supporting semantic segmentation tasks. """ def __init__(self): """Initialize a SemanticDataset object.""" super().__init__()
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/dataset.py
Python
unknown
16,526
# Ultralytics YOLO 🚀, AGPL-3.0 license from .utils import plot_query_result __all__ = ["plot_query_result"]
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/explorer/__init__.py
Python
unknown
113
# Ultralytics YOLO 🚀, AGPL-3.0 license from io import BytesIO from pathlib import Path from typing import Any, List, Tuple, Union import cv2 import numpy as np import torch from PIL import Image from matplotlib import pyplot as plt from pandas import DataFrame from tqdm import tqdm from ultralytics.data.augment import Format from ultralytics.data.dataset import YOLODataset from ultralytics.data.utils import check_det_dataset from ultralytics.models.yolo.model import YOLO from ultralytics.utils import LOGGER, IterableSimpleNamespace, checks, USER_CONFIG_DIR from .utils import get_sim_index_schema, get_table_schema, plot_query_result, prompt_sql_query, sanitize_batch class ExplorerDataset(YOLODataset): def __init__(self, *args, data: dict = None, **kwargs) -> None: super().__init__(*args, data=data, **kwargs) def load_image(self, i: int) -> Union[Tuple[np.ndarray, Tuple[int, int], Tuple[int, int]], Tuple[None, None, None]]: """Loads 1 image from dataset index 'i' without any resize ops.""" im, f, fn = self.ims[i], self.im_files[i], self.npy_files[i] if im is None: # not cached in RAM if fn.exists(): # load npy im = np.load(fn) else: # read image im = cv2.imread(f) # BGR if im is None: raise FileNotFoundError(f"Image Not Found {f}") h0, w0 = im.shape[:2] # orig hw return im, (h0, w0), im.shape[:2] return self.ims[i], self.im_hw0[i], self.im_hw[i] def build_transforms(self, hyp: IterableSimpleNamespace = None): """Creates transforms for dataset images without resizing.""" return Format( bbox_format="xyxy", normalize=False, return_mask=self.use_segments, return_keypoint=self.use_keypoints, batch_idx=True, mask_ratio=hyp.mask_ratio, mask_overlap=hyp.overlap_mask, ) class Explorer: def __init__( self, data: Union[str, Path] = "coco128.yaml", model: str = "yolov8n.pt", uri: str = USER_CONFIG_DIR / "explorer", ) -> None: # Note duckdb==0.10.0 bug https://github.com/ultralytics/ultralytics/pull/8181 checks.check_requirements(["lancedb>=0.4.3", "duckdb<=0.9.2"]) import lancedb self.connection = lancedb.connect(uri) self.table_name = Path(data).name.lower() + "_" + model.lower() self.sim_idx_base_name = ( f"{self.table_name}_sim_idx".lower() ) # Use this name and append thres and top_k to reuse the table self.model = YOLO(model) self.data = data # None self.choice_set = None self.table = None self.progress = 0 def create_embeddings_table(self, force: bool = False, split: str = "train") -> None: """ Create LanceDB table containing the embeddings of the images in the dataset. The table will be reused if it already exists. Pass force=True to overwrite the existing table. Args: force (bool): Whether to overwrite the existing table or not. Defaults to False. split (str): Split of the dataset to use. Defaults to 'train'. Example: ```python exp = Explorer() exp.create_embeddings_table() ``` """ if self.table is not None and not force: LOGGER.info("Table already exists. Reusing it. Pass force=True to overwrite it.") return if self.table_name in self.connection.table_names() and not force: LOGGER.info(f"Table {self.table_name} already exists. Reusing it. Pass force=True to overwrite it.") self.table = self.connection.open_table(self.table_name) self.progress = 1 return if self.data is None: raise ValueError("Data must be provided to create embeddings table") data_info = check_det_dataset(self.data) if split not in data_info: raise ValueError( f"Split {split} is not found in the dataset. Available keys in the dataset are {list(data_info.keys())}" ) choice_set = data_info[split] choice_set = choice_set if isinstance(choice_set, list) else [choice_set] self.choice_set = choice_set dataset = ExplorerDataset(img_path=choice_set, data=data_info, augment=False, cache=False, task=self.model.task) # Create the table schema batch = dataset[0] vector_size = self.model.embed(batch["im_file"], verbose=False)[0].shape[0] table = self.connection.create_table(self.table_name, schema=get_table_schema(vector_size), mode="overwrite") table.add( self._yield_batches( dataset, data_info, self.model, exclude_keys=["img", "ratio_pad", "resized_shape", "ori_shape", "batch_idx"], ) ) self.table = table def _yield_batches(self, dataset: ExplorerDataset, data_info: dict, model: YOLO, exclude_keys: List[str]): """Generates batches of data for embedding, excluding specified keys.""" for i in tqdm(range(len(dataset))): self.progress = float(i + 1) / len(dataset) batch = dataset[i] for k in exclude_keys: batch.pop(k, None) batch = sanitize_batch(batch, data_info) batch["vector"] = model.embed(batch["im_file"], verbose=False)[0].detach().tolist() yield [batch] def query( self, imgs: Union[str, np.ndarray, List[str], List[np.ndarray]] = None, limit: int = 25 ) -> Any: # pyarrow.Table """ Query the table for similar images. Accepts a single image or a list of images. Args: imgs (str or list): Path to the image or a list of paths to the images. limit (int): Number of results to return. Returns: (pyarrow.Table): An arrow table containing the results. Supports converting to: - pandas dataframe: `result.to_pandas()` - dict of lists: `result.to_pydict()` Example: ```python exp = Explorer() exp.create_embeddings_table() similar = exp.query(img='https://ultralytics.com/images/zidane.jpg') ``` """ if self.table is None: raise ValueError("Table is not created. Please create the table first.") if isinstance(imgs, str): imgs = [imgs] assert isinstance(imgs, list), f"img must be a string or a list of strings. Got {type(imgs)}" embeds = self.model.embed(imgs) # Get avg if multiple images are passed (len > 1) embeds = torch.mean(torch.stack(embeds), 0).cpu().numpy() if len(embeds) > 1 else embeds[0].cpu().numpy() return self.table.search(embeds).limit(limit).to_arrow() def sql_query( self, query: str, return_type: str = "pandas" ) -> Union[DataFrame, Any, None]: # pandas.dataframe or pyarrow.Table """ Run a SQL-Like query on the table. Utilizes LanceDB predicate pushdown. Args: query (str): SQL query to run. return_type (str): Type of the result to return. Can be either 'pandas' or 'arrow'. Defaults to 'pandas'. Returns: (pyarrow.Table): An arrow table containing the results. Example: ```python exp = Explorer() exp.create_embeddings_table() query = "SELECT * FROM 'table' WHERE labels LIKE '%person%'" result = exp.sql_query(query) ``` """ assert return_type in { "pandas", "arrow", }, f"Return type should be either `pandas` or `arrow`, but got {return_type}" import duckdb if self.table is None: raise ValueError("Table is not created. Please create the table first.") # Note: using filter pushdown would be a better long term solution. Temporarily using duckdb for this. table = self.table.to_arrow() # noqa NOTE: Don't comment this. This line is used by DuckDB if not query.startswith("SELECT") and not query.startswith("WHERE"): raise ValueError( f"Query must start with SELECT or WHERE. You can either pass the entire query or just the WHERE clause. found {query}" ) if query.startswith("WHERE"): query = f"SELECT * FROM 'table' {query}" LOGGER.info(f"Running query: {query}") rs = duckdb.sql(query) if return_type == "arrow": return rs.arrow() elif return_type == "pandas": return rs.df() def plot_sql_query(self, query: str, labels: bool = True) -> Image.Image: """ Plot the results of a SQL-Like query on the table. Args: query (str): SQL query to run. labels (bool): Whether to plot the labels or not. Returns: (PIL.Image): Image containing the plot. Example: ```python exp = Explorer() exp.create_embeddings_table() query = "SELECT * FROM 'table' WHERE labels LIKE '%person%'" result = exp.plot_sql_query(query) ``` """ result = self.sql_query(query, return_type="arrow") if len(result) == 0: LOGGER.info("No results found.") return None img = plot_query_result(result, plot_labels=labels) return Image.fromarray(img) def get_similar( self, img: Union[str, np.ndarray, List[str], List[np.ndarray]] = None, idx: Union[int, List[int]] = None, limit: int = 25, return_type: str = "pandas", ) -> Union[DataFrame, Any]: # pandas.dataframe or pyarrow.Table """ Query the table for similar images. Accepts a single image or a list of images. Args: img (str or list): Path to the image or a list of paths to the images. idx (int or list): Index of the image in the table or a list of indexes. limit (int): Number of results to return. Defaults to 25. return_type (str): Type of the result to return. Can be either 'pandas' or 'arrow'. Defaults to 'pandas'. Returns: (pandas.DataFrame): A dataframe containing the results. Example: ```python exp = Explorer() exp.create_embeddings_table() similar = exp.get_similar(img='https://ultralytics.com/images/zidane.jpg') ``` """ assert return_type in { "pandas", "arrow", }, f"Return type should be either `pandas` or `arrow`, but got {return_type}" img = self._check_imgs_or_idxs(img, idx) similar = self.query(img, limit=limit) if return_type == "arrow": return similar elif return_type == "pandas": return similar.to_pandas() def plot_similar( self, img: Union[str, np.ndarray, List[str], List[np.ndarray]] = None, idx: Union[int, List[int]] = None, limit: int = 25, labels: bool = True, ) -> Image.Image: """ Plot the similar images. Accepts images or indexes. Args: img (str or list): Path to the image or a list of paths to the images. idx (int or list): Index of the image in the table or a list of indexes. labels (bool): Whether to plot the labels or not. limit (int): Number of results to return. Defaults to 25. Returns: (PIL.Image): Image containing the plot. Example: ```python exp = Explorer() exp.create_embeddings_table() similar = exp.plot_similar(img='https://ultralytics.com/images/zidane.jpg') ``` """ similar = self.get_similar(img, idx, limit, return_type="arrow") if len(similar) == 0: LOGGER.info("No results found.") return None img = plot_query_result(similar, plot_labels=labels) return Image.fromarray(img) def similarity_index(self, max_dist: float = 0.2, top_k: float = None, force: bool = False) -> DataFrame: """ Calculate the similarity index of all the images in the table. Here, the index will contain the data points that are max_dist or closer to the image in the embedding space at a given index. Args: max_dist (float): maximum L2 distance between the embeddings to consider. Defaults to 0.2. top_k (float): Percentage of the closest data points to consider when counting. Used to apply limit when running vector search. Defaults: None. force (bool): Whether to overwrite the existing similarity index or not. Defaults to True. Returns: (pandas.DataFrame): A dataframe containing the similarity index. Each row corresponds to an image, and columns include indices of similar images and their respective distances. Example: ```python exp = Explorer() exp.create_embeddings_table() sim_idx = exp.similarity_index() ``` """ if self.table is None: raise ValueError("Table is not created. Please create the table first.") sim_idx_table_name = f"{self.sim_idx_base_name}_thres_{max_dist}_top_{top_k}".lower() if sim_idx_table_name in self.connection.table_names() and not force: LOGGER.info("Similarity matrix already exists. Reusing it. Pass force=True to overwrite it.") return self.connection.open_table(sim_idx_table_name).to_pandas() if top_k and not (1.0 >= top_k >= 0.0): raise ValueError(f"top_k must be between 0.0 and 1.0. Got {top_k}") if max_dist < 0.0: raise ValueError(f"max_dist must be greater than 0. Got {max_dist}") top_k = int(top_k * len(self.table)) if top_k else len(self.table) top_k = max(top_k, 1) features = self.table.to_lance().to_table(columns=["vector", "im_file"]).to_pydict() im_files = features["im_file"] embeddings = features["vector"] sim_table = self.connection.create_table(sim_idx_table_name, schema=get_sim_index_schema(), mode="overwrite") def _yield_sim_idx(): """Generates a dataframe with similarity indices and distances for images.""" for i in tqdm(range(len(embeddings))): sim_idx = self.table.search(embeddings[i]).limit(top_k).to_pandas().query(f"_distance <= {max_dist}") yield [ { "idx": i, "im_file": im_files[i], "count": len(sim_idx), "sim_im_files": sim_idx["im_file"].tolist(), } ] sim_table.add(_yield_sim_idx()) self.sim_index = sim_table return sim_table.to_pandas() def plot_similarity_index(self, max_dist: float = 0.2, top_k: float = None, force: bool = False) -> Image: """ Plot the similarity index of all the images in the table. Here, the index will contain the data points that are max_dist or closer to the image in the embedding space at a given index. Args: max_dist (float): maximum L2 distance between the embeddings to consider. Defaults to 0.2. top_k (float): Percentage of closest data points to consider when counting. Used to apply limit when running vector search. Defaults to 0.01. force (bool): Whether to overwrite the existing similarity index or not. Defaults to True. Returns: (PIL.Image): Image containing the plot. Example: ```python exp = Explorer() exp.create_embeddings_table() similarity_idx_plot = exp.plot_similarity_index() similarity_idx_plot.show() # view image preview similarity_idx_plot.save('path/to/save/similarity_index_plot.png') # save contents to file ``` """ sim_idx = self.similarity_index(max_dist=max_dist, top_k=top_k, force=force) sim_count = sim_idx["count"].tolist() sim_count = np.array(sim_count) indices = np.arange(len(sim_count)) # Create the bar plot plt.bar(indices, sim_count) # Customize the plot (optional) plt.xlabel("data idx") plt.ylabel("Count") plt.title("Similarity Count") buffer = BytesIO() plt.savefig(buffer, format="png") buffer.seek(0) # Use Pillow to open the image from the buffer return Image.fromarray(np.array(Image.open(buffer))) def _check_imgs_or_idxs( self, img: Union[str, np.ndarray, List[str], List[np.ndarray], None], idx: Union[None, int, List[int]] ) -> List[np.ndarray]: if img is None and idx is None: raise ValueError("Either img or idx must be provided.") if img is not None and idx is not None: raise ValueError("Only one of img or idx must be provided.") if idx is not None: idx = idx if isinstance(idx, list) else [idx] img = self.table.to_lance().take(idx, columns=["im_file"]).to_pydict()["im_file"] return img if isinstance(img, list) else [img] def ask_ai(self, query): """ Ask AI a question. Args: query (str): Question to ask. Returns: (pandas.DataFrame): A dataframe containing filtered results to the SQL query. Example: ```python exp = Explorer() exp.create_embeddings_table() answer = exp.ask_ai('Show images with 1 person and 2 dogs') ``` """ result = prompt_sql_query(query) try: df = self.sql_query(result) except Exception as e: LOGGER.error("AI generated query is not valid. Please try again with a different prompt") LOGGER.error(e) return None return df def visualize(self, result): """ Visualize the results of a query. TODO. Args: result (pyarrow.Table): Table containing the results of a query. """ pass def generate_report(self, result): """ Generate a report of the dataset. TODO """ pass
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/explorer/explorer.py
Python
unknown
18,782
# Ultralytics YOLO 🚀, AGPL-3.0 license
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/explorer/gui/__init__.py
Python
unknown
42
# Ultralytics YOLO 🚀, AGPL-3.0 license import time from threading import Thread import pandas as pd from ultralytics import Explorer from ultralytics.utils import ROOT, SETTINGS from ultralytics.utils.checks import check_requirements check_requirements(("streamlit>=1.29.0", "streamlit-select>=0.3")) import streamlit as st from streamlit_select import image_select def _get_explorer(): """Initializes and returns an instance of the Explorer class.""" exp = Explorer(data=st.session_state.get("dataset"), model=st.session_state.get("model")) thread = Thread( target=exp.create_embeddings_table, kwargs={"force": st.session_state.get("force_recreate_embeddings")} ) thread.start() progress_bar = st.progress(0, text="Creating embeddings table...") while exp.progress < 1: time.sleep(0.1) progress_bar.progress(exp.progress, text=f"Progress: {exp.progress * 100}%") thread.join() st.session_state["explorer"] = exp progress_bar.empty() def init_explorer_form(): """Initializes an Explorer instance and creates embeddings table with progress tracking.""" datasets = ROOT / "cfg" / "datasets" ds = [d.name for d in datasets.glob("*.yaml")] models = [ "yolov8n.pt", "yolov8s.pt", "yolov8m.pt", "yolov8l.pt", "yolov8x.pt", "yolov8n-seg.pt", "yolov8s-seg.pt", "yolov8m-seg.pt", "yolov8l-seg.pt", "yolov8x-seg.pt", "yolov8n-pose.pt", "yolov8s-pose.pt", "yolov8m-pose.pt", "yolov8l-pose.pt", "yolov8x-pose.pt", ] with st.form(key="explorer_init_form"): col1, col2 = st.columns(2) with col1: st.selectbox("Select dataset", ds, key="dataset", index=ds.index("coco128.yaml")) with col2: st.selectbox("Select model", models, key="model") st.checkbox("Force recreate embeddings", key="force_recreate_embeddings") st.form_submit_button("Explore", on_click=_get_explorer) def query_form(): """Sets up a form in Streamlit to initialize Explorer with dataset and model selection.""" with st.form("query_form"): col1, col2 = st.columns([0.8, 0.2]) with col1: st.text_input( "Query", "WHERE labels LIKE '%person%' AND labels LIKE '%dog%'", label_visibility="collapsed", key="query", ) with col2: st.form_submit_button("Query", on_click=run_sql_query) def ai_query_form(): """Sets up a Streamlit form for user input to initialize Explorer with dataset and model selection.""" with st.form("ai_query_form"): col1, col2 = st.columns([0.8, 0.2]) with col1: st.text_input("Query", "Show images with 1 person and 1 dog", label_visibility="collapsed", key="ai_query") with col2: st.form_submit_button("Ask AI", on_click=run_ai_query) def find_similar_imgs(imgs): """Initializes a Streamlit form for AI-based image querying with custom input.""" exp = st.session_state["explorer"] similar = exp.get_similar(img=imgs, limit=st.session_state.get("limit"), return_type="arrow") paths = similar.to_pydict()["im_file"] st.session_state["imgs"] = paths st.session_state["res"] = similar def similarity_form(selected_imgs): """Initializes a form for AI-based image querying with custom input in Streamlit.""" st.write("Similarity Search") with st.form("similarity_form"): subcol1, subcol2 = st.columns([1, 1]) with subcol1: st.number_input( "limit", min_value=None, max_value=None, value=25, label_visibility="collapsed", key="limit" ) with subcol2: disabled = not len(selected_imgs) st.write("Selected: ", len(selected_imgs)) st.form_submit_button( "Search", disabled=disabled, on_click=find_similar_imgs, args=(selected_imgs,), ) if disabled: st.error("Select at least one image to search.") # def persist_reset_form(): # with st.form("persist_reset"): # col1, col2 = st.columns([1, 1]) # with col1: # st.form_submit_button("Reset", on_click=reset) # # with col2: # st.form_submit_button("Persist", on_click=update_state, args=("PERSISTING", True)) def run_sql_query(): """Executes an SQL query and returns the results.""" st.session_state["error"] = None query = st.session_state.get("query") if query.rstrip().lstrip(): exp = st.session_state["explorer"] res = exp.sql_query(query, return_type="arrow") st.session_state["imgs"] = res.to_pydict()["im_file"] st.session_state["res"] = res def run_ai_query(): """Execute SQL query and update session state with query results.""" if not SETTINGS["openai_api_key"]: st.session_state[ "error" ] = 'OpenAI API key not found in settings. Please run yolo settings openai_api_key="..."' return st.session_state["error"] = None query = st.session_state.get("ai_query") if query.rstrip().lstrip(): exp = st.session_state["explorer"] res = exp.ask_ai(query) if not isinstance(res, pd.DataFrame) or res.empty: st.session_state["error"] = "No results found using AI generated query. Try another query or rerun it." return st.session_state["imgs"] = res["im_file"].to_list() st.session_state["res"] = res def reset_explorer(): """Resets the explorer to its initial state by clearing session variables.""" st.session_state["explorer"] = None st.session_state["imgs"] = None st.session_state["error"] = None def utralytics_explorer_docs_callback(): """Resets the explorer to its initial state by clearing session variables.""" with st.container(border=True): st.image( "https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg", width=100, ) st.markdown( "<p>This demo is built using Ultralytics Explorer API. Visit <a href='https://docs.ultralytics.com/datasets/explorer/'>API docs</a> to try examples & learn more</p>", unsafe_allow_html=True, help=None, ) st.link_button("Ultrlaytics Explorer API", "https://docs.ultralytics.com/datasets/explorer/") def layout(): """Resets explorer session variables and provides documentation with a link to API docs.""" st.set_page_config(layout="wide", initial_sidebar_state="collapsed") st.markdown("<h1 style='text-align: center;'>Ultralytics Explorer Demo</h1>", unsafe_allow_html=True) if st.session_state.get("explorer") is None: init_explorer_form() return st.button(":arrow_backward: Select Dataset", on_click=reset_explorer) exp = st.session_state.get("explorer") col1, col2 = st.columns([0.75, 0.25], gap="small") imgs = [] if st.session_state.get("error"): st.error(st.session_state["error"]) else: if st.session_state.get("imgs"): imgs = st.session_state.get("imgs") else: imgs = exp.table.to_lance().to_table(columns=["im_file"]).to_pydict()["im_file"] st.session_state["res"] = exp.table.to_arrow() total_imgs, selected_imgs = len(imgs), [] with col1: subcol1, subcol2, subcol3, subcol4, subcol5 = st.columns(5) with subcol1: st.write("Max Images Displayed:") with subcol2: num = st.number_input( "Max Images Displayed", min_value=0, max_value=total_imgs, value=min(500, total_imgs), key="num_imgs_displayed", label_visibility="collapsed", ) with subcol3: st.write("Start Index:") with subcol4: start_idx = st.number_input( "Start Index", min_value=0, max_value=total_imgs, value=0, key="start_index", label_visibility="collapsed", ) with subcol5: reset = st.button("Reset", use_container_width=False, key="reset") if reset: st.session_state["imgs"] = None st.experimental_rerun() query_form() ai_query_form() if total_imgs: labels, boxes, masks, kpts, classes = None, None, None, None, None task = exp.model.task if st.session_state.get("display_labels"): labels = st.session_state.get("res").to_pydict()["labels"][start_idx : start_idx + num] boxes = st.session_state.get("res").to_pydict()["bboxes"][start_idx : start_idx + num] masks = st.session_state.get("res").to_pydict()["masks"][start_idx : start_idx + num] kpts = st.session_state.get("res").to_pydict()["keypoints"][start_idx : start_idx + num] classes = st.session_state.get("res").to_pydict()["cls"][start_idx : start_idx + num] imgs_displayed = imgs[start_idx : start_idx + num] selected_imgs = image_select( f"Total samples: {total_imgs}", images=imgs_displayed, use_container_width=False, # indices=[i for i in range(num)] if select_all else None, labels=labels, classes=classes, bboxes=boxes, masks=masks if task == "segment" else None, kpts=kpts if task == "pose" else None, ) with col2: similarity_form(selected_imgs) display_labels = st.checkbox("Labels", value=False, key="display_labels") utralytics_explorer_docs_callback() if __name__ == "__main__": layout()
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/explorer/gui/dash.py
Python
unknown
10,042
# Ultralytics YOLO 🚀, AGPL-3.0 license import getpass from typing import List import cv2 import numpy as np import pandas as pd from ultralytics.data.augment import LetterBox from ultralytics.utils import LOGGER as logger from ultralytics.utils import SETTINGS from ultralytics.utils.checks import check_requirements from ultralytics.utils.ops import xyxy2xywh from ultralytics.utils.plotting import plot_images def get_table_schema(vector_size): """Extracts and returns the schema of a database table.""" from lancedb.pydantic import LanceModel, Vector class Schema(LanceModel): im_file: str labels: List[str] cls: List[int] bboxes: List[List[float]] masks: List[List[List[int]]] keypoints: List[List[List[float]]] vector: Vector(vector_size) return Schema def get_sim_index_schema(): """Returns a LanceModel schema for a database table with specified vector size.""" from lancedb.pydantic import LanceModel class Schema(LanceModel): idx: int im_file: str count: int sim_im_files: List[str] return Schema def sanitize_batch(batch, dataset_info): """Sanitizes input batch for inference, ensuring correct format and dimensions.""" batch["cls"] = batch["cls"].flatten().int().tolist() box_cls_pair = sorted(zip(batch["bboxes"].tolist(), batch["cls"]), key=lambda x: x[1]) batch["bboxes"] = [box for box, _ in box_cls_pair] batch["cls"] = [cls for _, cls in box_cls_pair] batch["labels"] = [dataset_info["names"][i] for i in batch["cls"]] batch["masks"] = batch["masks"].tolist() if "masks" in batch else [[[]]] batch["keypoints"] = batch["keypoints"].tolist() if "keypoints" in batch else [[[]]] return batch def plot_query_result(similar_set, plot_labels=True): """ Plot images from the similar set. Args: similar_set (list): Pyarrow or pandas object containing the similar data points plot_labels (bool): Whether to plot labels or not """ similar_set = ( similar_set.to_dict(orient="list") if isinstance(similar_set, pd.DataFrame) else similar_set.to_pydict() ) empty_masks = [[[]]] empty_boxes = [[]] images = similar_set.get("im_file", []) bboxes = similar_set.get("bboxes", []) if similar_set.get("bboxes") is not empty_boxes else [] masks = similar_set.get("masks") if similar_set.get("masks")[0] != empty_masks else [] kpts = similar_set.get("keypoints") if similar_set.get("keypoints")[0] != empty_masks else [] cls = similar_set.get("cls", []) plot_size = 640 imgs, batch_idx, plot_boxes, plot_masks, plot_kpts = [], [], [], [], [] for i, imf in enumerate(images): im = cv2.imread(imf) im = cv2.cvtColor(im, cv2.COLOR_BGR2RGB) h, w = im.shape[:2] r = min(plot_size / h, plot_size / w) imgs.append(LetterBox(plot_size, center=False)(image=im).transpose(2, 0, 1)) if plot_labels: if len(bboxes) > i and len(bboxes[i]) > 0: box = np.array(bboxes[i], dtype=np.float32) box[:, [0, 2]] *= r box[:, [1, 3]] *= r plot_boxes.append(box) if len(masks) > i and len(masks[i]) > 0: mask = np.array(masks[i], dtype=np.uint8)[0] plot_masks.append(LetterBox(plot_size, center=False)(image=mask)) if len(kpts) > i and kpts[i] is not None: kpt = np.array(kpts[i], dtype=np.float32) kpt[:, :, :2] *= r plot_kpts.append(kpt) batch_idx.append(np.ones(len(np.array(bboxes[i], dtype=np.float32))) * i) imgs = np.stack(imgs, axis=0) masks = np.stack(plot_masks, axis=0) if plot_masks else np.zeros(0, dtype=np.uint8) kpts = np.concatenate(plot_kpts, axis=0) if plot_kpts else np.zeros((0, 51), dtype=np.float32) boxes = xyxy2xywh(np.concatenate(plot_boxes, axis=0)) if plot_boxes else np.zeros(0, dtype=np.float32) batch_idx = np.concatenate(batch_idx, axis=0) cls = np.concatenate([np.array(c, dtype=np.int32) for c in cls], axis=0) return plot_images( imgs, batch_idx, cls, bboxes=boxes, masks=masks, kpts=kpts, max_subplots=len(images), save=False, threaded=False ) def prompt_sql_query(query): """Plots images with optional labels from a similar data set.""" check_requirements("openai>=1.6.1") from openai import OpenAI if not SETTINGS["openai_api_key"]: logger.warning("OpenAI API key not found in settings. Please enter your API key below.") openai_api_key = getpass.getpass("OpenAI API key: ") SETTINGS.update({"openai_api_key": openai_api_key}) openai = OpenAI(api_key=SETTINGS["openai_api_key"]) messages = [ { "role": "system", "content": """ You are a helpful data scientist proficient in SQL. You need to output exactly one SQL query based on the following schema and a user request. You only need to output the format with fixed selection statement that selects everything from "'table'", like `SELECT * from 'table'` Schema: im_file: string not null labels: list<item: string> not null child 0, item: string cls: list<item: int64> not null child 0, item: int64 bboxes: list<item: list<item: double>> not null child 0, item: list<item: double> child 0, item: double masks: list<item: list<item: list<item: int64>>> not null child 0, item: list<item: list<item: int64>> child 0, item: list<item: int64> child 0, item: int64 keypoints: list<item: list<item: list<item: double>>> not null child 0, item: list<item: list<item: double>> child 0, item: list<item: double> child 0, item: double vector: fixed_size_list<item: float>[256] not null child 0, item: float Some details about the schema: - the "labels" column contains the string values like 'person' and 'dog' for the respective objects in each image - the "cls" column contains the integer values on these classes that map them the labels Example of a correct query: request - Get all data points that contain 2 or more people and at least one dog correct query- SELECT * FROM 'table' WHERE ARRAY_LENGTH(cls) >= 2 AND ARRAY_LENGTH(FILTER(labels, x -> x = 'person')) >= 2 AND ARRAY_LENGTH(FILTER(labels, x -> x = 'dog')) >= 1; """, }, {"role": "user", "content": f"{query}"}, ] response = openai.chat.completions.create(model="gpt-3.5-turbo", messages=messages) return response.choices[0].message.content
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/explorer/utils.py
Python
unknown
7,041
# Ultralytics YOLO 🚀, AGPL-3.0 license import glob import math import os import time from dataclasses import dataclass from pathlib import Path from threading import Thread from urllib.parse import urlparse import cv2 import numpy as np import requests import torch from PIL import Image from ultralytics.data.utils import IMG_FORMATS, VID_FORMATS from ultralytics.utils import LOGGER, is_colab, is_kaggle, ops from ultralytics.utils.checks import check_requirements @dataclass class SourceTypes: """Class to represent various types of input sources for predictions.""" webcam: bool = False screenshot: bool = False from_img: bool = False tensor: bool = False class LoadStreams: """ Stream Loader for various types of video streams. Suitable for use with `yolo predict source='rtsp://example.com/media.mp4'`, supports RTSP, RTMP, HTTP, and TCP streams. Attributes: sources (str): The source input paths or URLs for the video streams. vid_stride (int): Video frame-rate stride, defaults to 1. buffer (bool): Whether to buffer input streams, defaults to False. running (bool): Flag to indicate if the streaming thread is running. mode (str): Set to 'stream' indicating real-time capture. imgs (list): List of image frames for each stream. fps (list): List of FPS for each stream. frames (list): List of total frames for each stream. threads (list): List of threads for each stream. shape (list): List of shapes for each stream. caps (list): List of cv2.VideoCapture objects for each stream. bs (int): Batch size for processing. Methods: __init__: Initialize the stream loader. update: Read stream frames in daemon thread. close: Close stream loader and release resources. __iter__: Returns an iterator object for the class. __next__: Returns source paths, transformed, and original images for processing. __len__: Return the length of the sources object. """ def __init__(self, sources="file.streams", vid_stride=1, buffer=False): """Initialize instance variables and check for consistent input stream shapes.""" torch.backends.cudnn.benchmark = True # faster for fixed-size inference self.buffer = buffer # buffer input streams self.running = True # running flag for Thread self.mode = "stream" self.vid_stride = vid_stride # video frame-rate stride sources = Path(sources).read_text().rsplit() if os.path.isfile(sources) else [sources] n = len(sources) self.fps = [0] * n # frames per second self.frames = [0] * n self.threads = [None] * n self.caps = [None] * n # video capture objects self.imgs = [[] for _ in range(n)] # images self.shape = [[] for _ in range(n)] # image shapes self.sources = [ops.clean_str(x) for x in sources] # clean source names for later for i, s in enumerate(sources): # index, source # Start thread to read frames from video stream st = f"{i + 1}/{n}: {s}... " if urlparse(s).hostname in ("www.youtube.com", "youtube.com", "youtu.be"): # if source is YouTube video # YouTube format i.e. 'https://www.youtube.com/watch?v=Zgi9g1ksQHc' or 'https://youtu.be/LNwODJXcvt4' s = get_best_youtube_url(s) s = eval(s) if s.isnumeric() else s # i.e. s = '0' local webcam if s == 0 and (is_colab() or is_kaggle()): raise NotImplementedError( "'source=0' webcam not supported in Colab and Kaggle notebooks. " "Try running 'source=0' in a local environment." ) self.caps[i] = cv2.VideoCapture(s) # store video capture object if not self.caps[i].isOpened(): raise ConnectionError(f"{st}Failed to open {s}") w = int(self.caps[i].get(cv2.CAP_PROP_FRAME_WIDTH)) h = int(self.caps[i].get(cv2.CAP_PROP_FRAME_HEIGHT)) fps = self.caps[i].get(cv2.CAP_PROP_FPS) # warning: may return 0 or nan self.frames[i] = max(int(self.caps[i].get(cv2.CAP_PROP_FRAME_COUNT)), 0) or float( "inf" ) # infinite stream fallback self.fps[i] = max((fps if math.isfinite(fps) else 0) % 100, 0) or 30 # 30 FPS fallback success, im = self.caps[i].read() # guarantee first frame if not success or im is None: raise ConnectionError(f"{st}Failed to read images from {s}") self.imgs[i].append(im) self.shape[i] = im.shape self.threads[i] = Thread(target=self.update, args=([i, self.caps[i], s]), daemon=True) LOGGER.info(f"{st}Success ✅ ({self.frames[i]} frames of shape {w}x{h} at {self.fps[i]:.2f} FPS)") self.threads[i].start() LOGGER.info("") # newline # Check for common shapes self.bs = self.__len__() def update(self, i, cap, stream): """Read stream `i` frames in daemon thread.""" n, f = 0, self.frames[i] # frame number, frame array while self.running and cap.isOpened() and n < (f - 1): if len(self.imgs[i]) < 30: # keep a <=30-image buffer n += 1 cap.grab() # .read() = .grab() followed by .retrieve() if n % self.vid_stride == 0: success, im = cap.retrieve() if not success: im = np.zeros(self.shape[i], dtype=np.uint8) LOGGER.warning("WARNING ⚠️ Video stream unresponsive, please check your IP camera connection.") cap.open(stream) # re-open stream if signal was lost if self.buffer: self.imgs[i].append(im) else: self.imgs[i] = [im] else: time.sleep(0.01) # wait until the buffer is empty def close(self): """Close stream loader and release resources.""" self.running = False # stop flag for Thread for thread in self.threads: if thread.is_alive(): thread.join(timeout=5) # Add timeout for cap in self.caps: # Iterate through the stored VideoCapture objects try: cap.release() # release video capture except Exception as e: LOGGER.warning(f"WARNING ⚠️ Could not release VideoCapture object: {e}") cv2.destroyAllWindows() def __iter__(self): """Iterates through YOLO image feed and re-opens unresponsive streams.""" self.count = -1 return self def __next__(self): """Returns source paths, transformed and original images for processing.""" self.count += 1 images = [] for i, x in enumerate(self.imgs): # Wait until a frame is available in each buffer while not x: if not self.threads[i].is_alive() or cv2.waitKey(1) == ord("q"): # q to quit self.close() raise StopIteration time.sleep(1 / min(self.fps)) x = self.imgs[i] if not x: LOGGER.warning(f"WARNING ⚠️ Waiting for stream {i}") # Get and remove the first frame from imgs buffer if self.buffer: images.append(x.pop(0)) # Get the last frame, and clear the rest from the imgs buffer else: images.append(x.pop(-1) if x else np.zeros(self.shape[i], dtype=np.uint8)) x.clear() return self.sources, images, None, "" def __len__(self): """Return the length of the sources object.""" return len(self.sources) # 1E12 frames = 32 streams at 30 FPS for 30 years class LoadScreenshots: """ YOLOv8 screenshot dataloader. This class manages the loading of screenshot images for processing with YOLOv8. Suitable for use with `yolo predict source=screen`. Attributes: source (str): The source input indicating which screen to capture. screen (int): The screen number to capture. left (int): The left coordinate for screen capture area. top (int): The top coordinate for screen capture area. width (int): The width of the screen capture area. height (int): The height of the screen capture area. mode (str): Set to 'stream' indicating real-time capture. frame (int): Counter for captured frames. sct (mss.mss): Screen capture object from `mss` library. bs (int): Batch size, set to 1. monitor (dict): Monitor configuration details. Methods: __iter__: Returns an iterator object. __next__: Captures the next screenshot and returns it. """ def __init__(self, source): """Source = [screen_number left top width height] (pixels).""" check_requirements("mss") import mss # noqa source, *params = source.split() self.screen, left, top, width, height = 0, None, None, None, None # default to full screen 0 if len(params) == 1: self.screen = int(params[0]) elif len(params) == 4: left, top, width, height = (int(x) for x in params) elif len(params) == 5: self.screen, left, top, width, height = (int(x) for x in params) self.mode = "stream" self.frame = 0 self.sct = mss.mss() self.bs = 1 # Parse monitor shape monitor = self.sct.monitors[self.screen] self.top = monitor["top"] if top is None else (monitor["top"] + top) self.left = monitor["left"] if left is None else (monitor["left"] + left) self.width = width or monitor["width"] self.height = height or monitor["height"] self.monitor = {"left": self.left, "top": self.top, "width": self.width, "height": self.height} def __iter__(self): """Returns an iterator of the object.""" return self def __next__(self): """mss screen capture: get raw pixels from the screen as np array.""" im0 = np.asarray(self.sct.grab(self.monitor))[:, :, :3] # BGRA to BGR s = f"screen {self.screen} (LTWH): {self.left},{self.top},{self.width},{self.height}: " self.frame += 1 return [str(self.screen)], [im0], None, s # screen, img, vid_cap, string class LoadImages: """ YOLOv8 image/video dataloader. This class manages the loading and pre-processing of image and video data for YOLOv8. It supports loading from various formats, including single image files, video files, and lists of image and video paths. Attributes: files (list): List of image and video file paths. nf (int): Total number of files (images and videos). video_flag (list): Flags indicating whether a file is a video (True) or an image (False). mode (str): Current mode, 'image' or 'video'. vid_stride (int): Stride for video frame-rate, defaults to 1. bs (int): Batch size, set to 1 for this class. cap (cv2.VideoCapture): Video capture object for OpenCV. frame (int): Frame counter for video. frames (int): Total number of frames in the video. count (int): Counter for iteration, initialized at 0 during `__iter__()`. Methods: _new_video(path): Create a new cv2.VideoCapture object for a given video path. """ def __init__(self, path, vid_stride=1): """Initialize the Dataloader and raise FileNotFoundError if file not found.""" parent = None if isinstance(path, str) and Path(path).suffix == ".txt": # *.txt file with img/vid/dir on each line parent = Path(path).parent path = Path(path).read_text().splitlines() # list of sources files = [] for p in sorted(path) if isinstance(path, (list, tuple)) else [path]: a = str(Path(p).absolute()) # do not use .resolve() https://github.com/ultralytics/ultralytics/issues/2912 if "*" in a: files.extend(sorted(glob.glob(a, recursive=True))) # glob elif os.path.isdir(a): files.extend(sorted(glob.glob(os.path.join(a, "*.*")))) # dir elif os.path.isfile(a): files.append(a) # files (absolute or relative to CWD) elif parent and (parent / p).is_file(): files.append(str((parent / p).absolute())) # files (relative to *.txt file parent) else: raise FileNotFoundError(f"{p} does not exist") images = [x for x in files if x.split(".")[-1].lower() in IMG_FORMATS] videos = [x for x in files if x.split(".")[-1].lower() in VID_FORMATS] ni, nv = len(images), len(videos) self.files = images + videos self.nf = ni + nv # number of files self.video_flag = [False] * ni + [True] * nv self.mode = "image" self.vid_stride = vid_stride # video frame-rate stride self.bs = 1 if any(videos): self._new_video(videos[0]) # new video else: self.cap = None if self.nf == 0: raise FileNotFoundError( f"No images or videos found in {p}. " f"Supported formats are:\nimages: {IMG_FORMATS}\nvideos: {VID_FORMATS}" ) def __iter__(self): """Returns an iterator object for VideoStream or ImageFolder.""" self.count = 0 return self def __next__(self): """Return next image, path and metadata from dataset.""" if self.count == self.nf: raise StopIteration path = self.files[self.count] if self.video_flag[self.count]: # Read video self.mode = "video" for _ in range(self.vid_stride): self.cap.grab() success, im0 = self.cap.retrieve() while not success: self.count += 1 self.cap.release() if self.count == self.nf: # last video raise StopIteration path = self.files[self.count] self._new_video(path) success, im0 = self.cap.read() self.frame += 1 # im0 = self._cv2_rotate(im0) # for use if cv2 autorotation is False s = f"video {self.count + 1}/{self.nf} ({self.frame}/{self.frames}) {path}: " else: # Read image self.count += 1 im0 = cv2.imread(path) # BGR if im0 is None: raise FileNotFoundError(f"Image Not Found {path}") s = f"image {self.count}/{self.nf} {path}: " return [path], [im0], self.cap, s def _new_video(self, path): """Create a new video capture object.""" self.frame = 0 self.cap = cv2.VideoCapture(path) self.frames = int(self.cap.get(cv2.CAP_PROP_FRAME_COUNT) / self.vid_stride) def __len__(self): """Returns the number of files in the object.""" return self.nf # number of files class LoadPilAndNumpy: """ Load images from PIL and Numpy arrays for batch processing. This class is designed to manage loading and pre-processing of image data from both PIL and Numpy formats. It performs basic validation and format conversion to ensure that the images are in the required format for downstream processing. Attributes: paths (list): List of image paths or autogenerated filenames. im0 (list): List of images stored as Numpy arrays. mode (str): Type of data being processed, defaults to 'image'. bs (int): Batch size, equivalent to the length of `im0`. count (int): Counter for iteration, initialized at 0 during `__iter__()`. Methods: _single_check(im): Validate and format a single image to a Numpy array. """ def __init__(self, im0): """Initialize PIL and Numpy Dataloader.""" if not isinstance(im0, list): im0 = [im0] self.paths = [getattr(im, "filename", f"image{i}.jpg") for i, im in enumerate(im0)] self.im0 = [self._single_check(im) for im in im0] self.mode = "image" # Generate fake paths self.bs = len(self.im0) @staticmethod def _single_check(im): """Validate and format an image to numpy array.""" assert isinstance(im, (Image.Image, np.ndarray)), f"Expected PIL/np.ndarray image type, but got {type(im)}" if isinstance(im, Image.Image): if im.mode != "RGB": im = im.convert("RGB") im = np.asarray(im)[:, :, ::-1] im = np.ascontiguousarray(im) # contiguous return im def __len__(self): """Returns the length of the 'im0' attribute.""" return len(self.im0) def __next__(self): """Returns batch paths, images, processed images, None, ''.""" if self.count == 1: # loop only once as it's batch inference raise StopIteration self.count += 1 return self.paths, self.im0, None, "" def __iter__(self): """Enables iteration for class LoadPilAndNumpy.""" self.count = 0 return self class LoadTensor: """ Load images from torch.Tensor data. This class manages the loading and pre-processing of image data from PyTorch tensors for further processing. Attributes: im0 (torch.Tensor): The input tensor containing the image(s). bs (int): Batch size, inferred from the shape of `im0`. mode (str): Current mode, set to 'image'. paths (list): List of image paths or filenames. count (int): Counter for iteration, initialized at 0 during `__iter__()`. Methods: _single_check(im, stride): Validate and possibly modify the input tensor. """ def __init__(self, im0) -> None: """Initialize Tensor Dataloader.""" self.im0 = self._single_check(im0) self.bs = self.im0.shape[0] self.mode = "image" self.paths = [getattr(im, "filename", f"image{i}.jpg") for i, im in enumerate(im0)] @staticmethod def _single_check(im, stride=32): """Validate and format an image to torch.Tensor.""" s = ( f"WARNING ⚠️ torch.Tensor inputs should be BCHW i.e. shape(1, 3, 640, 640) " f"divisible by stride {stride}. Input shape{tuple(im.shape)} is incompatible." ) if len(im.shape) != 4: if len(im.shape) != 3: raise ValueError(s) LOGGER.warning(s) im = im.unsqueeze(0) if im.shape[2] % stride or im.shape[3] % stride: raise ValueError(s) if im.max() > 1.0 + torch.finfo(im.dtype).eps: # torch.float32 eps is 1.2e-07 LOGGER.warning( f"WARNING ⚠️ torch.Tensor inputs should be normalized 0.0-1.0 but max value is {im.max()}. " f"Dividing input by 255." ) im = im.float() / 255.0 return im def __iter__(self): """Returns an iterator object.""" self.count = 0 return self def __next__(self): """Return next item in the iterator.""" if self.count == 1: raise StopIteration self.count += 1 return self.paths, self.im0, None, "" def __len__(self): """Returns the batch size.""" return self.bs def autocast_list(source): """Merges a list of source of different types into a list of numpy arrays or PIL images.""" files = [] for im in source: if isinstance(im, (str, Path)): # filename or uri files.append(Image.open(requests.get(im, stream=True).raw if str(im).startswith("http") else im)) elif isinstance(im, (Image.Image, np.ndarray)): # PIL or np Image files.append(im) else: raise TypeError( f"type {type(im).__name__} is not a supported Ultralytics prediction source type. \n" f"See https://docs.ultralytics.com/modes/predict for supported source types." ) return files LOADERS = LoadStreams, LoadPilAndNumpy, LoadImages, LoadScreenshots # tuple def get_best_youtube_url(url, use_pafy=True): """ Retrieves the URL of the best quality MP4 video stream from a given YouTube video. This function uses the pafy or yt_dlp library to extract the video info from YouTube. It then finds the highest quality MP4 format that has video codec but no audio codec, and returns the URL of this video stream. Args: url (str): The URL of the YouTube video. use_pafy (bool): Use the pafy package, default=True, otherwise use yt_dlp package. Returns: (str): The URL of the best quality MP4 video stream, or None if no suitable stream is found. """ if use_pafy: check_requirements(("pafy", "youtube_dl==2020.12.2")) import pafy # noqa return pafy.new(url).getbestvideo(preftype="mp4").url else: check_requirements("yt-dlp") import yt_dlp with yt_dlp.YoutubeDL({"quiet": True}) as ydl: info_dict = ydl.extract_info(url, download=False) # extract info for f in reversed(info_dict.get("formats", [])): # reversed because best is usually last # Find a format with video codec, no audio, *.mp4 extension at least 1920x1080 size good_size = (f.get("width") or 0) >= 1920 or (f.get("height") or 0) >= 1080 if good_size and f["vcodec"] != "none" and f["acodec"] == "none" and f["ext"] == "mp4": return f.get("url")
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/loaders.py
Python
unknown
21,910
#!/bin/bash # Ultralytics YOLO 🚀, AGPL-3.0 license # Download latest models from https://github.com/ultralytics/assets/releases # Example usage: bash ultralytics/data/scripts/download_weights.sh # parent # └── weights # ├── yolov8n.pt ← downloads here # ├── yolov8s.pt # └── ... python - <<EOF from ultralytics.utils.downloads import attempt_download_asset assets = [f'yolov8{size}{suffix}.pt' for size in 'nsmlx' for suffix in ('', '-cls', '-seg', '-pose')] for x in assets: attempt_download_asset(f'weights/{x}') EOF
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/scripts/download_weights.sh
Shell
unknown
568
#!/bin/bash # Ultralytics YOLO 🚀, AGPL-3.0 license # Download COCO 2017 dataset https://cocodataset.org # Example usage: bash data/scripts/get_coco.sh # parent # ├── ultralytics # └── datasets # └── coco ← downloads here # Arguments (optional) Usage: bash data/scripts/get_coco.sh --train --val --test --segments if [ "$#" -gt 0 ]; then for opt in "$@"; do case "${opt}" in --train) train=true ;; --val) val=true ;; --test) test=true ;; --segments) segments=true ;; --sama) sama=true ;; esac done else train=true val=true test=false segments=false sama=false fi # Download/unzip labels d='../datasets' # unzip directory url=https://github.com/ultralytics/yolov5/releases/download/v1.0/ if [ "$segments" == "true" ]; then f='coco2017labels-segments.zip' # 169 MB elif [ "$sama" == "true" ]; then f='coco2017labels-segments-sama.zip' # 199 MB https://www.sama.com/sama-coco-dataset/ else f='coco2017labels.zip' # 46 MB fi echo 'Downloading' $url$f ' ...' curl -L $url$f -o $f -# && unzip -q $f -d $d && rm $f & # Download/unzip images d='../datasets/coco/images' # unzip directory url=http://images.cocodataset.org/zips/ if [ "$train" == "true" ]; then f='train2017.zip' # 19G, 118k images echo 'Downloading' $url$f '...' curl -L $url$f -o $f -# && unzip -q $f -d $d && rm $f & fi if [ "$val" == "true" ]; then f='val2017.zip' # 1G, 5k images echo 'Downloading' $url$f '...' curl -L $url$f -o $f -# && unzip -q $f -d $d && rm $f & fi if [ "$test" == "true" ]; then f='test2017.zip' # 7G, 41k images (optional) echo 'Downloading' $url$f '...' curl -L $url$f -o $f -# && unzip -q $f -d $d && rm $f & fi wait # finish background tasks
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/scripts/get_coco.sh
Shell
unknown
1,727
#!/bin/bash # Ultralytics YOLO 🚀, AGPL-3.0 license # Download COCO128 dataset https://www.kaggle.com/ultralytics/coco128 (first 128 images from COCO train2017) # Example usage: bash data/scripts/get_coco128.sh # parent # ├── ultralytics # └── datasets # └── coco128 ← downloads here # Download/unzip images and labels d='../datasets' # unzip directory url=https://github.com/ultralytics/yolov5/releases/download/v1.0/ f='coco128.zip' # or 'coco128-segments.zip', 68 MB echo 'Downloading' $url$f ' ...' curl -L $url$f -o $f -# && unzip -q $f -d $d && rm $f & wait # finish background tasks
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/scripts/get_coco128.sh
Shell
unknown
619
#!/bin/bash # Ultralytics YOLO 🚀, AGPL-3.0 license # Download ILSVRC2012 ImageNet dataset https://image-net.org # Example usage: bash data/scripts/get_imagenet.sh # parent # ├── ultralytics # └── datasets # └── imagenet ← downloads here # Arguments (optional) Usage: bash data/scripts/get_imagenet.sh --train --val if [ "$#" -gt 0 ]; then for opt in "$@"; do case "${opt}" in --train) train=true ;; --val) val=true ;; esac done else train=true val=true fi # Make dir d='../datasets/imagenet' # unzip directory mkdir -p $d && cd $d # Download/unzip train if [ "$train" == "true" ]; then wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_train.tar # download 138G, 1281167 images mkdir train && mv ILSVRC2012_img_train.tar train/ && cd train tar -xf ILSVRC2012_img_train.tar && rm -f ILSVRC2012_img_train.tar find . -name "*.tar" | while read NAME; do mkdir -p "${NAME%.tar}" tar -xf "${NAME}" -C "${NAME%.tar}" rm -f "${NAME}" done cd .. fi # Download/unzip val if [ "$val" == "true" ]; then wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_val.tar # download 6.3G, 50000 images mkdir val && mv ILSVRC2012_img_val.tar val/ && cd val && tar -xf ILSVRC2012_img_val.tar wget -qO- https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh | bash # move into subdirs fi # Delete corrupted image (optional: PNG under JPEG name that may cause dataloaders to fail) # rm train/n04266014/n04266014_10835.JPEG # TFRecords (optional) # wget https://raw.githubusercontent.com/tensorflow/models/master/research/slim/datasets/imagenet_lsvrc_2015_synsets.txt
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/scripts/get_imagenet.sh
Shell
unknown
1,672
# Ultralytics YOLO 🚀, AGPL-3.0 license import itertools from glob import glob from math import ceil from pathlib import Path import cv2 import numpy as np from PIL import Image from tqdm import tqdm from ultralytics.data.utils import exif_size, img2label_paths from ultralytics.utils.checks import check_requirements check_requirements("shapely") from shapely.geometry import Polygon def bbox_iof(polygon1, bbox2, eps=1e-6): """ Calculate iofs between bbox1 and bbox2. Args: polygon1 (np.ndarray): Polygon coordinates, (n, 8). bbox2 (np.ndarray): Bounding boxes, (n ,4). """ polygon1 = polygon1.reshape(-1, 4, 2) lt_point = np.min(polygon1, axis=-2) rb_point = np.max(polygon1, axis=-2) bbox1 = np.concatenate([lt_point, rb_point], axis=-1) lt = np.maximum(bbox1[:, None, :2], bbox2[..., :2]) rb = np.minimum(bbox1[:, None, 2:], bbox2[..., 2:]) wh = np.clip(rb - lt, 0, np.inf) h_overlaps = wh[..., 0] * wh[..., 1] l, t, r, b = (bbox2[..., i] for i in range(4)) polygon2 = np.stack([l, t, r, t, r, b, l, b], axis=-1).reshape(-1, 4, 2) sg_polys1 = [Polygon(p) for p in polygon1] sg_polys2 = [Polygon(p) for p in polygon2] overlaps = np.zeros(h_overlaps.shape) for p in zip(*np.nonzero(h_overlaps)): overlaps[p] = sg_polys1[p[0]].intersection(sg_polys2[p[-1]]).area unions = np.array([p.area for p in sg_polys1], dtype=np.float32) unions = unions[..., None] unions = np.clip(unions, eps, np.inf) outputs = overlaps / unions if outputs.ndim == 1: outputs = outputs[..., None] return outputs def load_yolo_dota(data_root, split="train"): """ Load DOTA dataset. Args: data_root (str): Data root. split (str): The split data set, could be train or val. Notes: The directory structure assumed for the DOTA dataset: - data_root - images - train - val - labels - train - val """ assert split in ["train", "val"] im_dir = Path(data_root) / "images" / split assert im_dir.exists(), f"Can't find {im_dir}, please check your data root." im_files = glob(str(Path(data_root) / "images" / split / "*")) lb_files = img2label_paths(im_files) annos = [] for im_file, lb_file in zip(im_files, lb_files): w, h = exif_size(Image.open(im_file)) with open(lb_file) as f: lb = [x.split() for x in f.read().strip().splitlines() if len(x)] lb = np.array(lb, dtype=np.float32) annos.append(dict(ori_size=(h, w), label=lb, filepath=im_file)) return annos def get_windows(im_size, crop_sizes=[1024], gaps=[200], im_rate_thr=0.6, eps=0.01): """ Get the coordinates of windows. Args: im_size (tuple): Original image size, (h, w). crop_sizes (List(int)): Crop size of windows. gaps (List(int)): Gap between crops. im_rate_thr (float): Threshold of windows areas divided by image ares. """ h, w = im_size windows = [] for crop_size, gap in zip(crop_sizes, gaps): assert crop_size > gap, f"invalid crop_size gap pair [{crop_size} {gap}]" step = crop_size - gap xn = 1 if w <= crop_size else ceil((w - crop_size) / step + 1) xs = [step * i for i in range(xn)] if len(xs) > 1 and xs[-1] + crop_size > w: xs[-1] = w - crop_size yn = 1 if h <= crop_size else ceil((h - crop_size) / step + 1) ys = [step * i for i in range(yn)] if len(ys) > 1 and ys[-1] + crop_size > h: ys[-1] = h - crop_size start = np.array(list(itertools.product(xs, ys)), dtype=np.int64) stop = start + crop_size windows.append(np.concatenate([start, stop], axis=1)) windows = np.concatenate(windows, axis=0) im_in_wins = windows.copy() im_in_wins[:, 0::2] = np.clip(im_in_wins[:, 0::2], 0, w) im_in_wins[:, 1::2] = np.clip(im_in_wins[:, 1::2], 0, h) im_areas = (im_in_wins[:, 2] - im_in_wins[:, 0]) * (im_in_wins[:, 3] - im_in_wins[:, 1]) win_areas = (windows[:, 2] - windows[:, 0]) * (windows[:, 3] - windows[:, 1]) im_rates = im_areas / win_areas if not (im_rates > im_rate_thr).any(): max_rate = im_rates.max() im_rates[abs(im_rates - max_rate) < eps] = 1 return windows[im_rates > im_rate_thr] def get_window_obj(anno, windows, iof_thr=0.7): """Get objects for each window.""" h, w = anno["ori_size"] label = anno["label"] if len(label): label[:, 1::2] *= w label[:, 2::2] *= h iofs = bbox_iof(label[:, 1:], windows) # Unnormalized and misaligned coordinates return [(label[iofs[:, i] >= iof_thr]) for i in range(len(windows))] # window_anns else: return [np.zeros((0, 9), dtype=np.float32) for _ in range(len(windows))] # window_anns def crop_and_save(anno, windows, window_objs, im_dir, lb_dir): """ Crop images and save new labels. Args: anno (dict): Annotation dict, including `filepath`, `label`, `ori_size` as its keys. windows (list): A list of windows coordinates. window_objs (list): A list of labels inside each window. im_dir (str): The output directory path of images. lb_dir (str): The output directory path of labels. Notes: The directory structure assumed for the DOTA dataset: - data_root - images - train - val - labels - train - val """ im = cv2.imread(anno["filepath"]) name = Path(anno["filepath"]).stem for i, window in enumerate(windows): x_start, y_start, x_stop, y_stop = window.tolist() new_name = f"{name}__{x_stop - x_start}__{x_start}___{y_start}" patch_im = im[y_start:y_stop, x_start:x_stop] ph, pw = patch_im.shape[:2] cv2.imwrite(str(Path(im_dir) / f"{new_name}.jpg"), patch_im) label = window_objs[i] if len(label) == 0: continue label[:, 1::2] -= x_start label[:, 2::2] -= y_start label[:, 1::2] /= pw label[:, 2::2] /= ph with open(Path(lb_dir) / f"{new_name}.txt", "w") as f: for lb in label: formatted_coords = ["{:.6g}".format(coord) for coord in lb[1:]] f.write(f"{int(lb[0])} {' '.join(formatted_coords)}\n") def split_images_and_labels(data_root, save_dir, split="train", crop_sizes=[1024], gaps=[200]): """ Split both images and labels. Notes: The directory structure assumed for the DOTA dataset: - data_root - images - split - labels - split and the output directory structure is: - save_dir - images - split - labels - split """ im_dir = Path(save_dir) / "images" / split im_dir.mkdir(parents=True, exist_ok=True) lb_dir = Path(save_dir) / "labels" / split lb_dir.mkdir(parents=True, exist_ok=True) annos = load_yolo_dota(data_root, split=split) for anno in tqdm(annos, total=len(annos), desc=split): windows = get_windows(anno["ori_size"], crop_sizes, gaps) window_objs = get_window_obj(anno, windows) crop_and_save(anno, windows, window_objs, str(im_dir), str(lb_dir)) def split_trainval(data_root, save_dir, crop_size=1024, gap=200, rates=[1.0]): """ Split train and val set of DOTA. Notes: The directory structure assumed for the DOTA dataset: - data_root - images - train - val - labels - train - val and the output directory structure is: - save_dir - images - train - val - labels - train - val """ crop_sizes, gaps = [], [] for r in rates: crop_sizes.append(int(crop_size / r)) gaps.append(int(gap / r)) for split in ["train", "val"]: split_images_and_labels(data_root, save_dir, split, crop_sizes, gaps) def split_test(data_root, save_dir, crop_size=1024, gap=200, rates=[1.0]): """ Split test set of DOTA, labels are not included within this set. Notes: The directory structure assumed for the DOTA dataset: - data_root - images - test and the output directory structure is: - save_dir - images - test """ crop_sizes, gaps = [], [] for r in rates: crop_sizes.append(int(crop_size / r)) gaps.append(int(gap / r)) save_dir = Path(save_dir) / "images" / "test" save_dir.mkdir(parents=True, exist_ok=True) im_dir = Path(data_root) / "images" / "test" assert im_dir.exists(), f"Can't find {im_dir}, please check your data root." im_files = glob(str(im_dir / "*")) for im_file in tqdm(im_files, total=len(im_files), desc="test"): w, h = exif_size(Image.open(im_file)) windows = get_windows((h, w), crop_sizes=crop_sizes, gaps=gaps) im = cv2.imread(im_file) name = Path(im_file).stem for window in windows: x_start, y_start, x_stop, y_stop = window.tolist() new_name = f"{name}__{x_stop - x_start}__{x_start}___{y_start}" patch_im = im[y_start:y_stop, x_start:x_stop] cv2.imwrite(str(save_dir / f"{new_name}.jpg"), patch_im) if __name__ == "__main__": split_trainval(data_root="DOTAv2", save_dir="DOTAv2-split") split_test(data_root="DOTAv2", save_dir="DOTAv2-split")
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/split_dota.py
Python
unknown
9,961
# Ultralytics YOLO 🚀, AGPL-3.0 license import contextlib import hashlib import json import os import random import subprocess import time import zipfile from multiprocessing.pool import ThreadPool from pathlib import Path from tarfile import is_tarfile import cv2 import numpy as np from PIL import Image, ImageOps from ultralytics.nn.autobackend import check_class_names from ultralytics.utils import ( DATASETS_DIR, LOGGER, NUM_THREADS, ROOT, SETTINGS_YAML, TQDM, clean_url, colorstr, emojis, yaml_load, yaml_save, ) from ultralytics.utils.checks import check_file, check_font, is_ascii from ultralytics.utils.downloads import download, safe_download, unzip_file from ultralytics.utils.ops import segments2boxes HELP_URL = "See https://docs.ultralytics.com/datasets/detect for dataset formatting guidance." IMG_FORMATS = "bmp", "dng", "jpeg", "jpg", "mpo", "png", "tif", "tiff", "webp", "pfm" # image suffixes VID_FORMATS = "asf", "avi", "gif", "m4v", "mkv", "mov", "mp4", "mpeg", "mpg", "ts", "wmv", "webm" # video suffixes PIN_MEMORY = str(os.getenv("PIN_MEMORY", True)).lower() == "true" # global pin_memory for dataloaders def img2label_paths(img_paths): """Define label paths as a function of image paths.""" sa, sb = f"{os.sep}images{os.sep}", f"{os.sep}labels{os.sep}" # /images/, /labels/ substrings return [sb.join(x.rsplit(sa, 1)).rsplit(".", 1)[0] + ".txt" for x in img_paths] def get_hash(paths): """Returns a single hash value of a list of paths (files or dirs).""" size = sum(os.path.getsize(p) for p in paths if os.path.exists(p)) # sizes h = hashlib.sha256(str(size).encode()) # hash sizes h.update("".join(paths).encode()) # hash paths return h.hexdigest() # return hash def exif_size(img: Image.Image): """Returns exif-corrected PIL size.""" s = img.size # (width, height) if img.format == "JPEG": # only support JPEG images with contextlib.suppress(Exception): exif = img.getexif() if exif: rotation = exif.get(274, None) # the EXIF key for the orientation tag is 274 if rotation in [6, 8]: # rotation 270 or 90 s = s[1], s[0] return s def verify_image(args): """Verify one image.""" (im_file, cls), prefix = args # Number (found, corrupt), message nf, nc, msg = 0, 0, "" try: im = Image.open(im_file) im.verify() # PIL verify shape = exif_size(im) # image size shape = (shape[1], shape[0]) # hw assert (shape[0] > 9) & (shape[1] > 9), f"image size {shape} <10 pixels" assert im.format.lower() in IMG_FORMATS, f"invalid image format {im.format}" if im.format.lower() in ("jpg", "jpeg"): with open(im_file, "rb") as f: f.seek(-2, 2) if f.read() != b"\xff\xd9": # corrupt JPEG ImageOps.exif_transpose(Image.open(im_file)).save(im_file, "JPEG", subsampling=0, quality=100) msg = f"{prefix}WARNING ⚠️ {im_file}: corrupt JPEG restored and saved" nf = 1 except Exception as e: nc = 1 msg = f"{prefix}WARNING ⚠️ {im_file}: ignoring corrupt image/label: {e}" return (im_file, cls), nf, nc, msg def verify_image_label(args): """Verify one image-label pair.""" im_file, lb_file, prefix, keypoint, num_cls, nkpt, ndim = args # Number (missing, found, empty, corrupt), message, segments, keypoints nm, nf, ne, nc, msg, segments, keypoints = 0, 0, 0, 0, "", [], None try: # Verify images im = Image.open(im_file) im.verify() # PIL verify shape = exif_size(im) # image size shape = (shape[1], shape[0]) # hw assert (shape[0] > 9) & (shape[1] > 9), f"image size {shape} <10 pixels" assert im.format.lower() in IMG_FORMATS, f"invalid image format {im.format}" if im.format.lower() in ("jpg", "jpeg"): with open(im_file, "rb") as f: f.seek(-2, 2) if f.read() != b"\xff\xd9": # corrupt JPEG ImageOps.exif_transpose(Image.open(im_file)).save(im_file, "JPEG", subsampling=0, quality=100) msg = f"{prefix}WARNING ⚠️ {im_file}: corrupt JPEG restored and saved" # Verify labels if os.path.isfile(lb_file): nf = 1 # label found with open(lb_file) as f: lb = [x.split() for x in f.read().strip().splitlines() if len(x)] if any(len(x) > 6 for x in lb) and (not keypoint): # is segment classes = np.array([x[0] for x in lb], dtype=np.float32) segments = [np.array(x[1:], dtype=np.float32).reshape(-1, 2) for x in lb] # (cls, xy1...) lb = np.concatenate((classes.reshape(-1, 1), segments2boxes(segments)), 1) # (cls, xywh) lb = np.array(lb, dtype=np.float32) nl = len(lb) if nl: if keypoint: assert lb.shape[1] == (5 + nkpt * ndim), f"labels require {(5 + nkpt * ndim)} columns each" points = lb[:, 5:].reshape(-1, ndim)[:, :2] else: assert lb.shape[1] == 5, f"labels require 5 columns, {lb.shape[1]} columns detected" points = lb[:, 1:] assert points.max() <= 1, f"non-normalized or out of bounds coordinates {points[points > 1]}" assert lb.min() >= 0, f"negative label values {lb[lb < 0]}" # All labels max_cls = lb[:, 0].max() # max label count assert max_cls <= num_cls, ( f"Label class {int(max_cls)} exceeds dataset class count {num_cls}. " f"Possible class labels are 0-{num_cls - 1}" ) _, i = np.unique(lb, axis=0, return_index=True) if len(i) < nl: # duplicate row check lb = lb[i] # remove duplicates if segments: segments = [segments[x] for x in i] msg = f"{prefix}WARNING ⚠️ {im_file}: {nl - len(i)} duplicate labels removed" else: ne = 1 # label empty lb = np.zeros((0, (5 + nkpt * ndim) if keypoint else 5), dtype=np.float32) else: nm = 1 # label missing lb = np.zeros((0, (5 + nkpt * ndim) if keypoints else 5), dtype=np.float32) if keypoint: keypoints = lb[:, 5:].reshape(-1, nkpt, ndim) if ndim == 2: kpt_mask = np.where((keypoints[..., 0] < 0) | (keypoints[..., 1] < 0), 0.0, 1.0).astype(np.float32) keypoints = np.concatenate([keypoints, kpt_mask[..., None]], axis=-1) # (nl, nkpt, 3) lb = lb[:, :5] return im_file, lb, shape, segments, keypoints, nm, nf, ne, nc, msg except Exception as e: nc = 1 msg = f"{prefix}WARNING ⚠️ {im_file}: ignoring corrupt image/label: {e}" return [None, None, None, None, None, nm, nf, ne, nc, msg] def polygon2mask(imgsz, polygons, color=1, downsample_ratio=1): """ Convert a list of polygons to a binary mask of the specified image size. Args: imgsz (tuple): The size of the image as (height, width). polygons (list[np.ndarray]): A list of polygons. Each polygon is an array with shape [N, M], where N is the number of polygons, and M is the number of points such that M % 2 = 0. color (int, optional): The color value to fill in the polygons on the mask. Defaults to 1. downsample_ratio (int, optional): Factor by which to downsample the mask. Defaults to 1. Returns: (np.ndarray): A binary mask of the specified image size with the polygons filled in. """ mask = np.zeros(imgsz, dtype=np.uint8) polygons = np.asarray(polygons, dtype=np.int32) polygons = polygons.reshape((polygons.shape[0], -1, 2)) cv2.fillPoly(mask, polygons, color=color) nh, nw = (imgsz[0] // downsample_ratio, imgsz[1] // downsample_ratio) # Note: fillPoly first then resize is trying to keep the same loss calculation method when mask-ratio=1 return cv2.resize(mask, (nw, nh)) def polygons2masks(imgsz, polygons, color, downsample_ratio=1): """ Convert a list of polygons to a set of binary masks of the specified image size. Args: imgsz (tuple): The size of the image as (height, width). polygons (list[np.ndarray]): A list of polygons. Each polygon is an array with shape [N, M], where N is the number of polygons, and M is the number of points such that M % 2 = 0. color (int): The color value to fill in the polygons on the masks. downsample_ratio (int, optional): Factor by which to downsample each mask. Defaults to 1. Returns: (np.ndarray): A set of binary masks of the specified image size with the polygons filled in. """ return np.array([polygon2mask(imgsz, [x.reshape(-1)], color, downsample_ratio) for x in polygons]) def polygons2masks_overlap(imgsz, segments, downsample_ratio=1): """Return a (640, 640) overlap mask.""" masks = np.zeros( (imgsz[0] // downsample_ratio, imgsz[1] // downsample_ratio), dtype=np.int32 if len(segments) > 255 else np.uint8, ) areas = [] ms = [] for si in range(len(segments)): mask = polygon2mask(imgsz, [segments[si].reshape(-1)], downsample_ratio=downsample_ratio, color=1) ms.append(mask) areas.append(mask.sum()) areas = np.asarray(areas) index = np.argsort(-areas) ms = np.array(ms)[index] for i in range(len(segments)): mask = ms[i] * (i + 1) masks = masks + mask masks = np.clip(masks, a_min=0, a_max=i + 1) return masks, index def find_dataset_yaml(path: Path) -> Path: """ Find and return the YAML file associated with a Detect, Segment or Pose dataset. This function searches for a YAML file at the root level of the provided directory first, and if not found, it performs a recursive search. It prefers YAML files that have the same stem as the provided path. An AssertionError is raised if no YAML file is found or if multiple YAML files are found. Args: path (Path): The directory path to search for the YAML file. Returns: (Path): The path of the found YAML file. """ files = list(path.glob("*.yaml")) or list(path.rglob("*.yaml")) # try root level first and then recursive assert files, f"No YAML file found in '{path.resolve()}'" if len(files) > 1: files = [f for f in files if f.stem == path.stem] # prefer *.yaml files that match assert len(files) == 1, f"Expected 1 YAML file in '{path.resolve()}', but found {len(files)}.\n{files}" return files[0] def check_det_dataset(dataset, autodownload=True): """ Download, verify, and/or unzip a dataset if not found locally. This function checks the availability of a specified dataset, and if not found, it has the option to download and unzip the dataset. It then reads and parses the accompanying YAML data, ensuring key requirements are met and also resolves paths related to the dataset. Args: dataset (str): Path to the dataset or dataset descriptor (like a YAML file). autodownload (bool, optional): Whether to automatically download the dataset if not found. Defaults to True. Returns: (dict): Parsed dataset information and paths. """ file = check_file(dataset) # Download (optional) extract_dir = "" if zipfile.is_zipfile(file) or is_tarfile(file): new_dir = safe_download(file, dir=DATASETS_DIR, unzip=True, delete=False) file = find_dataset_yaml(DATASETS_DIR / new_dir) extract_dir, autodownload = file.parent, False # Read YAML data = yaml_load(file, append_filename=True) # dictionary # Checks for k in "train", "val": if k not in data: if k != "val" or "validation" not in data: raise SyntaxError( emojis(f"{dataset} '{k}:' key missing ❌.\n'train' and 'val' are required in all data YAMLs.") ) LOGGER.info("WARNING ⚠️ renaming data YAML 'validation' key to 'val' to match YOLO format.") data["val"] = data.pop("validation") # replace 'validation' key with 'val' key if "names" not in data and "nc" not in data: raise SyntaxError(emojis(f"{dataset} key missing ❌.\n either 'names' or 'nc' are required in all data YAMLs.")) if "names" in data and "nc" in data and len(data["names"]) != data["nc"]: raise SyntaxError(emojis(f"{dataset} 'names' length {len(data['names'])} and 'nc: {data['nc']}' must match.")) if "names" not in data: data["names"] = [f"class_{i}" for i in range(data["nc"])] else: data["nc"] = len(data["names"]) data["names"] = check_class_names(data["names"]) # Resolve paths path = Path(extract_dir or data.get("path") or Path(data.get("yaml_file", "")).parent) # dataset root if not path.is_absolute(): path = (DATASETS_DIR / path).resolve() # Set paths data["path"] = path # download scripts for k in "train", "val", "test": if data.get(k): # prepend path if isinstance(data[k], str): x = (path / data[k]).resolve() if not x.exists() and data[k].startswith("../"): x = (path / data[k][3:]).resolve() data[k] = str(x) else: data[k] = [str((path / x).resolve()) for x in data[k]] # Parse YAML val, s = (data.get(x) for x in ("val", "download")) if val: val = [Path(x).resolve() for x in (val if isinstance(val, list) else [val])] # val path if not all(x.exists() for x in val): name = clean_url(dataset) # dataset name with URL auth stripped m = f"\nDataset '{name}' images not found ⚠️, missing path '{[x for x in val if not x.exists()][0]}'" if s and autodownload: LOGGER.warning(m) else: m += f"\nNote dataset download directory is '{DATASETS_DIR}'. You can update this in '{SETTINGS_YAML}'" raise FileNotFoundError(m) t = time.time() r = None # success if s.startswith("http") and s.endswith(".zip"): # URL safe_download(url=s, dir=DATASETS_DIR, delete=True) elif s.startswith("bash "): # bash script LOGGER.info(f"Running {s} ...") r = os.system(s) else: # python script exec(s, {"yaml": data}) dt = f"({round(time.time() - t, 1)}s)" s = f"success ✅ {dt}, saved to {colorstr('bold', DATASETS_DIR)}" if r in (0, None) else f"failure {dt} ❌" LOGGER.info(f"Dataset download {s}\n") check_font("Arial.ttf" if is_ascii(data["names"]) else "Arial.Unicode.ttf") # download fonts return data # dictionary def check_cls_dataset(dataset, split=""): """ Checks a classification dataset such as Imagenet. This function accepts a `dataset` name and attempts to retrieve the corresponding dataset information. If the dataset is not found locally, it attempts to download the dataset from the internet and save it locally. Args: dataset (str | Path): The name of the dataset. split (str, optional): The split of the dataset. Either 'val', 'test', or ''. Defaults to ''. Returns: (dict): A dictionary containing the following keys: - 'train' (Path): The directory path containing the training set of the dataset. - 'val' (Path): The directory path containing the validation set of the dataset. - 'test' (Path): The directory path containing the test set of the dataset. - 'nc' (int): The number of classes in the dataset. - 'names' (dict): A dictionary of class names in the dataset. """ # Download (optional if dataset=https://file.zip is passed directly) if str(dataset).startswith(("http:/", "https:/")): dataset = safe_download(dataset, dir=DATASETS_DIR, unzip=True, delete=False) dataset = Path(dataset) data_dir = (dataset if dataset.is_dir() else (DATASETS_DIR / dataset)).resolve() if not data_dir.is_dir(): LOGGER.warning(f"\nDataset not found ⚠️, missing path {data_dir}, attempting download...") t = time.time() if str(dataset) == "imagenet": subprocess.run(f"bash {ROOT / 'data/scripts/get_imagenet.sh'}", shell=True, check=True) else: url = f"https://github.com/ultralytics/yolov5/releases/download/v1.0/{dataset}.zip" download(url, dir=data_dir.parent) s = f"Dataset download success ✅ ({time.time() - t:.1f}s), saved to {colorstr('bold', data_dir)}\n" LOGGER.info(s) train_set = data_dir / "train" val_set = ( data_dir / "val" if (data_dir / "val").exists() else data_dir / "validation" if (data_dir / "validation").exists() else None ) # data/test or data/val test_set = data_dir / "test" if (data_dir / "test").exists() else None # data/val or data/test if split == "val" and not val_set: LOGGER.warning("WARNING ⚠️ Dataset 'split=val' not found, using 'split=test' instead.") elif split == "test" and not test_set: LOGGER.warning("WARNING ⚠️ Dataset 'split=test' not found, using 'split=val' instead.") nc = len([x for x in (data_dir / "train").glob("*") if x.is_dir()]) # number of classes names = [x.name for x in (data_dir / "train").iterdir() if x.is_dir()] # class names list names = dict(enumerate(sorted(names))) # Print to console for k, v in {"train": train_set, "val": val_set, "test": test_set}.items(): prefix = f'{colorstr(f"{k}:")} {v}...' if v is None: LOGGER.info(prefix) else: files = [path for path in v.rglob("*.*") if path.suffix[1:].lower() in IMG_FORMATS] nf = len(files) # number of files nd = len({file.parent for file in files}) # number of directories if nf == 0: if k == "train": raise FileNotFoundError(emojis(f"{dataset} '{k}:' no training images found ❌ ")) else: LOGGER.warning(f"{prefix} found {nf} images in {nd} classes: WARNING ⚠️ no images found") elif nd != nc: LOGGER.warning(f"{prefix} found {nf} images in {nd} classes: ERROR ❌️ requires {nc} classes, not {nd}") else: LOGGER.info(f"{prefix} found {nf} images in {nd} classes ✅ ") return {"train": train_set, "val": val_set, "test": test_set, "nc": nc, "names": names} class HUBDatasetStats: """ A class for generating HUB dataset JSON and `-hub` dataset directory. Args: path (str): Path to data.yaml or data.zip (with data.yaml inside data.zip). Default is 'coco8.yaml'. task (str): Dataset task. Options are 'detect', 'segment', 'pose', 'classify'. Default is 'detect'. autodownload (bool): Attempt to download dataset if not found locally. Default is False. Example: Download *.zip files from https://github.com/ultralytics/hub/tree/main/example_datasets i.e. https://github.com/ultralytics/hub/raw/main/example_datasets/coco8.zip for coco8.zip. ```python from ultralytics.data.utils import HUBDatasetStats stats = HUBDatasetStats('path/to/coco8.zip', task='detect') # detect dataset stats = HUBDatasetStats('path/to/coco8-seg.zip', task='segment') # segment dataset stats = HUBDatasetStats('path/to/coco8-pose.zip', task='pose') # pose dataset stats = HUBDatasetStats('path/to/imagenet10.zip', task='classify') # classification dataset stats.get_json(save=True) stats.process_images() ``` """ def __init__(self, path="coco8.yaml", task="detect", autodownload=False): """Initialize class.""" path = Path(path).resolve() LOGGER.info(f"Starting HUB dataset checks for {path}....") self.task = task # detect, segment, pose, classify if self.task == "classify": unzip_dir = unzip_file(path) data = check_cls_dataset(unzip_dir) data["path"] = unzip_dir else: # detect, segment, pose _, data_dir, yaml_path = self._unzip(Path(path)) try: # Load YAML with checks data = yaml_load(yaml_path) data["path"] = "" # strip path since YAML should be in dataset root for all HUB datasets yaml_save(yaml_path, data) data = check_det_dataset(yaml_path, autodownload) # dict data["path"] = data_dir # YAML path should be set to '' (relative) or parent (absolute) except Exception as e: raise Exception("error/HUB/dataset_stats/init") from e self.hub_dir = Path(f'{data["path"]}-hub') self.im_dir = self.hub_dir / "images" self.im_dir.mkdir(parents=True, exist_ok=True) # makes /images self.stats = {"nc": len(data["names"]), "names": list(data["names"].values())} # statistics dictionary self.data = data @staticmethod def _unzip(path): """Unzip data.zip.""" if not str(path).endswith(".zip"): # path is data.yaml return False, None, path unzip_dir = unzip_file(path, path=path.parent) assert unzip_dir.is_dir(), ( f"Error unzipping {path}, {unzip_dir} not found. " f"path/to/abc.zip MUST unzip to path/to/abc/" ) return True, str(unzip_dir), find_dataset_yaml(unzip_dir) # zipped, data_dir, yaml_path def _hub_ops(self, f): """Saves a compressed image for HUB previews.""" compress_one_image(f, self.im_dir / Path(f).name) # save to dataset-hub def get_json(self, save=False, verbose=False): """Return dataset JSON for Ultralytics HUB.""" def _round(labels): """Update labels to integer class and 4 decimal place floats.""" if self.task == "detect": coordinates = labels["bboxes"] elif self.task == "segment": coordinates = [x.flatten() for x in labels["segments"]] elif self.task == "pose": n = labels["keypoints"].shape[0] coordinates = np.concatenate((labels["bboxes"], labels["keypoints"].reshape(n, -1)), 1) else: raise ValueError("Undefined dataset task.") zipped = zip(labels["cls"], coordinates) return [[int(c[0]), *(round(float(x), 4) for x in points)] for c, points in zipped] for split in "train", "val", "test": self.stats[split] = None # predefine path = self.data.get(split) # Check split if path is None: # no split continue files = [f for f in Path(path).rglob("*.*") if f.suffix[1:].lower() in IMG_FORMATS] # image files in split if not files: # no images continue # Get dataset statistics if self.task == "classify": from torchvision.datasets import ImageFolder dataset = ImageFolder(self.data[split]) x = np.zeros(len(dataset.classes)).astype(int) for im in dataset.imgs: x[im[1]] += 1 self.stats[split] = { "instance_stats": {"total": len(dataset), "per_class": x.tolist()}, "image_stats": {"total": len(dataset), "unlabelled": 0, "per_class": x.tolist()}, "labels": [{Path(k).name: v} for k, v in dataset.imgs], } else: from ultralytics.data import YOLODataset dataset = YOLODataset(img_path=self.data[split], data=self.data, task=self.task) x = np.array( [ np.bincount(label["cls"].astype(int).flatten(), minlength=self.data["nc"]) for label in TQDM(dataset.labels, total=len(dataset), desc="Statistics") ] ) # shape(128x80) self.stats[split] = { "instance_stats": {"total": int(x.sum()), "per_class": x.sum(0).tolist()}, "image_stats": { "total": len(dataset), "unlabelled": int(np.all(x == 0, 1).sum()), "per_class": (x > 0).sum(0).tolist(), }, "labels": [{Path(k).name: _round(v)} for k, v in zip(dataset.im_files, dataset.labels)], } # Save, print and return if save: stats_path = self.hub_dir / "stats.json" LOGGER.info(f"Saving {stats_path.resolve()}...") with open(stats_path, "w") as f: json.dump(self.stats, f) # save stats.json if verbose: LOGGER.info(json.dumps(self.stats, indent=2, sort_keys=False)) return self.stats def process_images(self): """Compress images for Ultralytics HUB.""" from ultralytics.data import YOLODataset # ClassificationDataset for split in "train", "val", "test": if self.data.get(split) is None: continue dataset = YOLODataset(img_path=self.data[split], data=self.data) with ThreadPool(NUM_THREADS) as pool: for _ in TQDM(pool.imap(self._hub_ops, dataset.im_files), total=len(dataset), desc=f"{split} images"): pass LOGGER.info(f"Done. All images saved to {self.im_dir}") return self.im_dir def compress_one_image(f, f_new=None, max_dim=1920, quality=50): """ Compresses a single image file to reduced size while preserving its aspect ratio and quality using either the Python Imaging Library (PIL) or OpenCV library. If the input image is smaller than the maximum dimension, it will not be resized. Args: f (str): The path to the input image file. f_new (str, optional): The path to the output image file. If not specified, the input file will be overwritten. max_dim (int, optional): The maximum dimension (width or height) of the output image. Default is 1920 pixels. quality (int, optional): The image compression quality as a percentage. Default is 50%. Example: ```python from pathlib import Path from ultralytics.data.utils import compress_one_image for f in Path('path/to/dataset').rglob('*.jpg'): compress_one_image(f) ``` """ try: # use PIL im = Image.open(f) r = max_dim / max(im.height, im.width) # ratio if r < 1.0: # image too large im = im.resize((int(im.width * r), int(im.height * r))) im.save(f_new or f, "JPEG", quality=quality, optimize=True) # save except Exception as e: # use OpenCV LOGGER.info(f"WARNING ⚠️ HUB ops PIL failure {f}: {e}") im = cv2.imread(f) im_height, im_width = im.shape[:2] r = max_dim / max(im_height, im_width) # ratio if r < 1.0: # image too large im = cv2.resize(im, (int(im_width * r), int(im_height * r)), interpolation=cv2.INTER_AREA) cv2.imwrite(str(f_new or f), im) def autosplit(path=DATASETS_DIR / "coco8/images", weights=(0.9, 0.1, 0.0), annotated_only=False): """ Automatically split a dataset into train/val/test splits and save the resulting splits into autosplit_*.txt files. Args: path (Path, optional): Path to images directory. Defaults to DATASETS_DIR / 'coco8/images'. weights (list | tuple, optional): Train, validation, and test split fractions. Defaults to (0.9, 0.1, 0.0). annotated_only (bool, optional): If True, only images with an associated txt file are used. Defaults to False. Example: ```python from ultralytics.data.utils import autosplit autosplit() ``` """ path = Path(path) # images dir files = sorted(x for x in path.rglob("*.*") if x.suffix[1:].lower() in IMG_FORMATS) # image files only n = len(files) # number of files random.seed(0) # for reproducibility indices = random.choices([0, 1, 2], weights=weights, k=n) # assign each image to a split txt = ["autosplit_train.txt", "autosplit_val.txt", "autosplit_test.txt"] # 3 txt files for x in txt: if (path.parent / x).exists(): (path.parent / x).unlink() # remove existing LOGGER.info(f"Autosplitting images from {path}" + ", using *.txt labeled images only" * annotated_only) for i, img in TQDM(zip(indices, files), total=n): if not annotated_only or Path(img2label_paths([str(img)])[0]).exists(): # check label with open(path.parent / txt[i], "a") as f: f.write(f"./{img.relative_to(path.parent).as_posix()}" + "\n") # add image to txt file
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/data/utils.py
Python
unknown
29,509
# Ultralytics YOLO 🚀, AGPL-3.0 license
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/engine/__init__.py
Python
unknown
42
# Ultralytics YOLO 🚀, AGPL-3.0 license import inspect import sys from pathlib import Path from typing import Union from ultralytics.cfg import TASK2DATA, get_cfg, get_save_dir from ultralytics.hub.utils import HUB_WEB_ROOT from ultralytics.nn.tasks import attempt_load_one_weight, guess_model_task, nn, yaml_model_load from ultralytics.utils import ASSETS, DEFAULT_CFG_DICT, LOGGER, RANK, SETTINGS, callbacks, checks, emojis, yaml_load class Model(nn.Module): """ A base class for implementing YOLO models, unifying APIs across different model types. This class provides a common interface for various operations related to YOLO models, such as training, validation, prediction, exporting, and benchmarking. It handles different types of models, including those loaded from local files, Ultralytics HUB, or Triton Server. The class is designed to be flexible and extendable for different tasks and model configurations. Args: model (Union[str, Path], optional): Path or name of the model to load or create. This can be a local file path, a model name from Ultralytics HUB, or a Triton Server model. Defaults to 'yolov8n.pt'. task (Any, optional): The task type associated with the YOLO model. This can be used to specify the model's application domain, such as object detection, segmentation, etc. Defaults to None. verbose (bool, optional): If True, enables verbose output during the model's operations. Defaults to False. Attributes: callbacks (dict): A dictionary of callback functions for various events during model operations. predictor (BasePredictor): The predictor object used for making predictions. model (nn.Module): The underlying PyTorch model. trainer (BaseTrainer): The trainer object used for training the model. ckpt (dict): The checkpoint data if the model is loaded from a *.pt file. cfg (str): The configuration of the model if loaded from a *.yaml file. ckpt_path (str): The path to the checkpoint file. overrides (dict): A dictionary of overrides for model configuration. metrics (dict): The latest training/validation metrics. session (HUBTrainingSession): The Ultralytics HUB session, if applicable. task (str): The type of task the model is intended for. model_name (str): The name of the model. Methods: __call__: Alias for the predict method, enabling the model instance to be callable. _new: Initializes a new model based on a configuration file. _load: Loads a model from a checkpoint file. _check_is_pytorch_model: Ensures that the model is a PyTorch model. reset_weights: Resets the model's weights to their initial state. load: Loads model weights from a specified file. save: Saves the current state of the model to a file. info: Logs or returns information about the model. fuse: Fuses Conv2d and BatchNorm2d layers for optimized inference. predict: Performs object detection predictions. track: Performs object tracking. val: Validates the model on a dataset. benchmark: Benchmarks the model on various export formats. export: Exports the model to different formats. train: Trains the model on a dataset. tune: Performs hyperparameter tuning. _apply: Applies a function to the model's tensors. add_callback: Adds a callback function for an event. clear_callback: Clears all callbacks for an event. reset_callbacks: Resets all callbacks to their default functions. _get_hub_session: Retrieves or creates an Ultralytics HUB session. is_triton_model: Checks if a model is a Triton Server model. is_hub_model: Checks if a model is an Ultralytics HUB model. _reset_ckpt_args: Resets checkpoint arguments when loading a PyTorch model. _smart_load: Loads the appropriate module based on the model task. task_map: Provides a mapping from model tasks to corresponding classes. Raises: FileNotFoundError: If the specified model file does not exist or is inaccessible. ValueError: If the model file or configuration is invalid or unsupported. ImportError: If required dependencies for specific model types (like HUB SDK) are not installed. TypeError: If the model is not a PyTorch model when required. AttributeError: If required attributes or methods are not implemented or available. NotImplementedError: If a specific model task or mode is not supported. """ def __init__(self, model: Union[str, Path] = "yolov8n.pt", task=None, verbose=False) -> None: """ Initializes a new instance of the YOLO model class. This constructor sets up the model based on the provided model path or name. It handles various types of model sources, including local files, Ultralytics HUB models, and Triton Server models. The method initializes several important attributes of the model and prepares it for operations like training, prediction, or export. Args: model (Union[str, Path], optional): The path or model file to load or create. This can be a local file path, a model name from Ultralytics HUB, or a Triton Server model. Defaults to 'yolov8n.pt'. task (Any, optional): The task type associated with the YOLO model, specifying its application domain. Defaults to None. verbose (bool, optional): If True, enables verbose output during the model's initialization and subsequent operations. Defaults to False. Raises: FileNotFoundError: If the specified model file does not exist or is inaccessible. ValueError: If the model file or configuration is invalid or unsupported. ImportError: If required dependencies for specific model types (like HUB SDK) are not installed. """ super().__init__() self.callbacks = callbacks.get_default_callbacks() self.predictor = None # reuse predictor self.model = None # model object self.trainer = None # trainer object self.ckpt = None # if loaded from *.pt self.cfg = None # if loaded from *.yaml self.ckpt_path = None self.overrides = {} # overrides for trainer object self.metrics = None # validation/training metrics self.session = None # HUB session self.task = task # task type self.model_name = model = str(model).strip() # strip spaces # Check if Ultralytics HUB model from https://hub.ultralytics.com if self.is_hub_model(model): # Fetch model from HUB checks.check_requirements("hub-sdk>0.0.2") self.session = self._get_hub_session(model) model = self.session.model_file # Check if Triton Server model elif self.is_triton_model(model): self.model = model self.task = task return # Load or create new YOLO model model = checks.check_model_file_from_stem(model) # add suffix, i.e. yolov8n -> yolov8n.pt if Path(model).suffix in (".yaml", ".yml"): self._new(model, task=task, verbose=verbose) else: self._load(model, task=task) self.model_name = model def __call__(self, source=None, stream=False, **kwargs): """ An alias for the predict method, enabling the model instance to be callable. This method simplifies the process of making predictions by allowing the model instance to be called directly with the required arguments for prediction. Args: source (str | int | PIL.Image | np.ndarray, optional): The source of the image for making predictions. Accepts various types, including file paths, URLs, PIL images, and numpy arrays. Defaults to None. stream (bool, optional): If True, treats the input source as a continuous stream for predictions. Defaults to False. **kwargs (dict): Additional keyword arguments for configuring the prediction process. Returns: (List[ultralytics.engine.results.Results]): A list of prediction results, encapsulated in the Results class. """ return self.predict(source, stream, **kwargs) @staticmethod def _get_hub_session(model: str): """Creates a session for Hub Training.""" from ultralytics.hub.session import HUBTrainingSession session = HUBTrainingSession(model) return session if session.client.authenticated else None @staticmethod def is_triton_model(model): """Is model a Triton Server URL string, i.e. <scheme>://<netloc>/<endpoint>/<task_name>""" from urllib.parse import urlsplit url = urlsplit(model) return url.netloc and url.path and url.scheme in {"http", "grpc"} @staticmethod def is_hub_model(model): """Check if the provided model is a HUB model.""" return any( ( model.startswith(f"{HUB_WEB_ROOT}/models/"), # i.e. https://hub.ultralytics.com/models/MODEL_ID [len(x) for x in model.split("_")] == [42, 20], # APIKEY_MODELID len(model) == 20 and not Path(model).exists() and all(x not in model for x in "./\\"), # MODELID ) ) def _new(self, cfg: str, task=None, model=None, verbose=False): """ Initializes a new model and infers the task type from the model definitions. Args: cfg (str): model configuration file task (str | None): model task model (BaseModel): Customized model. verbose (bool): display model info on load """ cfg_dict = yaml_model_load(cfg) self.cfg = cfg self.task = task or guess_model_task(cfg_dict) self.model = (model or self._smart_load("model"))(cfg_dict, verbose=verbose and RANK == -1) # build model self.overrides["model"] = self.cfg self.overrides["task"] = self.task # Below added to allow export from YAMLs self.model.args = {**DEFAULT_CFG_DICT, **self.overrides} # combine default and model args (prefer model args) self.model.task = self.task def _load(self, weights: str, task=None): """ Initializes a new model and infers the task type from the model head. Args: weights (str): model checkpoint to be loaded task (str | None): model task """ suffix = Path(weights).suffix if suffix == ".pt": self.model, self.ckpt = attempt_load_one_weight(weights) self.task = self.model.args["task"] self.overrides = self.model.args = self._reset_ckpt_args(self.model.args) self.ckpt_path = self.model.pt_path else: weights = checks.check_file(weights) self.model, self.ckpt = weights, None self.task = task or guess_model_task(weights) self.ckpt_path = weights self.overrides["model"] = weights self.overrides["task"] = self.task def _check_is_pytorch_model(self): """Raises TypeError is model is not a PyTorch model.""" pt_str = isinstance(self.model, (str, Path)) and Path(self.model).suffix == ".pt" pt_module = isinstance(self.model, nn.Module) if not (pt_module or pt_str): raise TypeError( f"model='{self.model}' should be a *.pt PyTorch model to run this method, but is a different format. " f"PyTorch models can train, val, predict and export, i.e. 'model.train(data=...)', but exported " f"formats like ONNX, TensorRT etc. only support 'predict' and 'val' modes, " f"i.e. 'yolo predict model=yolov8n.onnx'.\nTo run CUDA or MPS inference please pass the device " f"argument directly in your inference command, i.e. 'model.predict(source=..., device=0)'" ) def reset_weights(self): """ Resets the model parameters to randomly initialized values, effectively discarding all training information. This method iterates through all modules in the model and resets their parameters if they have a 'reset_parameters' method. It also ensures that all parameters have 'requires_grad' set to True, enabling them to be updated during training. Returns: self (ultralytics.engine.model.Model): The instance of the class with reset weights. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() for m in self.model.modules(): if hasattr(m, "reset_parameters"): m.reset_parameters() for p in self.model.parameters(): p.requires_grad = True return self def load(self, weights="yolov8n.pt"): """ Loads parameters from the specified weights file into the model. This method supports loading weights from a file or directly from a weights object. It matches parameters by name and shape and transfers them to the model. Args: weights (str | Path): Path to the weights file or a weights object. Defaults to 'yolov8n.pt'. Returns: self (ultralytics.engine.model.Model): The instance of the class with loaded weights. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() if isinstance(weights, (str, Path)): weights, self.ckpt = attempt_load_one_weight(weights) self.model.load(weights) return self def save(self, filename="model.pt"): """ Saves the current model state to a file. This method exports the model's checkpoint (ckpt) to the specified filename. Args: filename (str): The name of the file to save the model to. Defaults to 'model.pt'. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() import torch torch.save(self.ckpt, filename) def info(self, detailed=False, verbose=True): """ Logs or returns model information. This method provides an overview or detailed information about the model, depending on the arguments passed. It can control the verbosity of the output. Args: detailed (bool): If True, shows detailed information about the model. Defaults to False. verbose (bool): If True, prints the information. If False, returns the information. Defaults to True. Returns: (list): Various types of information about the model, depending on the 'detailed' and 'verbose' parameters. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() return self.model.info(detailed=detailed, verbose=verbose) def fuse(self): """ Fuses Conv2d and BatchNorm2d layers in the model. This method optimizes the model by fusing Conv2d and BatchNorm2d layers, which can improve inference speed. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() self.model.fuse() def embed(self, source=None, stream=False, **kwargs): """ Generates image embeddings based on the provided source. This method is a wrapper around the 'predict()' method, focusing on generating embeddings from an image source. It allows customization of the embedding process through various keyword arguments. Args: source (str | int | PIL.Image | np.ndarray): The source of the image for generating embeddings. The source can be a file path, URL, PIL image, numpy array, etc. Defaults to None. stream (bool): If True, predictions are streamed. Defaults to False. **kwargs (dict): Additional keyword arguments for configuring the embedding process. Returns: (List[torch.Tensor]): A list containing the image embeddings. Raises: AssertionError: If the model is not a PyTorch model. """ if not kwargs.get("embed"): kwargs["embed"] = [len(self.model.model) - 2] # embed second-to-last layer if no indices passed return self.predict(source, stream, **kwargs) def predict(self, source=None, stream=False, predictor=None, **kwargs): """ Performs predictions on the given image source using the YOLO model. This method facilitates the prediction process, allowing various configurations through keyword arguments. It supports predictions with custom predictors or the default predictor method. The method handles different types of image sources and can operate in a streaming mode. It also provides support for SAM-type models through 'prompts'. The method sets up a new predictor if not already present and updates its arguments with each call. It also issues a warning and uses default assets if the 'source' is not provided. The method determines if it is being called from the command line interface and adjusts its behavior accordingly, including setting defaults for confidence threshold and saving behavior. Args: source (str | int | PIL.Image | np.ndarray, optional): The source of the image for making predictions. Accepts various types, including file paths, URLs, PIL images, and numpy arrays. Defaults to ASSETS. stream (bool, optional): Treats the input source as a continuous stream for predictions. Defaults to False. predictor (BasePredictor, optional): An instance of a custom predictor class for making predictions. If None, the method uses a default predictor. Defaults to None. **kwargs (dict): Additional keyword arguments for configuring the prediction process. These arguments allow for further customization of the prediction behavior. Returns: (List[ultralytics.engine.results.Results]): A list of prediction results, encapsulated in the Results class. Raises: AttributeError: If the predictor is not properly set up. """ if source is None: source = ASSETS LOGGER.warning(f"WARNING ⚠️ 'source' is missing. Using 'source={source}'.") is_cli = (sys.argv[0].endswith("yolo") or sys.argv[0].endswith("ultralytics")) and any( x in sys.argv for x in ("predict", "track", "mode=predict", "mode=track") ) custom = {"conf": 0.25, "save": is_cli, "mode": "predict"} # method defaults args = {**self.overrides, **custom, **kwargs} # highest priority args on the right prompts = args.pop("prompts", None) # for SAM-type models if not self.predictor: self.predictor = predictor or self._smart_load("predictor")(overrides=args, _callbacks=self.callbacks) self.predictor.setup_model(model=self.model, verbose=is_cli) else: # only update args if predictor is already setup self.predictor.args = get_cfg(self.predictor.args, args) if "project" in args or "name" in args: self.predictor.save_dir = get_save_dir(self.predictor.args) if prompts and hasattr(self.predictor, "set_prompts"): # for SAM-type models self.predictor.set_prompts(prompts) return self.predictor.predict_cli(source=source) if is_cli else self.predictor(source=source, stream=stream) def track(self, source=None, stream=False, persist=False, **kwargs): """ Conducts object tracking on the specified input source using the registered trackers. This method performs object tracking using the model's predictors and optionally registered trackers. It is capable of handling different types of input sources such as file paths or video streams. The method supports customization of the tracking process through various keyword arguments. It registers trackers if they are not already present and optionally persists them based on the 'persist' flag. The method sets a default confidence threshold specifically for ByteTrack-based tracking, which requires low confidence predictions as input. The tracking mode is explicitly set in the keyword arguments. Args: source (str, optional): The input source for object tracking. It can be a file path, URL, or video stream. stream (bool, optional): Treats the input source as a continuous video stream. Defaults to False. persist (bool, optional): Persists the trackers between different calls to this method. Defaults to False. **kwargs (dict): Additional keyword arguments for configuring the tracking process. These arguments allow for further customization of the tracking behavior. Returns: (List[ultralytics.engine.results.Results]): A list of tracking results, encapsulated in the Results class. Raises: AttributeError: If the predictor does not have registered trackers. """ if not hasattr(self.predictor, "trackers"): from ultralytics.trackers import register_tracker register_tracker(self, persist) kwargs["conf"] = kwargs.get("conf") or 0.1 # ByteTrack-based method needs low confidence predictions as input kwargs["mode"] = "track" return self.predict(source=source, stream=stream, **kwargs) def val(self, validator=None, **kwargs): """ Validates the model using a specified dataset and validation configuration. This method facilitates the model validation process, allowing for a range of customization through various settings and configurations. It supports validation with a custom validator or the default validation approach. The method combines default configurations, method-specific defaults, and user-provided arguments to configure the validation process. After validation, it updates the model's metrics with the results obtained from the validator. The method supports various arguments that allow customization of the validation process. For a comprehensive list of all configurable options, users should refer to the 'configuration' section in the documentation. Args: validator (BaseValidator, optional): An instance of a custom validator class for validating the model. If None, the method uses a default validator. Defaults to None. **kwargs (dict): Arbitrary keyword arguments representing the validation configuration. These arguments are used to customize various aspects of the validation process. Returns: (dict): Validation metrics obtained from the validation process. Raises: AssertionError: If the model is not a PyTorch model. """ custom = {"rect": True} # method defaults args = {**self.overrides, **custom, **kwargs, "mode": "val"} # highest priority args on the right validator = (validator or self._smart_load("validator"))(args=args, _callbacks=self.callbacks) validator(model=self.model) self.metrics = validator.metrics return validator.metrics def benchmark(self, **kwargs): """ Benchmarks the model across various export formats to evaluate performance. This method assesses the model's performance in different export formats, such as ONNX, TorchScript, etc. It uses the 'benchmark' function from the ultralytics.utils.benchmarks module. The benchmarking is configured using a combination of default configuration values, model-specific arguments, method-specific defaults, and any additional user-provided keyword arguments. The method supports various arguments that allow customization of the benchmarking process, such as dataset choice, image size, precision modes, device selection, and verbosity. For a comprehensive list of all configurable options, users should refer to the 'configuration' section in the documentation. Args: **kwargs (dict): Arbitrary keyword arguments to customize the benchmarking process. These are combined with default configurations, model-specific arguments, and method defaults. Returns: (dict): A dictionary containing the results of the benchmarking process. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() from ultralytics.utils.benchmarks import benchmark custom = {"verbose": False} # method defaults args = {**DEFAULT_CFG_DICT, **self.model.args, **custom, **kwargs, "mode": "benchmark"} return benchmark( model=self, data=kwargs.get("data"), # if no 'data' argument passed set data=None for default datasets imgsz=args["imgsz"], half=args["half"], int8=args["int8"], device=args["device"], verbose=kwargs.get("verbose"), ) def export(self, **kwargs): """ Exports the model to a different format suitable for deployment. This method facilitates the export of the model to various formats (e.g., ONNX, TorchScript) for deployment purposes. It uses the 'Exporter' class for the export process, combining model-specific overrides, method defaults, and any additional arguments provided. The combined arguments are used to configure export settings. The method supports a wide range of arguments to customize the export process. For a comprehensive list of all possible arguments, refer to the 'configuration' section in the documentation. Args: **kwargs (dict): Arbitrary keyword arguments to customize the export process. These are combined with the model's overrides and method defaults. Returns: (object): The exported model in the specified format, or an object related to the export process. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() from .exporter import Exporter custom = {"imgsz": self.model.args["imgsz"], "batch": 1, "data": None, "verbose": False} # method defaults args = {**self.overrides, **custom, **kwargs, "mode": "export"} # highest priority args on the right return Exporter(overrides=args, _callbacks=self.callbacks)(model=self.model) def train(self, singal=None, singal_2=None, singal_3=None, singal_4=None, trainer=None, **kwargs): """ Trains the model using the specified dataset and training configuration. This method facilitates model training with a range of customizable settings and configurations. It supports training with a custom trainer or the default training approach defined in the method. The method handles different scenarios, such as resuming training from a checkpoint, integrating with Ultralytics HUB, and updating model and configuration after training. When using Ultralytics HUB, if the session already has a loaded model, the method prioritizes HUB training arguments and issues a warning if local arguments are provided. It checks for pip updates and combines default configurations, method-specific defaults, and user-provided arguments to configure the training process. After training, it updates the model and its configurations, and optionally attaches metrics. Args: trainer (BaseTrainer, optional): An instance of a custom trainer class for training the model. If None, the method uses a default trainer. Defaults to None. **kwargs (dict): Arbitrary keyword arguments representing the training configuration. These arguments are used to customize various aspects of the training process. Returns: (dict | None): Training metrics if available and training is successful; otherwise, None. Raises: AssertionError: If the model is not a PyTorch model. PermissionError: If there is a permission issue with the HUB session. ModuleNotFoundError: If the HUB SDK is not installed. """ self._check_is_pytorch_model() if hasattr(self.session, "model") and self.session.model.id: # Ultralytics HUB session with loaded model if any(kwargs): LOGGER.warning("WARNING ⚠️ using HUB training arguments, ignoring local training arguments.") kwargs = self.session.train_args # overwrite kwargs checks.check_pip_update_available() overrides = yaml_load(checks.check_yaml(kwargs["cfg"])) if kwargs.get("cfg") else self.overrides custom = {"data": DEFAULT_CFG_DICT["data"] or TASK2DATA[self.task]} # method defaults args = {**overrides, **custom, **kwargs, "mode": "train"} # highest priority args on the right if args.get("resume"): args["resume"] = self.ckpt_path self.trainer = (trainer or self._smart_load("trainer"))(overrides=args, _callbacks=self.callbacks) if not args.get("resume"): # manually set model only if not resuming self.trainer.model = self.trainer.get_model(weights=self.model if self.ckpt else None, cfg=self.model.yaml) self.model = self.trainer.model if SETTINGS["hub"] is True and not self.session: # Create a model in HUB try: self.session = self._get_hub_session(self.model_name) if self.session: self.session.create_model(args) # Check model was created if not getattr(self.session.model, "id", None): self.session = None except (PermissionError, ModuleNotFoundError): # Ignore PermissionError and ModuleNotFoundError which indicates hub-sdk not installed pass self.trainer.hub_session = self.session # attach optional HUB session self.trainer.train(singal=singal,singal_2=singal_2,singal_3=singal_3,singal_4=singal_4) # Update model and cfg after training if RANK in (-1, 0): ckpt = self.trainer.best if self.trainer.best.exists() else self.trainer.last self.model, _ = attempt_load_one_weight(ckpt) self.overrides = self.model.args self.metrics = getattr(self.trainer.validator, "metrics", None) # TODO: no metrics returned by DDP return self.metrics def tune(self, use_ray=False, iterations=10, *args, **kwargs): """ Conducts hyperparameter tuning for the model, with an option to use Ray Tune. This method supports two modes of hyperparameter tuning: using Ray Tune or a custom tuning method. When Ray Tune is enabled, it leverages the 'run_ray_tune' function from the ultralytics.utils.tuner module. Otherwise, it uses the internal 'Tuner' class for tuning. The method combines default, overridden, and custom arguments to configure the tuning process. Args: use_ray (bool): If True, uses Ray Tune for hyperparameter tuning. Defaults to False. iterations (int): The number of tuning iterations to perform. Defaults to 10. *args (list): Variable length argument list for additional arguments. **kwargs (dict): Arbitrary keyword arguments. These are combined with the model's overrides and defaults. Returns: (dict): A dictionary containing the results of the hyperparameter search. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() if use_ray: from ultralytics.utils.tuner import run_ray_tune return run_ray_tune(self, max_samples=iterations, *args, **kwargs) else: from .tuner import Tuner custom = {} # method defaults args = {**self.overrides, **custom, **kwargs, "mode": "train"} # highest priority args on the right return Tuner(args=args, _callbacks=self.callbacks)(model=self, iterations=iterations) def _apply(self, fn): """Apply to(), cpu(), cuda(), half(), float() to model tensors that are not parameters or registered buffers.""" self._check_is_pytorch_model() self = super()._apply(fn) # noqa self.predictor = None # reset predictor as device may have changed self.overrides["device"] = self.device # was str(self.device) i.e. device(type='cuda', index=0) -> 'cuda:0' return self @property def names(self): """ Retrieves the class names associated with the loaded model. This property returns the class names if they are defined in the model. It checks the class names for validity using the 'check_class_names' function from the ultralytics.nn.autobackend module. Returns: (list | None): The class names of the model if available, otherwise None. """ from ultralytics.nn.autobackend import check_class_names return check_class_names(self.model.names) if hasattr(self.model, "names") else None @property def device(self): """ Retrieves the device on which the model's parameters are allocated. This property is used to determine whether the model's parameters are on CPU or GPU. It only applies to models that are instances of nn.Module. Returns: (torch.device | None): The device (CPU/GPU) of the model if it is a PyTorch model, otherwise None. """ return next(self.model.parameters()).device if isinstance(self.model, nn.Module) else None @property def transforms(self): """ Retrieves the transformations applied to the input data of the loaded model. This property returns the transformations if they are defined in the model. Returns: (object | None): The transform object of the model if available, otherwise None. """ return self.model.transforms if hasattr(self.model, "transforms") else None def add_callback(self, event: str, func): """ Adds a callback function for a specified event. This method allows the user to register a custom callback function that is triggered on a specific event during model training or inference. Args: event (str): The name of the event to attach the callback to. func (callable): The callback function to be registered. Raises: ValueError: If the event name is not recognized. """ self.callbacks[event].append(func) def clear_callback(self, event: str): """ Clears all callback functions registered for a specified event. This method removes all custom and default callback functions associated with the given event. Args: event (str): The name of the event for which to clear the callbacks. Raises: ValueError: If the event name is not recognized. """ self.callbacks[event] = [] def reset_callbacks(self): """ Resets all callbacks to their default functions. This method reinstates the default callback functions for all events, removing any custom callbacks that were added previously. """ for event in callbacks.default_callbacks.keys(): self.callbacks[event] = [callbacks.default_callbacks[event][0]] @staticmethod def _reset_ckpt_args(args): """Reset arguments when loading a PyTorch model.""" include = {"imgsz", "data", "task", "single_cls"} # only remember these arguments when loading a PyTorch model return {k: v for k, v in args.items() if k in include} # def __getattr__(self, attr): # """Raises error if object has no requested attribute.""" # name = self.__class__.__name__ # raise AttributeError(f"'{name}' object has no attribute '{attr}'. See valid attributes below.\n{self.__doc__}") def _smart_load(self, key): """Load model/trainer/validator/predictor.""" try: return self.task_map[self.task][key] except Exception as e: name = self.__class__.__name__ mode = inspect.stack()[1][3] # get the function name. raise NotImplementedError( emojis(f"WARNING ⚠️ '{name}' model does not support '{mode}' mode for '{self.task}' task yet.") ) from e @property def task_map(self): """ Map head to model, trainer, validator, and predictor classes. Returns: task_map (dict): The map of model task to mode classes. """ raise NotImplementedError("Please provide task map for your model!")
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/engine/abc/model.py
Python
unknown
37,761
# Ultralytics YOLO 🚀, AGPL-3.0 license """ Train a model on a dataset. Usage: $ yolo mode=train model=yolov8n.pt data=coco128.yaml imgsz=640 epochs=100 batch=16 """ import math import os import subprocess import time import warnings from copy import deepcopy from datetime import datetime, timedelta from pathlib import Path import numpy as np import torch from torch import distributed as dist from torch import nn, optim from ultralytics.cfg import get_cfg, get_save_dir from ultralytics.data.utils import check_cls_dataset, check_det_dataset from ultralytics.nn.tasks import attempt_load_one_weight, attempt_load_weights from ultralytics.utils import ( DEFAULT_CFG, LOGGER, RANK, TQDM, __version__, callbacks, clean_url, colorstr, emojis, yaml_save, ) from ultralytics.utils.autobatch import check_train_batch_size from ultralytics.utils.checks import check_amp, check_file, check_imgsz, check_model_file_from_stem, print_args from ultralytics.utils.dist import ddp_cleanup, generate_ddp_command from ultralytics.utils.files import get_latest_run from ultralytics.utils.torch_utils import ( EarlyStopping, ModelEMA, de_parallel, init_seeds, one_cycle, select_device, strip_optimizer, ) class BaseTrainer: """ BaseTrainer. A base class for creating trainers. Attributes: args (SimpleNamespace): Configuration for the trainer. validator (BaseValidator): Validator instance. model (nn.Module): Model instance. callbacks (defaultdict): Dictionary of callbacks. save_dir (Path): Directory to save results. wdir (Path): Directory to save weights. last (Path): Path to the last checkpoint. best (Path): Path to the best checkpoint. save_period (int): Save checkpoint every x epochs (disabled if < 1). batch_size (int): Batch size for training. epochs (int): Number of epochs to train for. start_epoch (int): Starting epoch for training. device (torch.device): Device to use for training. amp (bool): Flag to enable AMP (Automatic Mixed Precision). scaler (amp.GradScaler): Gradient scaler for AMP. data (str): Path to data. trainset (torch.utils.data.Dataset): Training dataset. testset (torch.utils.data.Dataset): Testing dataset. ema (nn.Module): EMA (Exponential Moving Average) of the model. resume (bool): Resume training from a checkpoint. lf (nn.Module): Loss function. scheduler (torch.optim.lr_scheduler._LRScheduler): Learning rate scheduler. best_fitness (float): The best fitness value achieved. fitness (float): Current fitness value. loss (float): Current loss value. tloss (float): Total loss value. loss_names (list): List of loss names. csv (Path): Path to results CSV file. """ def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): """ Initializes the BaseTrainer class. Args: cfg (str, optional): Path to a configuration file. Defaults to DEFAULT_CFG. overrides (dict, optional): Configuration overrides. Defaults to None. """ self.args = get_cfg(cfg, overrides) self.check_resume(overrides) self.device = select_device(self.args.device, self.args.batch) self.validator = None self.metrics = None self.plots = {} init_seeds(self.args.seed + 1 + RANK, deterministic=self.args.deterministic) # Dirs self.save_dir = get_save_dir(self.args) self.args.name = self.save_dir.name # update name for loggers self.wdir = self.save_dir / "weights" # weights dir if RANK in (-1, 0): self.wdir.mkdir(parents=True, exist_ok=True) # make dir self.args.save_dir = str(self.save_dir) yaml_save(self.save_dir / "args.yaml", vars(self.args)) # save run args self.last, self.best = self.wdir / "last.pt", self.wdir / "best.pt" # checkpoint paths self.save_period = self.args.save_period self.batch_size = self.args.batch self.epochs = self.args.epochs self.start_epoch = 0 if RANK == -1: print_args(vars(self.args)) # Device if self.device.type in ("cpu", "mps"): self.args.workers = 0 # faster CPU training as time dominated by inference, not dataloading # Model and Dataset self.model = check_model_file_from_stem(self.args.model) # add suffix, i.e. yolov8n -> yolov8n.pt try: if self.args.task == "classify": self.data = check_cls_dataset(self.args.data) elif self.args.data.split(".")[-1] in ("yaml", "yml") or self.args.task in ("detect", "segment", "pose"): self.data = check_det_dataset(self.args.data) if "yaml_file" in self.data: self.args.data = self.data["yaml_file"] # for validating 'yolo train data=url.zip' usage except Exception as e: raise RuntimeError(emojis(f"Dataset '{clean_url(self.args.data)}' error ❌ {e}")) from e self.trainset, self.testset = self.get_dataset(self.data) self.ema = None # Optimization utils init self.lf = None self.scheduler = None # Epoch level metrics self.best_fitness = None self.fitness = None self.loss = None self.tloss = None self.loss_names = ["Loss"] self.csv = self.save_dir / "results.csv" self.plot_idx = [0, 1, 2] # Callbacks self.callbacks = _callbacks or callbacks.get_default_callbacks() if RANK in (-1, 0): callbacks.add_integration_callbacks(self) def add_callback(self, event: str, callback): """Appends the given callback.""" self.callbacks[event].append(callback) def set_callback(self, event: str, callback): """Overrides the existing callbacks with the given callback.""" self.callbacks[event] = [callback] def run_callbacks(self, event: str): """Run all existing callbacks associated with a particular event.""" for callback in self.callbacks.get(event, []): callback(self) def train(self,singal=None, singal_2=None, singal_3=None, singal_4=None): """Allow device='', device=None on Multi-GPU systems to default to device=0.""" if isinstance(self.args.device, str) and len(self.args.device): # i.e. device='0' or device='0,1,2,3' world_size = len(self.args.device.split(",")) elif isinstance(self.args.device, (tuple, list)): # i.e. device=[0, 1, 2, 3] (multi-GPU from CLI is list) world_size = len(self.args.device) elif torch.cuda.is_available(): # i.e. device=None or device='' or device=number world_size = 1 # default to device 0 else: # i.e. device='cpu' or 'mps' world_size = 0 # Run subprocess if DDP training, else train normally if world_size > 1 and "LOCAL_RANK" not in os.environ: # Argument checks if self.args.rect: LOGGER.warning("WARNING ⚠️ 'rect=True' is incompatible with Multi-GPU training, setting 'rect=False'") self.args.rect = False if self.args.batch == -1: LOGGER.warning( "WARNING ⚠️ 'batch=-1' for AutoBatch is incompatible with Multi-GPU training, setting " "default 'batch=16'" ) self.args.batch = 16 # Command cmd, file = generate_ddp_command(world_size, self) try: LOGGER.info(f'{colorstr("DDP:")} debug command {" ".join(cmd)}') subprocess.run(cmd, check=True) except Exception as e: raise e finally: ddp_cleanup(self, str(file)) else: self._do_train(world_size,singal=singal,singal_2=singal_2,singal_3=singal_3,singal_4=singal_4) def _setup_scheduler(self): """Initialize training learning rate scheduler.""" if self.args.cos_lr: self.lf = one_cycle(1, self.args.lrf, self.epochs) # cosine 1->hyp['lrf'] else: self.lf = lambda x: max(1 - x / self.epochs, 0) * (1.0 - self.args.lrf) + self.args.lrf # linear self.scheduler = optim.lr_scheduler.LambdaLR(self.optimizer, lr_lambda=self.lf) def _setup_ddp(self, world_size): """Initializes and sets the DistributedDataParallel parameters for training.""" torch.cuda.set_device(RANK) self.device = torch.device("cuda", RANK) # LOGGER.info(f'DDP info: RANK {RANK}, WORLD_SIZE {world_size}, DEVICE {self.device}') os.environ["NCCL_BLOCKING_WAIT"] = "1" # set to enforce timeout dist.init_process_group( "nccl" if dist.is_nccl_available() else "gloo", timeout=timedelta(seconds=10800), # 3 hours rank=RANK, world_size=world_size, ) def _setup_train(self, world_size): """Builds dataloaders and optimizer on correct rank process.""" # Model self.run_callbacks("on_pretrain_routine_start") ckpt = self.setup_model() self.model = self.model.to(self.device) self.set_model_attributes() # Freeze layers freeze_list = ( self.args.freeze if isinstance(self.args.freeze, list) else range(self.args.freeze) if isinstance(self.args.freeze, int) else [] ) always_freeze_names = [".dfl"] # always freeze these layers freeze_layer_names = [f"model.{x}." for x in freeze_list] + always_freeze_names for k, v in self.model.named_parameters(): # v.register_hook(lambda x: torch.nan_to_num(x)) # NaN to 0 (commented for erratic training results) if any(x in k for x in freeze_layer_names): LOGGER.info(f"Freezing layer '{k}'") v.requires_grad = False elif not v.requires_grad: LOGGER.info( f"WARNING ⚠️ setting 'requires_grad=True' for frozen layer '{k}'. " "See ultralytics.engine.trainer for customization of frozen layers." ) v.requires_grad = True # Check AMP self.amp = torch.tensor(self.args.amp).to(self.device) # True or False if self.amp and RANK in (-1, 0): # Single-GPU and DDP callbacks_backup = callbacks.default_callbacks.copy() # backup callbacks as check_amp() resets them self.amp = torch.tensor(check_amp(self.model), device=self.device) callbacks.default_callbacks = callbacks_backup # restore callbacks if RANK > -1 and world_size > 1: # DDP dist.broadcast(self.amp, src=0) # broadcast the tensor from rank 0 to all other ranks (returns None) self.amp = bool(self.amp) # as boolean self.scaler = torch.cuda.amp.GradScaler(enabled=self.amp) if world_size > 1: self.model = nn.parallel.DistributedDataParallel(self.model, device_ids=[RANK]) # Check imgsz gs = max(int(self.model.stride.max() if hasattr(self.model, "stride") else 32), 32) # grid size (max stride) self.args.imgsz = check_imgsz(self.args.imgsz, stride=gs, floor=gs, max_dim=1) self.stride = gs # for multi-scale training # Batch size if self.batch_size == -1 and RANK == -1: # single-GPU only, estimate best batch size self.args.batch = self.batch_size = check_train_batch_size(self.model, self.args.imgsz, self.amp) # Dataloaders batch_size = self.batch_size // max(world_size, 1) self.train_loader = self.get_dataloader(self.trainset, batch_size=batch_size, rank=RANK, mode="train") if RANK in (-1, 0): # NOTE: When training DOTA dataset, double batch size could get OOM cause some images got more than 2000 objects. self.test_loader = self.get_dataloader( self.testset, batch_size=batch_size if self.args.task == "obb" else batch_size * 2, rank=-1, mode="val" ) self.validator = self.get_validator() metric_keys = self.validator.metrics.keys + self.label_loss_items(prefix="val") self.metrics = dict(zip(metric_keys, [0] * len(metric_keys))) self.ema = ModelEMA(self.model) if self.args.plots: self.plot_training_labels() # Optimizer self.accumulate = max(round(self.args.nbs / self.batch_size), 1) # accumulate loss before optimizing weight_decay = self.args.weight_decay * self.batch_size * self.accumulate / self.args.nbs # scale weight_decay iterations = math.ceil(len(self.train_loader.dataset) / max(self.batch_size, self.args.nbs)) * self.epochs self.optimizer = self.build_optimizer( model=self.model, name=self.args.optimizer, lr=self.args.lr0, momentum=self.args.momentum, decay=weight_decay, iterations=iterations, ) # Scheduler self._setup_scheduler() self.stopper, self.stop = EarlyStopping(patience=self.args.patience), False self.resume_training(ckpt) self.scheduler.last_epoch = self.start_epoch - 1 # do not move self.run_callbacks("on_pretrain_routine_end") def _do_train(self, world_size=1, singal=None, singal_2=None, singal_3=None, singal_4=None): """Train completed, evaluate and plot if specified by arguments.""" if world_size > 1: self._setup_ddp(world_size) self._setup_train(world_size) nb = len(self.train_loader) # number of batches nw = max(round(self.args.warmup_epochs * nb), 100) if self.args.warmup_epochs > 0 else -1 # warmup iterations last_opt_step = -1 self.epoch_time = None self.epoch_time_start = time.time() self.train_time_start = time.time() self.run_callbacks("on_train_start") LOGGER.info( f'Image sizes {self.args.imgsz} train, {self.args.imgsz} val\n' f'Using {self.train_loader.num_workers * (world_size or 1)} dataloader workers\n' f"Logging results to {colorstr('bold', self.save_dir)}\n" f'Starting training for ' + (f"{self.args.time} hours..." if self.args.time else f"{self.epochs} epochs...") ) if self.args.close_mosaic: base_idx = (self.epochs - self.args.close_mosaic) * nb self.plot_idx.extend([base_idx, base_idx + 1, base_idx + 2]) epoch = self.start_epoch while True: self.epoch = epoch self.run_callbacks("on_train_epoch_start") self.model.train() if RANK != -1: self.train_loader.sampler.set_epoch(epoch) pbar = enumerate(self.train_loader) # Update dataloader attributes (optional) if epoch == (self.epochs - self.args.close_mosaic): self._close_dataloader_mosaic() self.train_loader.reset() if RANK in (-1, 0): LOGGER.info(self.progress_string()) pbar = TQDM(enumerate(self.train_loader), total=nb) self.tloss = None self.optimizer.zero_grad() singal_3.emit(len(pbar)) for i, batch in pbar: singal_2.emit(int(i)) self.run_callbacks("on_train_batch_start") # Warmup ni = i + nb * epoch if ni <= nw: xi = [0, nw] # x interp self.accumulate = max(1, int(np.interp(ni, xi, [1, self.args.nbs / self.batch_size]).round())) for j, x in enumerate(self.optimizer.param_groups): # Bias lr falls from 0.1 to lr0, all other lrs rise from 0.0 to lr0 x["lr"] = np.interp( ni, xi, [self.args.warmup_bias_lr if j == 0 else 0.0, x["initial_lr"] * self.lf(epoch)] ) if "momentum" in x: x["momentum"] = np.interp(ni, xi, [self.args.warmup_momentum, self.args.momentum]) # Forward with torch.cuda.amp.autocast(self.amp): batch = self.preprocess_batch(batch) self.loss, self.loss_items = self.model(batch) if RANK != -1: self.loss *= world_size self.tloss = ( (self.tloss * i + self.loss_items) / (i + 1) if self.tloss is not None else self.loss_items ) # Backward self.scaler.scale(self.loss).backward() # Optimize - https://pytorch.org/docs/master/notes/amp_examples.html if ni - last_opt_step >= self.accumulate: self.optimizer_step() last_opt_step = ni # Timed stopping if self.args.time: self.stop = (time.time() - self.train_time_start) > (self.args.time * 3600) if RANK != -1: # if DDP training broadcast_list = [self.stop if RANK == 0 else None] dist.broadcast_object_list(broadcast_list, 0) # broadcast 'stop' to all ranks self.stop = broadcast_list[0] if self.stop: # training time exceeded break # Log mem = f"{torch.cuda.memory_reserved() / 1E9 if torch.cuda.is_available() else 0:.3g}G" # (GB) loss_len = self.tloss.shape[0] if len(self.tloss.shape) else 1 losses = self.tloss if loss_len > 1 else torch.unsqueeze(self.tloss, 0) if RANK in (-1, 0): pbar.set_description( ("%11s" * 2 + "%11.4g" * (2 + loss_len)) % (f"{epoch + 1}/{self.epochs}", mem, *losses, batch["cls"].shape[0], batch["img"].shape[-1]) ) self.run_callbacks("on_batch_end") if self.args.plots and ni in self.plot_idx: self.plot_training_samples(batch, ni) self.run_callbacks("on_train_batch_end") self.lr = {f"lr/pg{ir}": x["lr"] for ir, x in enumerate(self.optimizer.param_groups)} # for loggers self.run_callbacks("on_train_epoch_end") if RANK in (-1, 0): final_epoch = epoch + 1 == self.epochs self.ema.update_attr(self.model, include=["yaml", "nc", "args", "names", "stride", "class_weights"]) # Validation if self.args.val or final_epoch or self.stopper.possible_stop or self.stop: self.metrics, self.fitness = self.validate() singal_4.emit(self.metrics) self.save_metrics(metrics={**self.label_loss_items(self.tloss), **self.metrics, **self.lr}) self.stop |= self.stopper(epoch + 1, self.fitness) or final_epoch if self.args.time: self.stop |= (time.time() - self.train_time_start) > (self.args.time * 3600) # Save model if self.args.save or final_epoch: self.save_model() self.run_callbacks("on_model_save") # Scheduler t = time.time() self.epoch_time = t - self.epoch_time_start self.epoch_time_start = t with warnings.catch_warnings(): warnings.simplefilter("ignore") # suppress 'Detected lr_scheduler.step() before optimizer.step()' if self.args.time: mean_epoch_time = (t - self.train_time_start) / (epoch - self.start_epoch + 1) self.epochs = self.args.epochs = math.ceil(self.args.time * 3600 / mean_epoch_time) self._setup_scheduler() self.scheduler.last_epoch = self.epoch # do not move self.stop |= epoch >= self.epochs # stop if exceeded epochs self.scheduler.step() self.run_callbacks("on_fit_epoch_end") torch.cuda.empty_cache() # clear GPU memory at end of epoch, may help reduce CUDA out of memory errors # Early Stopping if RANK != -1: # if DDP training broadcast_list = [self.stop if RANK == 0 else None] dist.broadcast_object_list(broadcast_list, 0) # broadcast 'stop' to all ranks self.stop = broadcast_list[0] if self.stop: break # must break all DDP ranks epoch += 1 singal.emit(int(epoch)) if RANK in (-1, 0): # Do final val with best.pt LOGGER.info( f"\n{epoch - self.start_epoch + 1} epochs completed in " f"{(time.time() - self.train_time_start) / 3600:.3f} hours." ) self.final_eval() if self.args.plots: self.plot_metrics() self.run_callbacks("on_train_end") torch.cuda.empty_cache() self.run_callbacks("teardown") def save_model(self): """Save model training checkpoints with additional metadata.""" import pandas as pd # scope for faster startup metrics = {**self.metrics, **{"fitness": self.fitness}} results = {k.strip(): v for k, v in pd.read_csv(self.csv).to_dict(orient="list").items()} ckpt = { "epoch": self.epoch, "best_fitness": self.best_fitness, "model": deepcopy(de_parallel(self.model)).half(), "ema": deepcopy(self.ema.ema).half(), "updates": self.ema.updates, "optimizer": self.optimizer.state_dict(), "train_args": vars(self.args), # save as dict "train_metrics": metrics, "train_results": results, "date": datetime.now().isoformat(), "version": __version__, } # Save last and best torch.save(ckpt, self.last) if self.best_fitness == self.fitness: torch.save(ckpt, self.best) if (self.save_period > 0) and (self.epoch > 0) and (self.epoch % self.save_period == 0): torch.save(ckpt, self.wdir / f"epoch{self.epoch}.pt") @staticmethod def get_dataset(data): """ Get train, val path from data dict if it exists. Returns None if data format is not recognized. """ return data["train"], data.get("val") or data.get("test") def setup_model(self): """Load/create/download model for any task.""" if isinstance(self.model, torch.nn.Module): # if model is loaded beforehand. No setup needed return model, weights = self.model, None ckpt = None if str(model).endswith(".pt"): weights, ckpt = attempt_load_one_weight(model) cfg = ckpt["model"].yaml else: cfg = model self.model = self.get_model(cfg=cfg, weights=weights, verbose=RANK == -1) # calls Model(cfg, weights) return ckpt def optimizer_step(self): """Perform a single step of the training optimizer with gradient clipping and EMA update.""" self.scaler.unscale_(self.optimizer) # unscale gradients torch.nn.utils.clip_grad_norm_(self.model.parameters(), max_norm=10.0) # clip gradients self.scaler.step(self.optimizer) self.scaler.update() self.optimizer.zero_grad() if self.ema: self.ema.update(self.model) def preprocess_batch(self, batch): """Allows custom preprocessing model inputs and ground truths depending on task type.""" return batch def validate(self): """ Runs validation on test set using self.validator. The returned dict is expected to contain "fitness" key. """ metrics = self.validator(self) fitness = metrics.pop("fitness", -self.loss.detach().cpu().numpy()) # use loss as fitness measure if not found if not self.best_fitness or self.best_fitness < fitness: self.best_fitness = fitness return metrics, fitness def get_model(self, cfg=None, weights=None, verbose=True): """Get model and raise NotImplementedError for loading cfg files.""" raise NotImplementedError("This task trainer doesn't support loading cfg files") def get_validator(self): """Returns a NotImplementedError when the get_validator function is called.""" raise NotImplementedError("get_validator function not implemented in trainer") def get_dataloader(self, dataset_path, batch_size=16, rank=0, mode="train"): """Returns dataloader derived from torch.data.Dataloader.""" raise NotImplementedError("get_dataloader function not implemented in trainer") def build_dataset(self, img_path, mode="train", batch=None): """Build dataset.""" raise NotImplementedError("build_dataset function not implemented in trainer") def label_loss_items(self, loss_items=None, prefix="train"): """ Returns a loss dict with labelled training loss items tensor. Note: This is not needed for classification but necessary for segmentation & detection """ return {"loss": loss_items} if loss_items is not None else ["loss"] def set_model_attributes(self): """To set or update model parameters before training.""" self.model.names = self.data["names"] def build_targets(self, preds, targets): """Builds target tensors for training YOLO model.""" pass def progress_string(self): """Returns a string describing training progress.""" return "" # TODO: may need to put these following functions into callback def plot_training_samples(self, batch, ni): """Plots training samples during YOLO training.""" pass def plot_training_labels(self): """Plots training labels for YOLO model.""" pass def save_metrics(self, metrics): """Saves training metrics to a CSV file.""" keys, vals = list(metrics.keys()), list(metrics.values()) n = len(metrics) + 1 # number of cols s = "" if self.csv.exists() else (("%23s," * n % tuple(["epoch"] + keys)).rstrip(",") + "\n") # header with open(self.csv, "a") as f: f.write(s + ("%23.5g," * n % tuple([self.epoch + 1] + vals)).rstrip(",") + "\n") def plot_metrics(self): """Plot and display metrics visually.""" pass def on_plot(self, name, data=None): """Registers plots (e.g. to be consumed in callbacks)""" path = Path(name) self.plots[path] = {"data": data, "timestamp": time.time()} def final_eval(self): """Performs final evaluation and validation for object detection YOLO model.""" for f in self.last, self.best: if f.exists(): strip_optimizer(f) # strip optimizers if f is self.best: LOGGER.info(f"\nValidating {f}...") self.validator.args.plots = self.args.plots self.metrics = self.validator(model=f) self.metrics.pop("fitness", None) self.run_callbacks("on_fit_epoch_end") def check_resume(self, overrides): """Check if resume checkpoint exists and update arguments accordingly.""" resume = self.args.resume if resume: try: exists = isinstance(resume, (str, Path)) and Path(resume).exists() last = Path(check_file(resume) if exists else get_latest_run()) # Check that resume data YAML exists, otherwise strip to force re-download of dataset ckpt_args = attempt_load_weights(last).args if not Path(ckpt_args["data"]).exists(): ckpt_args["data"] = self.args.data resume = True self.args = get_cfg(ckpt_args) self.args.model = str(last) # reinstate model for k in "imgsz", "batch": # allow arg updates to reduce memory on resume if crashed due to CUDA OOM if k in overrides: setattr(self.args, k, overrides[k]) except Exception as e: raise FileNotFoundError( "Resume checkpoint not found. Please pass a valid checkpoint to resume from, " "i.e. 'yolo train resume model=path/to/last.pt'" ) from e self.resume = resume def resume_training(self, ckpt): """Resume YOLO training from given epoch and best fitness.""" if ckpt is None: return best_fitness = 0.0 start_epoch = ckpt["epoch"] + 1 if ckpt["optimizer"] is not None: self.optimizer.load_state_dict(ckpt["optimizer"]) # optimizer best_fitness = ckpt["best_fitness"] if self.ema and ckpt.get("ema"): self.ema.ema.load_state_dict(ckpt["ema"].float().state_dict()) # EMA self.ema.updates = ckpt["updates"] if self.resume: assert start_epoch > 0, ( f"{self.args.model} training to {self.epochs} epochs is finished, nothing to resume.\n" f"Start a new training without resuming, i.e. 'yolo train model={self.args.model}'" ) LOGGER.info( f"Resuming training from {self.args.model} from epoch {start_epoch + 1} to {self.epochs} total epochs" ) if self.epochs < start_epoch: LOGGER.info( f"{self.model} has been trained for {ckpt['epoch']} epochs. Fine-tuning for {self.epochs} more epochs." ) self.epochs += ckpt["epoch"] # finetune additional epochs self.best_fitness = best_fitness self.start_epoch = start_epoch if start_epoch > (self.epochs - self.args.close_mosaic): self._close_dataloader_mosaic() def _close_dataloader_mosaic(self): """Update dataloaders to stop using mosaic augmentation.""" if hasattr(self.train_loader.dataset, "mosaic"): self.train_loader.dataset.mosaic = False if hasattr(self.train_loader.dataset, "close_mosaic"): LOGGER.info("Closing dataloader mosaic") self.train_loader.dataset.close_mosaic(hyp=self.args) def build_optimizer(self, model, name="auto", lr=0.001, momentum=0.9, decay=1e-5, iterations=1e5): """ Constructs an optimizer for the given model, based on the specified optimizer name, learning rate, momentum, weight decay, and number of iterations. Args: model (torch.nn.Module): The model for which to build an optimizer. name (str, optional): The name of the optimizer to use. If 'auto', the optimizer is selected based on the number of iterations. Default: 'auto'. lr (float, optional): The learning rate for the optimizer. Default: 0.001. momentum (float, optional): The momentum factor for the optimizer. Default: 0.9. decay (float, optional): The weight decay for the optimizer. Default: 1e-5. iterations (float, optional): The number of iterations, which determines the optimizer if name is 'auto'. Default: 1e5. Returns: (torch.optim.Optimizer): The constructed optimizer. """ g = [], [], [] # optimizer parameter groups bn = tuple(v for k, v in nn.__dict__.items() if "Norm" in k) # normalization layers, i.e. BatchNorm2d() if name == "auto": LOGGER.info( f"{colorstr('optimizer:')} 'optimizer=auto' found, " f"ignoring 'lr0={self.args.lr0}' and 'momentum={self.args.momentum}' and " f"determining best 'optimizer', 'lr0' and 'momentum' automatically... " ) nc = getattr(model, "nc", 10) # number of classes lr_fit = round(0.002 * 5 / (4 + nc), 6) # lr0 fit equation to 6 decimal places name, lr, momentum = ("SGD", 0.01, 0.9) if iterations > 10000 else ("AdamW", lr_fit, 0.9) self.args.warmup_bias_lr = 0.0 # no higher than 0.01 for Adam for module_name, module in model.named_modules(): for param_name, param in module.named_parameters(recurse=False): fullname = f"{module_name}.{param_name}" if module_name else param_name if "bias" in fullname: # bias (no decay) g[2].append(param) elif isinstance(module, bn): # weight (no decay) g[1].append(param) else: # weight (with decay) g[0].append(param) if name in ("Adam", "Adamax", "AdamW", "NAdam", "RAdam"): optimizer = getattr(optim, name, optim.Adam)(g[2], lr=lr, betas=(momentum, 0.999), weight_decay=0.0) elif name == "RMSProp": optimizer = optim.RMSprop(g[2], lr=lr, momentum=momentum) elif name == "SGD": optimizer = optim.SGD(g[2], lr=lr, momentum=momentum, nesterov=True) else: raise NotImplementedError( f"Optimizer '{name}' not found in list of available optimizers " f"[Adam, AdamW, NAdam, RAdam, RMSProp, SGD, auto]." "To request support for addition optimizers please visit https://github.com/ultralytics/ultralytics." ) optimizer.add_param_group({"params": g[0], "weight_decay": decay}) # add g0 with weight_decay optimizer.add_param_group({"params": g[1], "weight_decay": 0.0}) # add g1 (BatchNorm2d weights) LOGGER.info( f"{colorstr('optimizer:')} {type(optimizer).__name__}(lr={lr}, momentum={momentum}) with parameter groups " f'{len(g[1])} weight(decay=0.0), {len(g[0])} weight(decay={decay}), {len(g[2])} bias(decay=0.0)' ) return optimizer
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/engine/abc/trainer.py
Python
unknown
34,597
# Ultralytics YOLO 🚀, AGPL-3.0 license """ Export a YOLOv8 PyTorch model to other formats. TensorFlow exports authored by https://github.com/zldrobit Format | `format=argument` | Model --- | --- | --- PyTorch | - | yolov8n.pt TorchScript | `torchscript` | yolov8n.torchscript ONNX | `onnx` | yolov8n.onnx OpenVINO | `openvino` | yolov8n_openvino_model/ TensorRT | `engine` | yolov8n.engine CoreML | `coreml` | yolov8n.mlpackage TensorFlow SavedModel | `saved_model` | yolov8n_saved_model/ TensorFlow GraphDef | `pb` | yolov8n.pb TensorFlow Lite | `tflite` | yolov8n.tflite TensorFlow Edge TPU | `edgetpu` | yolov8n_edgetpu.tflite TensorFlow.js | `tfjs` | yolov8n_web_model/ PaddlePaddle | `paddle` | yolov8n_paddle_model/ ncnn | `ncnn` | yolov8n_ncnn_model/ Requirements: $ pip install "ultralytics[export]" Python: from ultralytics import YOLO model = YOLO('yolov8n.pt') results = model.export(format='onnx') CLI: $ yolo mode=export model=yolov8n.pt format=onnx Inference: $ yolo predict model=yolov8n.pt # PyTorch yolov8n.torchscript # TorchScript yolov8n.onnx # ONNX Runtime or OpenCV DNN with dnn=True yolov8n_openvino_model # OpenVINO yolov8n.engine # TensorRT yolov8n.mlpackage # CoreML (macOS-only) yolov8n_saved_model # TensorFlow SavedModel yolov8n.pb # TensorFlow GraphDef yolov8n.tflite # TensorFlow Lite yolov8n_edgetpu.tflite # TensorFlow Edge TPU yolov8n_paddle_model # PaddlePaddle TensorFlow.js: $ cd .. && git clone https://github.com/zldrobit/tfjs-yolov5-example.git && cd tfjs-yolov5-example $ npm install $ ln -s ../../yolov5/yolov8n_web_model public/yolov8n_web_model $ npm start """ import json import os import shutil import subprocess import time import warnings from copy import deepcopy from datetime import datetime from pathlib import Path import numpy as np import torch from ultralytics.cfg import get_cfg from ultralytics.data.dataset import YOLODataset from ultralytics.data.utils import check_det_dataset from ultralytics.nn.autobackend import check_class_names, default_class_names from ultralytics.nn.modules import C2f, Detect, RTDETRDecoder from ultralytics.nn.tasks import DetectionModel, SegmentationModel from ultralytics.utils import ( ARM64, DEFAULT_CFG, LINUX, LOGGER, MACOS, ROOT, WINDOWS, __version__, callbacks, colorstr, get_default_args, yaml_save, ) from ultralytics.utils.checks import check_imgsz, check_is_path_safe, check_requirements, check_version from ultralytics.utils.downloads import attempt_download_asset, get_github_assets from ultralytics.utils.files import file_size, spaces_in_path from ultralytics.utils.ops import Profile from ultralytics.utils.torch_utils import get_latest_opset, select_device, smart_inference_mode def export_formats(): """YOLOv8 export formats.""" import pandas x = [ ["PyTorch", "-", ".pt", True, True], ["TorchScript", "torchscript", ".torchscript", True, True], ["ONNX", "onnx", ".onnx", True, True], ["OpenVINO", "openvino", "_openvino_model", True, False], ["TensorRT", "engine", ".engine", False, True], ["CoreML", "coreml", ".mlpackage", True, False], ["TensorFlow SavedModel", "saved_model", "_saved_model", True, True], ["TensorFlow GraphDef", "pb", ".pb", True, True], ["TensorFlow Lite", "tflite", ".tflite", True, False], ["TensorFlow Edge TPU", "edgetpu", "_edgetpu.tflite", True, False], ["TensorFlow.js", "tfjs", "_web_model", True, False], ["PaddlePaddle", "paddle", "_paddle_model", True, True], ["ncnn", "ncnn", "_ncnn_model", True, True], ] return pandas.DataFrame(x, columns=["Format", "Argument", "Suffix", "CPU", "GPU"]) def gd_outputs(gd): """TensorFlow GraphDef model output node names.""" name_list, input_list = [], [] for node in gd.node: # tensorflow.core.framework.node_def_pb2.NodeDef name_list.append(node.name) input_list.extend(node.input) return sorted(f"{x}:0" for x in list(set(name_list) - set(input_list)) if not x.startswith("NoOp")) def try_export(inner_func): """YOLOv8 export decorator, i..e @try_export.""" inner_args = get_default_args(inner_func) def outer_func(*args, **kwargs): """Export a model.""" prefix = inner_args["prefix"] try: with Profile() as dt: f, model = inner_func(*args, **kwargs) LOGGER.info(f"{prefix} export success ✅ {dt.t:.1f}s, saved as '{f}' ({file_size(f):.1f} MB)") return f, model except Exception as e: LOGGER.info(f"{prefix} export failure ❌ {dt.t:.1f}s: {e}") raise e return outer_func class Exporter: """ A class for exporting a model. Attributes: args (SimpleNamespace): Configuration for the exporter. callbacks (list, optional): List of callback functions. Defaults to None. """ def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): """ Initializes the Exporter class. Args: cfg (str, optional): Path to a configuration file. Defaults to DEFAULT_CFG. overrides (dict, optional): Configuration overrides. Defaults to None. _callbacks (dict, optional): Dictionary of callback functions. Defaults to None. """ self.args = get_cfg(cfg, overrides) if self.args.format.lower() in ("coreml", "mlmodel"): # fix attempt for protobuf<3.20.x errors os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python" # must run before TensorBoard callback self.callbacks = _callbacks or callbacks.get_default_callbacks() callbacks.add_integration_callbacks(self) @smart_inference_mode() def __call__(self, model=None): """Returns list of exported files/dirs after running callbacks.""" self.run_callbacks("on_export_start") t = time.time() fmt = self.args.format.lower() # to lowercase if fmt in ("tensorrt", "trt"): # 'engine' aliases fmt = "engine" if fmt in ("mlmodel", "mlpackage", "mlprogram", "apple", "ios", "coreml"): # 'coreml' aliases fmt = "coreml" fmts = tuple(export_formats()["Argument"][1:]) # available export formats flags = [x == fmt for x in fmts] if sum(flags) != 1: raise ValueError(f"Invalid export format='{fmt}'. Valid formats are {fmts}") jit, onnx, xml, engine, coreml, saved_model, pb, tflite, edgetpu, tfjs, paddle, ncnn = flags # export booleans # Device if fmt == "engine" and self.args.device is None: LOGGER.warning("WARNING ⚠️ TensorRT requires GPU export, automatically assigning device=0") self.args.device = "0" self.device = select_device("cpu" if self.args.device is None else self.args.device) # Checks if not hasattr(model, "names"): model.names = default_class_names() model.names = check_class_names(model.names) if self.args.half and onnx and self.device.type == "cpu": LOGGER.warning("WARNING ⚠️ half=True only compatible with GPU export, i.e. use device=0") self.args.half = False assert not self.args.dynamic, "half=True not compatible with dynamic=True, i.e. use only one." self.imgsz = check_imgsz(self.args.imgsz, stride=model.stride, min_dim=2) # check image size if self.args.optimize: assert not ncnn, "optimize=True not compatible with format='ncnn', i.e. use optimize=False" assert self.device.type == "cpu", "optimize=True not compatible with cuda devices, i.e. use device='cpu'" if edgetpu and not LINUX: raise SystemError("Edge TPU export only supported on Linux. See https://coral.ai/docs/edgetpu/compiler/") # Input im = torch.zeros(self.args.batch, 3, *self.imgsz).to(self.device) file = Path( getattr(model, "pt_path", None) or getattr(model, "yaml_file", None) or model.yaml.get("yaml_file", "") ) if file.suffix in {".yaml", ".yml"}: file = Path(file.name) # Update model model = deepcopy(model).to(self.device) for p in model.parameters(): p.requires_grad = False model.eval() model.float() model = model.fuse() for m in model.modules(): if isinstance(m, (Detect, RTDETRDecoder)): # Segment and Pose use Detect base class m.dynamic = self.args.dynamic m.export = True m.format = self.args.format elif isinstance(m, C2f) and not any((saved_model, pb, tflite, edgetpu, tfjs)): # EdgeTPU does not support FlexSplitV while split provides cleaner ONNX graph m.forward = m.forward_split y = None for _ in range(2): y = model(im) # dry runs if self.args.half and onnx and self.device.type != "cpu": im, model = im.half(), model.half() # to FP16 # Filter warnings warnings.filterwarnings("ignore", category=torch.jit.TracerWarning) # suppress TracerWarning warnings.filterwarnings("ignore", category=UserWarning) # suppress shape prim::Constant missing ONNX warning warnings.filterwarnings("ignore", category=DeprecationWarning) # suppress CoreML np.bool deprecation warning # Assign self.im = im self.model = model self.file = file self.output_shape = ( tuple(y.shape) if isinstance(y, torch.Tensor) else tuple(tuple(x.shape if isinstance(x, torch.Tensor) else []) for x in y) ) self.pretty_name = Path(self.model.yaml.get("yaml_file", self.file)).stem.replace("yolo", "YOLO") data = model.args["data"] if hasattr(model, "args") and isinstance(model.args, dict) else "" description = f'Ultralytics {self.pretty_name} model {f"trained on {data}" if data else ""}' self.metadata = { "description": description, "author": "Ultralytics", "license": "AGPL-3.0 https://ultralytics.com/license", "date": datetime.now().isoformat(), "version": __version__, "stride": int(max(model.stride)), "task": model.task, "batch": self.args.batch, "imgsz": self.imgsz, "names": model.names, } # model metadata if model.task == "pose": self.metadata["kpt_shape"] = model.model[-1].kpt_shape LOGGER.info( f"\n{colorstr('PyTorch:')} starting from '{file}' with input shape {tuple(im.shape)} BCHW and " f'output shape(s) {self.output_shape} ({file_size(file):.1f} MB)' ) # Exports f = [""] * len(fmts) # exported filenames if jit or ncnn: # TorchScript f[0], _ = self.export_torchscript() if engine: # TensorRT required before ONNX f[1], _ = self.export_engine() if onnx or xml: # OpenVINO requires ONNX f[2], _ = self.export_onnx() if xml: # OpenVINO f[3], _ = self.export_openvino() if coreml: # CoreML f[4], _ = self.export_coreml() if any((saved_model, pb, tflite, edgetpu, tfjs)): # TensorFlow formats self.args.int8 |= edgetpu f[5], keras_model = self.export_saved_model() if pb or tfjs: # pb prerequisite to tfjs f[6], _ = self.export_pb(keras_model=keras_model) if tflite: f[7], _ = self.export_tflite(keras_model=keras_model, nms=False, agnostic_nms=self.args.agnostic_nms) if edgetpu: f[8], _ = self.export_edgetpu(tflite_model=Path(f[5]) / f"{self.file.stem}_full_integer_quant.tflite") if tfjs: f[9], _ = self.export_tfjs() if paddle: # PaddlePaddle f[10], _ = self.export_paddle() if ncnn: # ncnn f[11], _ = self.export_ncnn() # Finish f = [str(x) for x in f if x] # filter out '' and None if any(f): f = str(Path(f[-1])) square = self.imgsz[0] == self.imgsz[1] s = ( "" if square else f"WARNING ⚠️ non-PyTorch val requires square images, 'imgsz={self.imgsz}' will not " f"work. Use export 'imgsz={max(self.imgsz)}' if val is required." ) imgsz = self.imgsz[0] if square else str(self.imgsz)[1:-1].replace(" ", "") predict_data = f"data={data}" if model.task == "segment" and fmt == "pb" else "" q = "int8" if self.args.int8 else "half" if self.args.half else "" # quantization LOGGER.info( f'\nExport complete ({time.time() - t:.1f}s)' f"\nResults saved to {colorstr('bold', file.parent.resolve())}" f'\nPredict: yolo predict task={model.task} model={f} imgsz={imgsz} {q} {predict_data}' f'\nValidate: yolo val task={model.task} model={f} imgsz={imgsz} data={data} {q} {s}' f'\nVisualize: https://netron.app' ) self.run_callbacks("on_export_end") return f # return list of exported files/dirs @try_export def export_torchscript(self, prefix=colorstr("TorchScript:")): """YOLOv8 TorchScript model export.""" LOGGER.info(f"\n{prefix} starting export with torch {torch.__version__}...") f = self.file.with_suffix(".torchscript") ts = torch.jit.trace(self.model, self.im, strict=False) extra_files = {"config.txt": json.dumps(self.metadata)} # torch._C.ExtraFilesMap() if self.args.optimize: # https://pytorch.org/tutorials/recipes/mobile_interpreter.html LOGGER.info(f"{prefix} optimizing for mobile...") from torch.utils.mobile_optimizer import optimize_for_mobile optimize_for_mobile(ts)._save_for_lite_interpreter(str(f), _extra_files=extra_files) else: ts.save(str(f), _extra_files=extra_files) return f, None @try_export def export_onnx(self, prefix=colorstr("ONNX:")): """YOLOv8 ONNX export.""" requirements = ["onnx>=1.12.0"] if self.args.simplify: requirements += ["onnxsim>=0.4.33", "onnxruntime-gpu" if torch.cuda.is_available() else "onnxruntime"] check_requirements(requirements) import onnx # noqa opset_version = self.args.opset or get_latest_opset() LOGGER.info(f"\n{prefix} starting export with onnx {onnx.__version__} opset {opset_version}...") f = str(self.file.with_suffix(".onnx")) output_names = ["output0", "output1"] if isinstance(self.model, SegmentationModel) else ["output0"] dynamic = self.args.dynamic if dynamic: dynamic = {"images": {0: "batch", 2: "height", 3: "width"}} # shape(1,3,640,640) if isinstance(self.model, SegmentationModel): dynamic["output0"] = {0: "batch", 2: "anchors"} # shape(1, 116, 8400) dynamic["output1"] = {0: "batch", 2: "mask_height", 3: "mask_width"} # shape(1,32,160,160) elif isinstance(self.model, DetectionModel): dynamic["output0"] = {0: "batch", 2: "anchors"} # shape(1, 84, 8400) torch.onnx.export( self.model.cpu() if dynamic else self.model, # dynamic=True only compatible with cpu self.im.cpu() if dynamic else self.im, f, verbose=False, opset_version=opset_version, do_constant_folding=True, # WARNING: DNN inference with torch>=1.12 may require do_constant_folding=False input_names=["images"], output_names=output_names, dynamic_axes=dynamic or None, ) # Checks model_onnx = onnx.load(f) # load onnx model # onnx.checker.check_model(model_onnx) # check onnx model # Simplify if self.args.simplify: try: import onnxsim LOGGER.info(f"{prefix} simplifying with onnxsim {onnxsim.__version__}...") # subprocess.run(f'onnxsim "{f}" "{f}"', shell=True) model_onnx, check = onnxsim.simplify(model_onnx) assert check, "Simplified ONNX model could not be validated" except Exception as e: LOGGER.info(f"{prefix} simplifier failure: {e}") # Metadata for k, v in self.metadata.items(): meta = model_onnx.metadata_props.add() meta.key, meta.value = k, str(v) onnx.save(model_onnx, f) return f, model_onnx @try_export def export_openvino(self, prefix=colorstr("OpenVINO:")): """YOLOv8 OpenVINO export.""" check_requirements("openvino-dev>=2023.0") # requires openvino-dev: https://pypi.org/project/openvino-dev/ import openvino.runtime as ov # noqa from openvino.tools import mo # noqa LOGGER.info(f"\n{prefix} starting export with openvino {ov.__version__}...") f = str(self.file).replace(self.file.suffix, f"_openvino_model{os.sep}") fq = str(self.file).replace(self.file.suffix, f"_int8_openvino_model{os.sep}") f_onnx = self.file.with_suffix(".onnx") f_ov = str(Path(f) / self.file.with_suffix(".xml").name) fq_ov = str(Path(fq) / self.file.with_suffix(".xml").name) def serialize(ov_model, file): """Set RT info, serialize and save metadata YAML.""" ov_model.set_rt_info("YOLOv8", ["model_info", "model_type"]) ov_model.set_rt_info(True, ["model_info", "reverse_input_channels"]) ov_model.set_rt_info(114, ["model_info", "pad_value"]) ov_model.set_rt_info([255.0], ["model_info", "scale_values"]) ov_model.set_rt_info(self.args.iou, ["model_info", "iou_threshold"]) ov_model.set_rt_info([v.replace(" ", "_") for v in self.model.names.values()], ["model_info", "labels"]) if self.model.task != "classify": ov_model.set_rt_info("fit_to_window_letterbox", ["model_info", "resize_type"]) ov.serialize(ov_model, file) # save yaml_save(Path(file).parent / "metadata.yaml", self.metadata) # add metadata.yaml ov_model = mo.convert_model( f_onnx, model_name=self.pretty_name, framework="onnx", compress_to_fp16=self.args.half ) # export if self.args.int8: if not self.args.data: self.args.data = DEFAULT_CFG.data or "coco128.yaml" LOGGER.warning( f"{prefix} WARNING ⚠️ INT8 export requires a missing 'data' arg for calibration. " f"Using default 'data={self.args.data}'." ) check_requirements("nncf>=2.5.0") import nncf def transform_fn(data_item): """Quantization transform function.""" assert ( data_item["img"].dtype == torch.uint8 ), "Input image must be uint8 for the quantization preprocessing" im = data_item["img"].numpy().astype(np.float32) / 255.0 # uint8 to fp16/32 and 0 - 255 to 0.0 - 1.0 return np.expand_dims(im, 0) if im.ndim == 3 else im # Generate calibration data for integer quantization LOGGER.info(f"{prefix} collecting INT8 calibration images from 'data={self.args.data}'") data = check_det_dataset(self.args.data) dataset = YOLODataset(data["val"], data=data, imgsz=self.imgsz[0], augment=False) n = len(dataset) if n < 300: LOGGER.warning(f"{prefix} WARNING ⚠️ >300 images recommended for INT8 calibration, found {n} images.") quantization_dataset = nncf.Dataset(dataset, transform_fn) ignored_scope = None if isinstance(self.model.model[-1], (Detect, RTDETRDecoder)): # Segment and Pose use Detect base class # get detection module name in onnx head_module_name = ".".join(list(self.model.named_modules())[-1][0].split(".")[:2]) ignored_scope = nncf.IgnoredScope( # ignore operations patterns=[ f"/{head_module_name}/Add", f"/{head_module_name}/Sub", f"/{head_module_name}/Mul", f"/{head_module_name}/Div", f"/{head_module_name}/dfl", ], names=[f"/{head_module_name}/Sigmoid"], ) quantized_ov_model = nncf.quantize( ov_model, quantization_dataset, preset=nncf.QuantizationPreset.MIXED, ignored_scope=ignored_scope ) serialize(quantized_ov_model, fq_ov) return fq, None serialize(ov_model, f_ov) return f, None @try_export def export_paddle(self, prefix=colorstr("PaddlePaddle:")): """YOLOv8 Paddle export.""" check_requirements(("paddlepaddle", "x2paddle")) import x2paddle # noqa from x2paddle.convert import pytorch2paddle # noqa LOGGER.info(f"\n{prefix} starting export with X2Paddle {x2paddle.__version__}...") f = str(self.file).replace(self.file.suffix, f"_paddle_model{os.sep}") pytorch2paddle(module=self.model, save_dir=f, jit_type="trace", input_examples=[self.im]) # export yaml_save(Path(f) / "metadata.yaml", self.metadata) # add metadata.yaml return f, None @try_export def export_ncnn(self, prefix=colorstr("ncnn:")): """ YOLOv8 ncnn export using PNNX https://github.com/pnnx/pnnx. """ check_requirements("ncnn") import ncnn # noqa LOGGER.info(f"\n{prefix} starting export with ncnn {ncnn.__version__}...") f = Path(str(self.file).replace(self.file.suffix, f"_ncnn_model{os.sep}")) f_ts = self.file.with_suffix(".torchscript") name = Path("pnnx.exe" if WINDOWS else "pnnx") # PNNX filename pnnx = name if name.is_file() else ROOT / name if not pnnx.is_file(): LOGGER.warning( f"{prefix} WARNING ⚠️ PNNX not found. Attempting to download binary file from " "https://github.com/pnnx/pnnx/.\nNote PNNX Binary file must be placed in current working directory " f"or in {ROOT}. See PNNX repo for full installation instructions." ) system = ["macos"] if MACOS else ["windows"] if WINDOWS else ["ubuntu", "linux"] # operating system try: _, assets = get_github_assets(repo="pnnx/pnnx", retry=True) url = [x for x in assets if any(s in x for s in system)][0] except Exception as e: url = f"https://github.com/pnnx/pnnx/releases/download/20231127/pnnx-20231127-{system[0]}.zip" LOGGER.warning(f"{prefix} WARNING ⚠️ PNNX GitHub assets not found: {e}, using default {url}") asset = attempt_download_asset(url, repo="pnnx/pnnx", release="latest") if check_is_path_safe(Path.cwd(), asset): # avoid path traversal security vulnerability unzip_dir = Path(asset).with_suffix("") (unzip_dir / name).rename(pnnx) # move binary to ROOT shutil.rmtree(unzip_dir) # delete unzip dir Path(asset).unlink() # delete zip pnnx.chmod(0o777) # set read, write, and execute permissions for everyone ncnn_args = [ f'ncnnparam={f / "model.ncnn.param"}', f'ncnnbin={f / "model.ncnn.bin"}', f'ncnnpy={f / "model_ncnn.py"}', ] pnnx_args = [ f'pnnxparam={f / "model.pnnx.param"}', f'pnnxbin={f / "model.pnnx.bin"}', f'pnnxpy={f / "model_pnnx.py"}', f'pnnxonnx={f / "model.pnnx.onnx"}', ] cmd = [ str(pnnx), str(f_ts), *ncnn_args, *pnnx_args, f"fp16={int(self.args.half)}", f"device={self.device.type}", f'inputshape="{[self.args.batch, 3, *self.imgsz]}"', ] f.mkdir(exist_ok=True) # make ncnn_model directory LOGGER.info(f"{prefix} running '{' '.join(cmd)}'") subprocess.run(cmd, check=True) # Remove debug files pnnx_files = [x.split("=")[-1] for x in pnnx_args] for f_debug in ("debug.bin", "debug.param", "debug2.bin", "debug2.param", *pnnx_files): Path(f_debug).unlink(missing_ok=True) yaml_save(f / "metadata.yaml", self.metadata) # add metadata.yaml return str(f), None @try_export def export_coreml(self, prefix=colorstr("CoreML:")): """YOLOv8 CoreML export.""" mlmodel = self.args.format.lower() == "mlmodel" # legacy *.mlmodel export format requested check_requirements("coremltools>=6.0,<=6.2" if mlmodel else "coremltools>=7.0") import coremltools as ct # noqa LOGGER.info(f"\n{prefix} starting export with coremltools {ct.__version__}...") assert not WINDOWS, "CoreML export is not supported on Windows, please run on macOS or Linux." f = self.file.with_suffix(".mlmodel" if mlmodel else ".mlpackage") if f.is_dir(): shutil.rmtree(f) bias = [0.0, 0.0, 0.0] scale = 1 / 255 classifier_config = None if self.model.task == "classify": classifier_config = ct.ClassifierConfig(list(self.model.names.values())) if self.args.nms else None model = self.model elif self.model.task == "detect": model = IOSDetectModel(self.model, self.im) if self.args.nms else self.model else: if self.args.nms: LOGGER.warning(f"{prefix} WARNING ⚠️ 'nms=True' is only available for Detect models like 'yolov8n.pt'.") # TODO CoreML Segment and Pose model pipelining model = self.model ts = torch.jit.trace(model.eval(), self.im, strict=False) # TorchScript model ct_model = ct.convert( ts, inputs=[ct.ImageType("image", shape=self.im.shape, scale=scale, bias=bias)], classifier_config=classifier_config, convert_to="neuralnetwork" if mlmodel else "mlprogram", ) bits, mode = (8, "kmeans") if self.args.int8 else (16, "linear") if self.args.half else (32, None) if bits < 32: if "kmeans" in mode: check_requirements("scikit-learn") # scikit-learn package required for k-means quantization if mlmodel: ct_model = ct.models.neural_network.quantization_utils.quantize_weights(ct_model, bits, mode) elif bits == 8: # mlprogram already quantized to FP16 import coremltools.optimize.coreml as cto op_config = cto.OpPalettizerConfig(mode="kmeans", nbits=bits, weight_threshold=512) config = cto.OptimizationConfig(global_config=op_config) ct_model = cto.palettize_weights(ct_model, config=config) if self.args.nms and self.model.task == "detect": if mlmodel: import platform # coremltools<=6.2 NMS export requires Python<3.11 check_version(platform.python_version(), "<3.11", name="Python ", hard=True) weights_dir = None else: ct_model.save(str(f)) # save otherwise weights_dir does not exist weights_dir = str(f / "Data/com.apple.CoreML/weights") ct_model = self._pipeline_coreml(ct_model, weights_dir=weights_dir) m = self.metadata # metadata dict ct_model.short_description = m.pop("description") ct_model.author = m.pop("author") ct_model.license = m.pop("license") ct_model.version = m.pop("version") ct_model.user_defined_metadata.update({k: str(v) for k, v in m.items()}) try: ct_model.save(str(f)) # save *.mlpackage except Exception as e: LOGGER.warning( f"{prefix} WARNING ⚠️ CoreML export to *.mlpackage failed ({e}), reverting to *.mlmodel export. " f"Known coremltools Python 3.11 and Windows bugs https://github.com/apple/coremltools/issues/1928." ) f = f.with_suffix(".mlmodel") ct_model.save(str(f)) return f, ct_model @try_export def export_engine(self, prefix=colorstr("TensorRT:")): """YOLOv8 TensorRT export https://developer.nvidia.com/tensorrt.""" assert self.im.device.type != "cpu", "export running on CPU but must be on GPU, i.e. use 'device=0'" f_onnx, _ = self.export_onnx() # run before trt import https://github.com/ultralytics/ultralytics/issues/7016 try: import tensorrt as trt # noqa except ImportError: if LINUX: check_requirements("nvidia-tensorrt", cmds="-U --index-url https://pypi.ngc.nvidia.com") import tensorrt as trt # noqa check_version(trt.__version__, "7.0.0", hard=True) # require tensorrt>=7.0.0 self.args.simplify = True LOGGER.info(f"\n{prefix} starting export with TensorRT {trt.__version__}...") assert Path(f_onnx).exists(), f"failed to export ONNX file: {f_onnx}" f = self.file.with_suffix(".engine") # TensorRT engine file logger = trt.Logger(trt.Logger.INFO) if self.args.verbose: logger.min_severity = trt.Logger.Severity.VERBOSE builder = trt.Builder(logger) config = builder.create_builder_config() config.max_workspace_size = self.args.workspace * 1 << 30 # config.set_memory_pool_limit(trt.MemoryPoolType.WORKSPACE, workspace << 30) # fix TRT 8.4 deprecation notice flag = 1 << int(trt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH) network = builder.create_network(flag) parser = trt.OnnxParser(network, logger) if not parser.parse_from_file(f_onnx): raise RuntimeError(f"failed to load ONNX file: {f_onnx}") inputs = [network.get_input(i) for i in range(network.num_inputs)] outputs = [network.get_output(i) for i in range(network.num_outputs)] for inp in inputs: LOGGER.info(f'{prefix} input "{inp.name}" with shape{inp.shape} {inp.dtype}') for out in outputs: LOGGER.info(f'{prefix} output "{out.name}" with shape{out.shape} {out.dtype}') if self.args.dynamic: shape = self.im.shape if shape[0] <= 1: LOGGER.warning(f"{prefix} WARNING ⚠️ 'dynamic=True' model requires max batch size, i.e. 'batch=16'") profile = builder.create_optimization_profile() for inp in inputs: profile.set_shape(inp.name, (1, *shape[1:]), (max(1, shape[0] // 2), *shape[1:]), shape) config.add_optimization_profile(profile) LOGGER.info( f"{prefix} building FP{16 if builder.platform_has_fast_fp16 and self.args.half else 32} engine as {f}" ) if builder.platform_has_fast_fp16 and self.args.half: config.set_flag(trt.BuilderFlag.FP16) del self.model torch.cuda.empty_cache() # Write file with builder.build_engine(network, config) as engine, open(f, "wb") as t: # Metadata meta = json.dumps(self.metadata) t.write(len(meta).to_bytes(4, byteorder="little", signed=True)) t.write(meta.encode()) # Model t.write(engine.serialize()) return f, None @try_export def export_saved_model(self, prefix=colorstr("TensorFlow SavedModel:")): """YOLOv8 TensorFlow SavedModel export.""" cuda = torch.cuda.is_available() try: import tensorflow as tf # noqa except ImportError: check_requirements(f"tensorflow{'-macos' if MACOS else '-aarch64' if ARM64 else '' if cuda else '-cpu'}") import tensorflow as tf # noqa check_requirements( ( "onnx", "onnx2tf>=1.15.4,<=1.17.5", "sng4onnx>=1.0.1", "onnxsim>=0.4.33", "onnx_graphsurgeon>=0.3.26", "tflite_support", "onnxruntime-gpu" if cuda else "onnxruntime", ), cmds="--extra-index-url https://pypi.ngc.nvidia.com", ) # onnx_graphsurgeon only on NVIDIA LOGGER.info(f"\n{prefix} starting export with tensorflow {tf.__version__}...") check_version( tf.__version__, "<=2.13.1", name="tensorflow", verbose=True, msg="https://github.com/ultralytics/ultralytics/issues/5161", ) f = Path(str(self.file).replace(self.file.suffix, "_saved_model")) if f.is_dir(): import shutil shutil.rmtree(f) # delete output folder # Pre-download calibration file to fix https://github.com/PINTO0309/onnx2tf/issues/545 onnx2tf_file = Path("calibration_image_sample_data_20x128x128x3_float32.npy") if not onnx2tf_file.exists(): attempt_download_asset(f"{onnx2tf_file}.zip", unzip=True, delete=True) # Export to ONNX self.args.simplify = True f_onnx, _ = self.export_onnx() # Export to TF tmp_file = f / "tmp_tflite_int8_calibration_images.npy" # int8 calibration images file if self.args.int8: verbosity = "--verbosity info" if self.args.data: # Generate calibration data for integer quantization LOGGER.info(f"{prefix} collecting INT8 calibration images from 'data={self.args.data}'") data = check_det_dataset(self.args.data) dataset = YOLODataset(data["val"], data=data, imgsz=self.imgsz[0], augment=False) images = [] for i, batch in enumerate(dataset): if i >= 100: # maximum number of calibration images break im = batch["img"].permute(1, 2, 0)[None] # list to nparray, CHW to BHWC images.append(im) f.mkdir() images = torch.cat(images, 0).float() # mean = images.view(-1, 3).mean(0) # imagenet mean [123.675, 116.28, 103.53] # std = images.view(-1, 3).std(0) # imagenet std [58.395, 57.12, 57.375] np.save(str(tmp_file), images.numpy()) # BHWC int8 = f'-oiqt -qt per-tensor -cind images "{tmp_file}" "[[[[0, 0, 0]]]]" "[[[[255, 255, 255]]]]"' else: int8 = "-oiqt -qt per-tensor" else: verbosity = "--non_verbose" int8 = "" cmd = f'onnx2tf -i "{f_onnx}" -o "{f}" -nuo {verbosity} {int8}'.strip() LOGGER.info(f"{prefix} running '{cmd}'") subprocess.run(cmd, shell=True) yaml_save(f / "metadata.yaml", self.metadata) # add metadata.yaml # Remove/rename TFLite models if self.args.int8: tmp_file.unlink(missing_ok=True) for file in f.rglob("*_dynamic_range_quant.tflite"): file.rename(file.with_name(file.stem.replace("_dynamic_range_quant", "_int8") + file.suffix)) for file in f.rglob("*_integer_quant_with_int16_act.tflite"): file.unlink() # delete extra fp16 activation TFLite files # Add TFLite metadata for file in f.rglob("*.tflite"): f.unlink() if "quant_with_int16_act.tflite" in str(f) else self._add_tflite_metadata(file) return str(f), tf.saved_model.load(f, tags=None, options=None) # load saved_model as Keras model @try_export def export_pb(self, keras_model, prefix=colorstr("TensorFlow GraphDef:")): """YOLOv8 TensorFlow GraphDef *.pb export https://github.com/leimao/Frozen_Graph_TensorFlow.""" import tensorflow as tf # noqa from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2 # noqa LOGGER.info(f"\n{prefix} starting export with tensorflow {tf.__version__}...") f = self.file.with_suffix(".pb") m = tf.function(lambda x: keras_model(x)) # full model m = m.get_concrete_function(tf.TensorSpec(keras_model.inputs[0].shape, keras_model.inputs[0].dtype)) frozen_func = convert_variables_to_constants_v2(m) frozen_func.graph.as_graph_def() tf.io.write_graph(graph_or_graph_def=frozen_func.graph, logdir=str(f.parent), name=f.name, as_text=False) return f, None @try_export def export_tflite(self, keras_model, nms, agnostic_nms, prefix=colorstr("TensorFlow Lite:")): """YOLOv8 TensorFlow Lite export.""" import tensorflow as tf # noqa LOGGER.info(f"\n{prefix} starting export with tensorflow {tf.__version__}...") saved_model = Path(str(self.file).replace(self.file.suffix, "_saved_model")) if self.args.int8: f = saved_model / f"{self.file.stem}_int8.tflite" # fp32 in/out elif self.args.half: f = saved_model / f"{self.file.stem}_float16.tflite" # fp32 in/out else: f = saved_model / f"{self.file.stem}_float32.tflite" return str(f), None @try_export def export_edgetpu(self, tflite_model="", prefix=colorstr("Edge TPU:")): """YOLOv8 Edge TPU export https://coral.ai/docs/edgetpu/models-intro/.""" LOGGER.warning(f"{prefix} WARNING ⚠️ Edge TPU known bug https://github.com/ultralytics/ultralytics/issues/1185") cmd = "edgetpu_compiler --version" help_url = "https://coral.ai/docs/edgetpu/compiler/" assert LINUX, f"export only supported on Linux. See {help_url}" if subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, shell=True).returncode != 0: LOGGER.info(f"\n{prefix} export requires Edge TPU compiler. Attempting install from {help_url}") sudo = subprocess.run("sudo --version >/dev/null", shell=True).returncode == 0 # sudo installed on system for c in ( "curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -", 'echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | ' "sudo tee /etc/apt/sources.list.d/coral-edgetpu.list", "sudo apt-get update", "sudo apt-get install edgetpu-compiler", ): subprocess.run(c if sudo else c.replace("sudo ", ""), shell=True, check=True) ver = subprocess.run(cmd, shell=True, capture_output=True, check=True).stdout.decode().split()[-1] LOGGER.info(f"\n{prefix} starting export with Edge TPU compiler {ver}...") f = str(tflite_model).replace(".tflite", "_edgetpu.tflite") # Edge TPU model cmd = f'edgetpu_compiler -s -d -k 10 --out_dir "{Path(f).parent}" "{tflite_model}"' LOGGER.info(f"{prefix} running '{cmd}'") subprocess.run(cmd, shell=True) self._add_tflite_metadata(f) return f, None @try_export def export_tfjs(self, prefix=colorstr("TensorFlow.js:")): """YOLOv8 TensorFlow.js export.""" # JAX bug requiring install constraints in https://github.com/google/jax/issues/18978 check_requirements(["jax<=0.4.21", "jaxlib<=0.4.21", "tensorflowjs"]) import tensorflow as tf import tensorflowjs as tfjs # noqa LOGGER.info(f"\n{prefix} starting export with tensorflowjs {tfjs.__version__}...") f = str(self.file).replace(self.file.suffix, "_web_model") # js dir f_pb = str(self.file.with_suffix(".pb")) # *.pb path gd = tf.Graph().as_graph_def() # TF GraphDef with open(f_pb, "rb") as file: gd.ParseFromString(file.read()) outputs = ",".join(gd_outputs(gd)) LOGGER.info(f"\n{prefix} output node names: {outputs}") quantization = "--quantize_float16" if self.args.half else "--quantize_uint8" if self.args.int8 else "" with spaces_in_path(f_pb) as fpb_, spaces_in_path(f) as f_: # exporter can not handle spaces in path cmd = f'tensorflowjs_converter --input_format=tf_frozen_model {quantization} --output_node_names={outputs} "{fpb_}" "{f_}"' LOGGER.info(f"{prefix} running '{cmd}'") subprocess.run(cmd, shell=True) if " " in f: LOGGER.warning(f"{prefix} WARNING ⚠️ your model may not work correctly with spaces in path '{f}'.") # f_json = Path(f) / 'model.json' # *.json path # with open(f_json, 'w') as j: # sort JSON Identity_* in ascending order # subst = re.sub( # r'{"outputs": {"Identity.?.?": {"name": "Identity.?.?"}, ' # r'"Identity.?.?": {"name": "Identity.?.?"}, ' # r'"Identity.?.?": {"name": "Identity.?.?"}, ' # r'"Identity.?.?": {"name": "Identity.?.?"}}}', # r'{"outputs": {"Identity": {"name": "Identity"}, ' # r'"Identity_1": {"name": "Identity_1"}, ' # r'"Identity_2": {"name": "Identity_2"}, ' # r'"Identity_3": {"name": "Identity_3"}}}', # f_json.read_text(), # ) # j.write(subst) yaml_save(Path(f) / "metadata.yaml", self.metadata) # add metadata.yaml return f, None def _add_tflite_metadata(self, file): """Add metadata to *.tflite models per https://www.tensorflow.org/lite/models/convert/metadata.""" from tflite_support import flatbuffers # noqa from tflite_support import metadata as _metadata # noqa from tflite_support import metadata_schema_py_generated as _metadata_fb # noqa # Create model info model_meta = _metadata_fb.ModelMetadataT() model_meta.name = self.metadata["description"] model_meta.version = self.metadata["version"] model_meta.author = self.metadata["author"] model_meta.license = self.metadata["license"] # Label file tmp_file = Path(file).parent / "temp_meta.txt" with open(tmp_file, "w") as f: f.write(str(self.metadata)) label_file = _metadata_fb.AssociatedFileT() label_file.name = tmp_file.name label_file.type = _metadata_fb.AssociatedFileType.TENSOR_AXIS_LABELS # Create input info input_meta = _metadata_fb.TensorMetadataT() input_meta.name = "image" input_meta.description = "Input image to be detected." input_meta.content = _metadata_fb.ContentT() input_meta.content.contentProperties = _metadata_fb.ImagePropertiesT() input_meta.content.contentProperties.colorSpace = _metadata_fb.ColorSpaceType.RGB input_meta.content.contentPropertiesType = _metadata_fb.ContentProperties.ImageProperties # Create output info output1 = _metadata_fb.TensorMetadataT() output1.name = "output" output1.description = "Coordinates of detected objects, class labels, and confidence score" output1.associatedFiles = [label_file] if self.model.task == "segment": output2 = _metadata_fb.TensorMetadataT() output2.name = "output" output2.description = "Mask protos" output2.associatedFiles = [label_file] # Create subgraph info subgraph = _metadata_fb.SubGraphMetadataT() subgraph.inputTensorMetadata = [input_meta] subgraph.outputTensorMetadata = [output1, output2] if self.model.task == "segment" else [output1] model_meta.subgraphMetadata = [subgraph] b = flatbuffers.Builder(0) b.Finish(model_meta.Pack(b), _metadata.MetadataPopulator.METADATA_FILE_IDENTIFIER) metadata_buf = b.Output() populator = _metadata.MetadataPopulator.with_model_file(str(file)) populator.load_metadata_buffer(metadata_buf) populator.load_associated_files([str(tmp_file)]) populator.populate() tmp_file.unlink() def _pipeline_coreml(self, model, weights_dir=None, prefix=colorstr("CoreML Pipeline:")): """YOLOv8 CoreML pipeline.""" import coremltools as ct # noqa LOGGER.info(f"{prefix} starting pipeline with coremltools {ct.__version__}...") _, _, h, w = list(self.im.shape) # BCHW # Output shapes spec = model.get_spec() out0, out1 = iter(spec.description.output) if MACOS: from PIL import Image img = Image.new("RGB", (w, h)) # w=192, h=320 out = model.predict({"image": img}) out0_shape = out[out0.name].shape # (3780, 80) out1_shape = out[out1.name].shape # (3780, 4) else: # linux and windows can not run model.predict(), get sizes from PyTorch model output y out0_shape = self.output_shape[2], self.output_shape[1] - 4 # (3780, 80) out1_shape = self.output_shape[2], 4 # (3780, 4) # Checks names = self.metadata["names"] nx, ny = spec.description.input[0].type.imageType.width, spec.description.input[0].type.imageType.height _, nc = out0_shape # number of anchors, number of classes # _, nc = out0.type.multiArrayType.shape assert len(names) == nc, f"{len(names)} names found for nc={nc}" # check # Define output shapes (missing) out0.type.multiArrayType.shape[:] = out0_shape # (3780, 80) out1.type.multiArrayType.shape[:] = out1_shape # (3780, 4) # spec.neuralNetwork.preprocessing[0].featureName = '0' # Flexible input shapes # from coremltools.models.neural_network import flexible_shape_utils # s = [] # shapes # s.append(flexible_shape_utils.NeuralNetworkImageSize(320, 192)) # s.append(flexible_shape_utils.NeuralNetworkImageSize(640, 384)) # (height, width) # flexible_shape_utils.add_enumerated_image_sizes(spec, feature_name='image', sizes=s) # r = flexible_shape_utils.NeuralNetworkImageSizeRange() # shape ranges # r.add_height_range((192, 640)) # r.add_width_range((192, 640)) # flexible_shape_utils.update_image_size_range(spec, feature_name='image', size_range=r) # Print # print(spec.description) # Model from spec model = ct.models.MLModel(spec, weights_dir=weights_dir) # 3. Create NMS protobuf nms_spec = ct.proto.Model_pb2.Model() nms_spec.specificationVersion = 5 for i in range(2): decoder_output = model._spec.description.output[i].SerializeToString() nms_spec.description.input.add() nms_spec.description.input[i].ParseFromString(decoder_output) nms_spec.description.output.add() nms_spec.description.output[i].ParseFromString(decoder_output) nms_spec.description.output[0].name = "confidence" nms_spec.description.output[1].name = "coordinates" output_sizes = [nc, 4] for i in range(2): ma_type = nms_spec.description.output[i].type.multiArrayType ma_type.shapeRange.sizeRanges.add() ma_type.shapeRange.sizeRanges[0].lowerBound = 0 ma_type.shapeRange.sizeRanges[0].upperBound = -1 ma_type.shapeRange.sizeRanges.add() ma_type.shapeRange.sizeRanges[1].lowerBound = output_sizes[i] ma_type.shapeRange.sizeRanges[1].upperBound = output_sizes[i] del ma_type.shape[:] nms = nms_spec.nonMaximumSuppression nms.confidenceInputFeatureName = out0.name # 1x507x80 nms.coordinatesInputFeatureName = out1.name # 1x507x4 nms.confidenceOutputFeatureName = "confidence" nms.coordinatesOutputFeatureName = "coordinates" nms.iouThresholdInputFeatureName = "iouThreshold" nms.confidenceThresholdInputFeatureName = "confidenceThreshold" nms.iouThreshold = 0.45 nms.confidenceThreshold = 0.25 nms.pickTop.perClass = True nms.stringClassLabels.vector.extend(names.values()) nms_model = ct.models.MLModel(nms_spec) # 4. Pipeline models together pipeline = ct.models.pipeline.Pipeline( input_features=[ ("image", ct.models.datatypes.Array(3, ny, nx)), ("iouThreshold", ct.models.datatypes.Double()), ("confidenceThreshold", ct.models.datatypes.Double()), ], output_features=["confidence", "coordinates"], ) pipeline.add_model(model) pipeline.add_model(nms_model) # Correct datatypes pipeline.spec.description.input[0].ParseFromString(model._spec.description.input[0].SerializeToString()) pipeline.spec.description.output[0].ParseFromString(nms_model._spec.description.output[0].SerializeToString()) pipeline.spec.description.output[1].ParseFromString(nms_model._spec.description.output[1].SerializeToString()) # Update metadata pipeline.spec.specificationVersion = 5 pipeline.spec.description.metadata.userDefined.update( {"IoU threshold": str(nms.iouThreshold), "Confidence threshold": str(nms.confidenceThreshold)} ) # Save the model model = ct.models.MLModel(pipeline.spec, weights_dir=weights_dir) model.input_description["image"] = "Input image" model.input_description["iouThreshold"] = f"(optional) IOU threshold override (default: {nms.iouThreshold})" model.input_description[ "confidenceThreshold" ] = f"(optional) Confidence threshold override (default: {nms.confidenceThreshold})" model.output_description["confidence"] = 'Boxes × Class confidence (see user-defined metadata "classes")' model.output_description["coordinates"] = "Boxes × [x, y, width, height] (relative to image size)" LOGGER.info(f"{prefix} pipeline success") return model def add_callback(self, event: str, callback): """Appends the given callback.""" self.callbacks[event].append(callback) def run_callbacks(self, event: str): """Execute all callbacks for a given event.""" for callback in self.callbacks.get(event, []): callback(self) class IOSDetectModel(torch.nn.Module): """Wrap an Ultralytics YOLO model for Apple iOS CoreML export.""" def __init__(self, model, im): """Initialize the IOSDetectModel class with a YOLO model and example image.""" super().__init__() _, _, h, w = im.shape # batch, channel, height, width self.model = model self.nc = len(model.names) # number of classes if w == h: self.normalize = 1.0 / w # scalar else: self.normalize = torch.tensor([1.0 / w, 1.0 / h, 1.0 / w, 1.0 / h]) # broadcast (slower, smaller) def forward(self, x): """Normalize predictions of object detection model with input size-dependent factors.""" xywh, cls = self.model(x)[0].transpose(0, 1).split((4, self.nc), 1) return cls, xywh * self.normalize # confidence (3780, 80), coordinates (3780, 4)
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/engine/exporter.py
Python
unknown
52,576
# Ultralytics YOLO 🚀, AGPL-3.0 license import inspect import sys from pathlib import Path from typing import Union from ultralytics.cfg import TASK2DATA, get_cfg, get_save_dir from ultralytics.hub.utils import HUB_WEB_ROOT from ultralytics.nn.tasks import attempt_load_one_weight, guess_model_task, nn, yaml_model_load from ultralytics.utils import ASSETS, DEFAULT_CFG_DICT, LOGGER, RANK, SETTINGS, callbacks, checks, emojis, yaml_load class Model(nn.Module): """ A base class for implementing YOLO models, unifying APIs across different model types. This class provides a common interface for various operations related to YOLO models, such as training, validation, prediction, exporting, and benchmarking. It handles different types of models, including those loaded from local files, Ultralytics HUB, or Triton Server. The class is designed to be flexible and extendable for different tasks and model configurations. Args: model (Union[str, Path], optional): Path or name of the model to load or create. This can be a local file path, a model name from Ultralytics HUB, or a Triton Server model. Defaults to 'yolov8n.pt'. task (Any, optional): The task type associated with the YOLO model. This can be used to specify the model's application domain, such as object detection, segmentation, etc. Defaults to None. verbose (bool, optional): If True, enables verbose output during the model's operations. Defaults to False. Attributes: callbacks (dict): A dictionary of callback functions for various events during model operations. predictor (BasePredictor): The predictor object used for making predictions. model (nn.Module): The underlying PyTorch model. trainer (BaseTrainer): The trainer object used for training the model. ckpt (dict): The checkpoint data if the model is loaded from a *.pt file. cfg (str): The configuration of the model if loaded from a *.yaml file. ckpt_path (str): The path to the checkpoint file. overrides (dict): A dictionary of overrides for model configuration. metrics (dict): The latest training/validation metrics. session (HUBTrainingSession): The Ultralytics HUB session, if applicable. task (str): The type of task the model is intended for. model_name (str): The name of the model. Methods: __call__: Alias for the predict method, enabling the model instance to be callable. _new: Initializes a new model based on a configuration file. _load: Loads a model from a checkpoint file. _check_is_pytorch_model: Ensures that the model is a PyTorch model. reset_weights: Resets the model's weights to their initial state. load: Loads model weights from a specified file. save: Saves the current state of the model to a file. info: Logs or returns information about the model. fuse: Fuses Conv2d and BatchNorm2d layers for optimized inference. predict: Performs object detection predictions. track: Performs object tracking. val: Validates the model on a dataset. benchmark: Benchmarks the model on various export formats. export: Exports the model to different formats. train: Trains the model on a dataset. tune: Performs hyperparameter tuning. _apply: Applies a function to the model's tensors. add_callback: Adds a callback function for an event. clear_callback: Clears all callbacks for an event. reset_callbacks: Resets all callbacks to their default functions. _get_hub_session: Retrieves or creates an Ultralytics HUB session. is_triton_model: Checks if a model is a Triton Server model. is_hub_model: Checks if a model is an Ultralytics HUB model. _reset_ckpt_args: Resets checkpoint arguments when loading a PyTorch model. _smart_load: Loads the appropriate module based on the model task. task_map: Provides a mapping from model tasks to corresponding classes. Raises: FileNotFoundError: If the specified model file does not exist or is inaccessible. ValueError: If the model file or configuration is invalid or unsupported. ImportError: If required dependencies for specific model types (like HUB SDK) are not installed. TypeError: If the model is not a PyTorch model when required. AttributeError: If required attributes or methods are not implemented or available. NotImplementedError: If a specific model task or mode is not supported. """ def __init__(self, model: Union[str, Path] = "yolov8n.pt", task=None, verbose=False) -> None: """ Initializes a new instance of the YOLO model class. This constructor sets up the model based on the provided model path or name. It handles various types of model sources, including local files, Ultralytics HUB models, and Triton Server models. The method initializes several important attributes of the model and prepares it for operations like training, prediction, or export. Args: model (Union[str, Path], optional): The path or model file to load or create. This can be a local file path, a model name from Ultralytics HUB, or a Triton Server model. Defaults to 'yolov8n.pt'. task (Any, optional): The task type associated with the YOLO model, specifying its application domain. Defaults to None. verbose (bool, optional): If True, enables verbose output during the model's initialization and subsequent operations. Defaults to False. Raises: FileNotFoundError: If the specified model file does not exist or is inaccessible. ValueError: If the model file or configuration is invalid or unsupported. ImportError: If required dependencies for specific model types (like HUB SDK) are not installed. """ super().__init__() self.callbacks = callbacks.get_default_callbacks() self.predictor = None # reuse predictor self.model = None # model object self.trainer = None # trainer object self.ckpt = None # if loaded from *.pt self.cfg = None # if loaded from *.yaml self.ckpt_path = None self.overrides = {} # overrides for trainer object self.metrics = None # validation/training metrics self.session = None # HUB session self.task = task # task type self.model_name = model = str(model).strip() # strip spaces # Check if Ultralytics HUB model from https://hub.ultralytics.com if self.is_hub_model(model): # Fetch model from HUB checks.check_requirements("hub-sdk>0.0.2") self.session = self._get_hub_session(model) model = self.session.model_file # Check if Triton Server model elif self.is_triton_model(model): self.model = model self.task = task return # Load or create new YOLO model model = checks.check_model_file_from_stem(model) # add suffix, i.e. yolov8n -> yolov8n.pt if Path(model).suffix in (".yaml", ".yml"): self._new(model, task=task, verbose=verbose) else: self._load(model, task=task) self.model_name = model def __call__(self, source=None, stream=False, **kwargs): """ An alias for the predict method, enabling the model instance to be callable. This method simplifies the process of making predictions by allowing the model instance to be called directly with the required arguments for prediction. Args: source (str | int | PIL.Image | np.ndarray, optional): The source of the image for making predictions. Accepts various types, including file paths, URLs, PIL images, and numpy arrays. Defaults to None. stream (bool, optional): If True, treats the input source as a continuous stream for predictions. Defaults to False. **kwargs (dict): Additional keyword arguments for configuring the prediction process. Returns: (List[ultralytics.engine.results.Results]): A list of prediction results, encapsulated in the Results class. """ return self.predict(source, stream, **kwargs) @staticmethod def _get_hub_session(model: str): """Creates a session for Hub Training.""" from ultralytics.hub.session import HUBTrainingSession session = HUBTrainingSession(model) return session if session.client.authenticated else None @staticmethod def is_triton_model(model): """Is model a Triton Server URL string, i.e. <scheme>://<netloc>/<endpoint>/<task_name>""" from urllib.parse import urlsplit url = urlsplit(model) return url.netloc and url.path and url.scheme in {"http", "grpc"} @staticmethod def is_hub_model(model): """Check if the provided model is a HUB model.""" return any( ( model.startswith(f"{HUB_WEB_ROOT}/models/"), # i.e. https://hub.ultralytics.com/models/MODEL_ID [len(x) for x in model.split("_")] == [42, 20], # APIKEY_MODELID len(model) == 20 and not Path(model).exists() and all(x not in model for x in "./\\"), # MODELID ) ) def _new(self, cfg: str, task=None, model=None, verbose=False): """ Initializes a new model and infers the task type from the model definitions. Args: cfg (str): model configuration file task (str | None): model task model (BaseModel): Customized model. verbose (bool): display model info on load """ cfg_dict = yaml_model_load(cfg) self.cfg = cfg self.task = task or guess_model_task(cfg_dict) self.model = (model or self._smart_load("model"))(cfg_dict, verbose=verbose and RANK == -1) # build model self.overrides["model"] = self.cfg self.overrides["task"] = self.task # Below added to allow export from YAMLs self.model.args = {**DEFAULT_CFG_DICT, **self.overrides} # combine default and model args (prefer model args) self.model.task = self.task def _load(self, weights: str, task=None): """ Initializes a new model and infers the task type from the model head. Args: weights (str): model checkpoint to be loaded task (str | None): model task """ suffix = Path(weights).suffix if suffix == ".pt": self.model, self.ckpt = attempt_load_one_weight(weights) self.task = self.model.args["task"] self.overrides = self.model.args = self._reset_ckpt_args(self.model.args) self.ckpt_path = self.model.pt_path else: weights = checks.check_file(weights) self.model, self.ckpt = weights, None self.task = task or guess_model_task(weights) self.ckpt_path = weights self.overrides["model"] = weights self.overrides["task"] = self.task def _check_is_pytorch_model(self): """Raises TypeError is model is not a PyTorch model.""" pt_str = isinstance(self.model, (str, Path)) and Path(self.model).suffix == ".pt" pt_module = isinstance(self.model, nn.Module) if not (pt_module or pt_str): raise TypeError( f"model='{self.model}' should be a *.pt PyTorch model to run this method, but is a different format. " f"PyTorch models can train, val, predict and export, i.e. 'model.train(data=...)', but exported " f"formats like ONNX, TensorRT etc. only support 'predict' and 'val' modes, " f"i.e. 'yolo predict model=yolov8n.onnx'.\nTo run CUDA or MPS inference please pass the device " f"argument directly in your inference command, i.e. 'model.predict(source=..., device=0)'" ) def reset_weights(self): """ Resets the model parameters to randomly initialized values, effectively discarding all training information. This method iterates through all modules in the model and resets their parameters if they have a 'reset_parameters' method. It also ensures that all parameters have 'requires_grad' set to True, enabling them to be updated during training. Returns: self (ultralytics.engine.model.Model): The instance of the class with reset weights. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() for m in self.model.modules(): if hasattr(m, "reset_parameters"): m.reset_parameters() for p in self.model.parameters(): p.requires_grad = True return self def load(self, weights="yolov8n.pt"): """ Loads parameters from the specified weights file into the model. This method supports loading weights from a file or directly from a weights object. It matches parameters by name and shape and transfers them to the model. Args: weights (str | Path): Path to the weights file or a weights object. Defaults to 'yolov8n.pt'. Returns: self (ultralytics.engine.model.Model): The instance of the class with loaded weights. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() if isinstance(weights, (str, Path)): weights, self.ckpt = attempt_load_one_weight(weights) self.model.load(weights) return self def save(self, filename="model.pt"): """ Saves the current model state to a file. This method exports the model's checkpoint (ckpt) to the specified filename. Args: filename (str): The name of the file to save the model to. Defaults to 'model.pt'. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() import torch torch.save(self.ckpt, filename) def info(self, detailed=False, verbose=True): """ Logs or returns model information. This method provides an overview or detailed information about the model, depending on the arguments passed. It can control the verbosity of the output. Args: detailed (bool): If True, shows detailed information about the model. Defaults to False. verbose (bool): If True, prints the information. If False, returns the information. Defaults to True. Returns: (list): Various types of information about the model, depending on the 'detailed' and 'verbose' parameters. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() return self.model.info(detailed=detailed, verbose=verbose) def fuse(self): """ Fuses Conv2d and BatchNorm2d layers in the model. This method optimizes the model by fusing Conv2d and BatchNorm2d layers, which can improve inference speed. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() self.model.fuse() def embed(self, source=None, stream=False, **kwargs): """ Generates image embeddings based on the provided source. This method is a wrapper around the 'predict()' method, focusing on generating embeddings from an image source. It allows customization of the embedding process through various keyword arguments. Args: source (str | int | PIL.Image | np.ndarray): The source of the image for generating embeddings. The source can be a file path, URL, PIL image, numpy array, etc. Defaults to None. stream (bool): If True, predictions are streamed. Defaults to False. **kwargs (dict): Additional keyword arguments for configuring the embedding process. Returns: (List[torch.Tensor]): A list containing the image embeddings. Raises: AssertionError: If the model is not a PyTorch model. """ if not kwargs.get("embed"): kwargs["embed"] = [len(self.model.model) - 2] # embed second-to-last layer if no indices passed return self.predict(source, stream, **kwargs) def predict(self, source=None, stream=False, predictor=None, **kwargs): """ Performs predictions on the given image source using the YOLO model. This method facilitates the prediction process, allowing various configurations through keyword arguments. It supports predictions with custom predictors or the default predictor method. The method handles different types of image sources and can operate in a streaming mode. It also provides support for SAM-type models through 'prompts'. The method sets up a new predictor if not already present and updates its arguments with each call. It also issues a warning and uses default assets if the 'source' is not provided. The method determines if it is being called from the command line interface and adjusts its behavior accordingly, including setting defaults for confidence threshold and saving behavior. Args: source (str | int | PIL.Image | np.ndarray, optional): The source of the image for making predictions. Accepts various types, including file paths, URLs, PIL images, and numpy arrays. Defaults to ASSETS. stream (bool, optional): Treats the input source as a continuous stream for predictions. Defaults to False. predictor (BasePredictor, optional): An instance of a custom predictor class for making predictions. If None, the method uses a default predictor. Defaults to None. **kwargs (dict): Additional keyword arguments for configuring the prediction process. These arguments allow for further customization of the prediction behavior. Returns: (List[ultralytics.engine.results.Results]): A list of prediction results, encapsulated in the Results class. Raises: AttributeError: If the predictor is not properly set up. """ if source is None: source = ASSETS LOGGER.warning(f"WARNING ⚠️ 'source' is missing. Using 'source={source}'.") is_cli = (sys.argv[0].endswith("yolo") or sys.argv[0].endswith("ultralytics")) and any( x in sys.argv for x in ("predict", "track", "mode=predict", "mode=track") ) custom = {"conf": 0.25, "save": is_cli, "mode": "predict"} # method defaults args = {**self.overrides, **custom, **kwargs} # highest priority args on the right prompts = args.pop("prompts", None) # for SAM-type models if not self.predictor: self.predictor = predictor or self._smart_load("predictor")(overrides=args, _callbacks=self.callbacks) self.predictor.setup_model(model=self.model, verbose=is_cli) else: # only update args if predictor is already setup self.predictor.args = get_cfg(self.predictor.args, args) if "project" in args or "name" in args: self.predictor.save_dir = get_save_dir(self.predictor.args) if prompts and hasattr(self.predictor, "set_prompts"): # for SAM-type models self.predictor.set_prompts(prompts) return self.predictor.predict_cli(source=source) if is_cli else self.predictor(source=source, stream=stream) def track(self, source=None, stream=False, persist=False, **kwargs): """ Conducts object tracking on the specified input source using the registered trackers. This method performs object tracking using the model's predictors and optionally registered trackers. It is capable of handling different types of input sources such as file paths or video streams. The method supports customization of the tracking process through various keyword arguments. It registers trackers if they are not already present and optionally persists them based on the 'persist' flag. The method sets a default confidence threshold specifically for ByteTrack-based tracking, which requires low confidence predictions as input. The tracking mode is explicitly set in the keyword arguments. Args: source (str, optional): The input source for object tracking. It can be a file path, URL, or video stream. stream (bool, optional): Treats the input source as a continuous video stream. Defaults to False. persist (bool, optional): Persists the trackers between different calls to this method. Defaults to False. **kwargs (dict): Additional keyword arguments for configuring the tracking process. These arguments allow for further customization of the tracking behavior. Returns: (List[ultralytics.engine.results.Results]): A list of tracking results, encapsulated in the Results class. Raises: AttributeError: If the predictor does not have registered trackers. """ if not hasattr(self.predictor, "trackers"): from ultralytics.trackers import register_tracker register_tracker(self, persist) kwargs["conf"] = kwargs.get("conf") or 0.1 # ByteTrack-based method needs low confidence predictions as input kwargs["mode"] = "track" return self.predict(source=source, stream=stream, **kwargs) def val(self, validator=None, **kwargs): """ Validates the model using a specified dataset and validation configuration. This method facilitates the model validation process, allowing for a range of customization through various settings and configurations. It supports validation with a custom validator or the default validation approach. The method combines default configurations, method-specific defaults, and user-provided arguments to configure the validation process. After validation, it updates the model's metrics with the results obtained from the validator. The method supports various arguments that allow customization of the validation process. For a comprehensive list of all configurable options, users should refer to the 'configuration' section in the documentation. Args: validator (BaseValidator, optional): An instance of a custom validator class for validating the model. If None, the method uses a default validator. Defaults to None. **kwargs (dict): Arbitrary keyword arguments representing the validation configuration. These arguments are used to customize various aspects of the validation process. Returns: (dict): Validation metrics obtained from the validation process. Raises: AssertionError: If the model is not a PyTorch model. """ custom = {"rect": True} # method defaults args = {**self.overrides, **custom, **kwargs, "mode": "val"} # highest priority args on the right validator = (validator or self._smart_load("validator"))(args=args, _callbacks=self.callbacks) validator(model=self.model) self.metrics = validator.metrics return validator.metrics def benchmark(self, **kwargs): """ Benchmarks the model across various export formats to evaluate performance. This method assesses the model's performance in different export formats, such as ONNX, TorchScript, etc. It uses the 'benchmark' function from the ultralytics.utils.benchmarks module. The benchmarking is configured using a combination of default configuration values, model-specific arguments, method-specific defaults, and any additional user-provided keyword arguments. The method supports various arguments that allow customization of the benchmarking process, such as dataset choice, image size, precision modes, device selection, and verbosity. For a comprehensive list of all configurable options, users should refer to the 'configuration' section in the documentation. Args: **kwargs (dict): Arbitrary keyword arguments to customize the benchmarking process. These are combined with default configurations, model-specific arguments, and method defaults. Returns: (dict): A dictionary containing the results of the benchmarking process. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() from ultralytics.utils.benchmarks import benchmark custom = {"verbose": False} # method defaults args = {**DEFAULT_CFG_DICT, **self.model.args, **custom, **kwargs, "mode": "benchmark"} return benchmark( model=self, data=kwargs.get("data"), # if no 'data' argument passed set data=None for default datasets imgsz=args["imgsz"], half=args["half"], int8=args["int8"], device=args["device"], verbose=kwargs.get("verbose"), ) def export(self, **kwargs): """ Exports the model to a different format suitable for deployment. This method facilitates the export of the model to various formats (e.g., ONNX, TorchScript) for deployment purposes. It uses the 'Exporter' class for the export process, combining model-specific overrides, method defaults, and any additional arguments provided. The combined arguments are used to configure export settings. The method supports a wide range of arguments to customize the export process. For a comprehensive list of all possible arguments, refer to the 'configuration' section in the documentation. Args: **kwargs (dict): Arbitrary keyword arguments to customize the export process. These are combined with the model's overrides and method defaults. Returns: (object): The exported model in the specified format, or an object related to the export process. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() from .exporter import Exporter custom = {"imgsz": self.model.args["imgsz"], "batch": 1, "data": None, "verbose": False} # method defaults args = {**self.overrides, **custom, **kwargs, "mode": "export"} # highest priority args on the right return Exporter(overrides=args, _callbacks=self.callbacks)(model=self.model) def train(self,singal=None,singal_2=None,singal_3=None, singal_4=None, trainer=None, **kwargs): """ Trains the model using the specified dataset and training configuration. This method facilitates model training with a range of customizable settings and configurations. It supports training with a custom trainer or the default training approach defined in the method. The method handles different scenarios, such as resuming training from a checkpoint, integrating with Ultralytics HUB, and updating model and configuration after training. When using Ultralytics HUB, if the session already has a loaded model, the method prioritizes HUB training arguments and issues a warning if local arguments are provided. It checks for pip updates and combines default configurations, method-specific defaults, and user-provided arguments to configure the training process. After training, it updates the model and its configurations, and optionally attaches metrics. Args: trainer (BaseTrainer, optional): An instance of a custom trainer class for training the model. If None, the method uses a default trainer. Defaults to None. **kwargs (dict): Arbitrary keyword arguments representing the training configuration. These arguments are used to customize various aspects of the training process. Returns: (dict | None): Training metrics if available and training is successful; otherwise, None. Raises: AssertionError: If the model is not a PyTorch model. PermissionError: If there is a permission issue with the HUB session. ModuleNotFoundError: If the HUB SDK is not installed. """ self._check_is_pytorch_model() if hasattr(self.session, "model") and self.session.model.id: # Ultralytics HUB session with loaded model if any(kwargs): LOGGER.warning("WARNING ⚠️ using HUB training arguments, ignoring local training arguments.") kwargs = self.session.train_args # overwrite kwargs checks.check_pip_update_available() overrides = yaml_load(checks.check_yaml(kwargs["cfg"])) if kwargs.get("cfg") else self.overrides custom = {"data": DEFAULT_CFG_DICT["data"] or TASK2DATA[self.task]} # method defaults args = {**overrides, **custom, **kwargs, "mode": "train"} # highest priority args on the right if args.get("resume"): args["resume"] = self.ckpt_path self.trainer = (trainer or self._smart_load("trainer"))(overrides=args, _callbacks=self.callbacks) if not args.get("resume"): # manually set model only if not resuming self.trainer.model = self.trainer.get_model(weights=self.model if self.ckpt else None, cfg=self.model.yaml) self.model = self.trainer.model if SETTINGS["hub"] is True and not self.session: # Create a model in HUB try: self.session = self._get_hub_session(self.model_name) if self.session: self.session.create_model(args) # Check model was created if not getattr(self.session.model, "id", None): self.session = None except (PermissionError, ModuleNotFoundError): # Ignore PermissionError and ModuleNotFoundError which indicates hub-sdk not installed pass self.trainer.hub_session = self.session # attach optional HUB session self.trainer.train(singal=singal,singal_2=singal_2,singal_3=singal_3,singal_4=singal_4) # Update model and cfg after training if RANK in (-1, 0): ckpt = self.trainer.best if self.trainer.best.exists() else self.trainer.last self.model, _ = attempt_load_one_weight(ckpt) self.overrides = self.model.args self.metrics = getattr(self.trainer.validator, "metrics", None) # TODO: no metrics returned by DDP return self.metrics def tune(self, use_ray=False, iterations=10, *args, **kwargs): """ Conducts hyperparameter tuning for the model, with an option to use Ray Tune. This method supports two modes of hyperparameter tuning: using Ray Tune or a custom tuning method. When Ray Tune is enabled, it leverages the 'run_ray_tune' function from the ultralytics.utils.tuner module. Otherwise, it uses the internal 'Tuner' class for tuning. The method combines default, overridden, and custom arguments to configure the tuning process. Args: use_ray (bool): If True, uses Ray Tune for hyperparameter tuning. Defaults to False. iterations (int): The number of tuning iterations to perform. Defaults to 10. *args (list): Variable length argument list for additional arguments. **kwargs (dict): Arbitrary keyword arguments. These are combined with the model's overrides and defaults. Returns: (dict): A dictionary containing the results of the hyperparameter search. Raises: AssertionError: If the model is not a PyTorch model. """ self._check_is_pytorch_model() if use_ray: from ultralytics.utils.tuner import run_ray_tune return run_ray_tune(self, max_samples=iterations, *args, **kwargs) else: from .tuner import Tuner custom = {} # method defaults args = {**self.overrides, **custom, **kwargs, "mode": "train"} # highest priority args on the right return Tuner(args=args, _callbacks=self.callbacks)(model=self, iterations=iterations) def _apply(self, fn): """Apply to(), cpu(), cuda(), half(), float() to model tensors that are not parameters or registered buffers.""" self._check_is_pytorch_model() self = super()._apply(fn) # noqa self.predictor = None # reset predictor as device may have changed self.overrides["device"] = self.device # was str(self.device) i.e. device(type='cuda', index=0) -> 'cuda:0' return self @property def names(self): """ Retrieves the class names associated with the loaded model. This property returns the class names if they are defined in the model. It checks the class names for validity using the 'check_class_names' function from the ultralytics.nn.autobackend module. Returns: (list | None): The class names of the model if available, otherwise None. """ from ultralytics.nn.autobackend import check_class_names return check_class_names(self.model.names) if hasattr(self.model, "names") else None @property def device(self): """ Retrieves the device on which the model's parameters are allocated. This property is used to determine whether the model's parameters are on CPU or GPU. It only applies to models that are instances of nn.Module. Returns: (torch.device | None): The device (CPU/GPU) of the model if it is a PyTorch model, otherwise None. """ return next(self.model.parameters()).device if isinstance(self.model, nn.Module) else None @property def transforms(self): """ Retrieves the transformations applied to the input data of the loaded model. This property returns the transformations if they are defined in the model. Returns: (object | None): The transform object of the model if available, otherwise None. """ return self.model.transforms if hasattr(self.model, "transforms") else None def add_callback(self, event: str, func): """ Adds a callback function for a specified event. This method allows the user to register a custom callback function that is triggered on a specific event during model training or inference. Args: event (str): The name of the event to attach the callback to. func (callable): The callback function to be registered. Raises: ValueError: If the event name is not recognized. """ self.callbacks[event].append(func) def clear_callback(self, event: str): """ Clears all callback functions registered for a specified event. This method removes all custom and default callback functions associated with the given event. Args: event (str): The name of the event for which to clear the callbacks. Raises: ValueError: If the event name is not recognized. """ self.callbacks[event] = [] def reset_callbacks(self): """ Resets all callbacks to their default functions. This method reinstates the default callback functions for all events, removing any custom callbacks that were added previously. """ for event in callbacks.default_callbacks.keys(): self.callbacks[event] = [callbacks.default_callbacks[event][0]] @staticmethod def _reset_ckpt_args(args): """Reset arguments when loading a PyTorch model.""" include = {"imgsz", "data", "task", "single_cls"} # only remember these arguments when loading a PyTorch model return {k: v for k, v in args.items() if k in include} # def __getattr__(self, attr): # """Raises error if object has no requested attribute.""" # name = self.__class__.__name__ # raise AttributeError(f"'{name}' object has no attribute '{attr}'. See valid attributes below.\n{self.__doc__}") def _smart_load(self, key): """Load model/trainer/validator/predictor.""" try: return self.task_map[self.task][key] except Exception as e: name = self.__class__.__name__ mode = inspect.stack()[1][3] # get the function name. raise NotImplementedError( emojis(f"WARNING ⚠️ '{name}' model does not support '{mode}' mode for '{self.task}' task yet.") ) from e @property def task_map(self): """ Map head to model, trainer, validator, and predictor classes. Returns: task_map (dict): The map of model task to mode classes. """ raise NotImplementedError("Please provide task map for your model!")
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/engine/model.py
Python
unknown
37,758
# Ultralytics YOLO 🚀, AGPL-3.0 license """ Run prediction on images, videos, directories, globs, YouTube, webcam, streams, etc. Usage - sources: $ yolo mode=predict model=yolov8n.pt source=0 # webcam img.jpg # image vid.mp4 # video screen # screenshot path/ # directory list.txt # list of images list.streams # list of streams 'path/*.jpg' # glob 'https://youtu.be/LNwODJXcvt4' # YouTube 'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP, TCP stream Usage - formats: $ yolo mode=predict model=yolov8n.pt # PyTorch yolov8n.torchscript # TorchScript yolov8n.onnx # ONNX Runtime or OpenCV DNN with dnn=True yolov8n_openvino_model # OpenVINO yolov8n.engine # TensorRT yolov8n.mlpackage # CoreML (macOS-only) yolov8n_saved_model # TensorFlow SavedModel yolov8n.pb # TensorFlow GraphDef yolov8n.tflite # TensorFlow Lite yolov8n_edgetpu.tflite # TensorFlow Edge TPU yolov8n_paddle_model # PaddlePaddle """ import platform import threading from pathlib import Path import cv2 import numpy as np import torch from ultralytics.cfg import get_cfg, get_save_dir from ultralytics.data import load_inference_source from ultralytics.data.augment import LetterBox, classify_transforms from ultralytics.nn.autobackend import AutoBackend from ultralytics.utils import DEFAULT_CFG, LOGGER, MACOS, WINDOWS, callbacks, colorstr, ops from ultralytics.utils.checks import check_imgsz, check_imshow from ultralytics.utils.files import increment_path from ultralytics.utils.torch_utils import select_device, smart_inference_mode STREAM_WARNING = """ WARNING ⚠️ inference results will accumulate in RAM unless `stream=True` is passed, causing potential out-of-memory errors for large sources or long-running streams and videos. See https://docs.ultralytics.com/modes/predict/ for help. Example: results = model(source=..., stream=True) # generator of Results objects for r in results: boxes = r.boxes # Boxes object for bbox outputs masks = r.masks # Masks object for segment masks outputs probs = r.probs # Class probabilities for classification outputs """ class BasePredictor: """ BasePredictor. A base class for creating predictors. Attributes: args (SimpleNamespace): Configuration for the predictor. save_dir (Path): Directory to save results. done_warmup (bool): Whether the predictor has finished setup. model (nn.Module): Model used for prediction. data (dict): Data configuration. device (torch.device): Device used for prediction. dataset (Dataset): Dataset used for prediction. vid_path (str): Path to video file. vid_writer (cv2.VideoWriter): Video writer for saving video output. data_path (str): Path to data. """ def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): """ Initializes the BasePredictor class. Args: cfg (str, optional): Path to a configuration file. Defaults to DEFAULT_CFG. overrides (dict, optional): Configuration overrides. Defaults to None. """ self.args = get_cfg(cfg, overrides) self.save_dir = get_save_dir(self.args) if self.args.conf is None: self.args.conf = 0.25 # default conf=0.25 self.done_warmup = False if self.args.show: self.args.show = check_imshow(warn=True) # Usable if setup is done self.model = None self.data = self.args.data # data_dict self.imgsz = None self.device = None self.dataset = None self.vid_path, self.vid_writer, self.vid_frame = None, None, None self.plotted_img = None self.data_path = None self.source_type = None self.batch = None self.results = None self.transforms = None self.callbacks = _callbacks or callbacks.get_default_callbacks() self.txt_path = None self._lock = threading.Lock() # for automatic thread-safe inference callbacks.add_integration_callbacks(self) def preprocess(self, im): """ Prepares input image before inference. Args: im (torch.Tensor | List(np.ndarray)): BCHW for tensor, [(HWC) x B] for list. """ not_tensor = not isinstance(im, torch.Tensor) if not_tensor: im = np.stack(self.pre_transform(im)) im = im[..., ::-1].transpose((0, 3, 1, 2)) # BGR to RGB, BHWC to BCHW, (n, 3, h, w) im = np.ascontiguousarray(im) # contiguous im = torch.from_numpy(im) im = im.to(self.device) im = im.half() if self.model.fp16 else im.float() # uint8 to fp16/32 if not_tensor: im /= 255 # 0 - 255 to 0.0 - 1.0 return im def inference(self, im, *args, **kwargs): """Runs inference on a given image using the specified model and arguments.""" visualize = ( increment_path(self.save_dir / Path(self.batch[0][0]).stem, mkdir=True) if self.args.visualize and (not self.source_type.tensor) else False ) return self.model(im, augment=self.args.augment, visualize=visualize, embed=self.args.embed, *args, **kwargs) def pre_transform(self, im): """ Pre-transform input image before inference. Args: im (List(np.ndarray)): (N, 3, h, w) for tensor, [(h, w, 3) x N] for list. Returns: (list): A list of transformed images. """ same_shapes = all(x.shape == im[0].shape for x in im) letterbox = LetterBox(self.imgsz, auto=same_shapes and self.model.pt, stride=self.model.stride) return [letterbox(image=x) for x in im] def write_results(self, idx, results, batch): """Write inference results to a file or directory.""" p, im, _ = batch log_string = "" if len(im.shape) == 3: im = im[None] # expand for batch dim if self.source_type.webcam or self.source_type.from_img or self.source_type.tensor: # batch_size >= 1 log_string += f"{idx}: " frame = self.dataset.count else: frame = getattr(self.dataset, "frame", 0) self.data_path = p self.txt_path = str(self.save_dir / "labels" / p.stem) + ("" if self.dataset.mode == "image" else f"_{frame}") log_string += "%gx%g " % im.shape[2:] # print string result = results[idx] log_string += result.verbose() if self.args.save or self.args.show: # Add bbox to image plot_args = { "line_width": self.args.line_width, "boxes": self.args.show_boxes, "conf": self.args.show_conf, "labels": self.args.show_labels, } if not self.args.retina_masks: plot_args["im_gpu"] = im[idx] self.plotted_img = result.plot(**plot_args) # Write if self.args.save_txt: result.save_txt(f"{self.txt_path}.txt", save_conf=self.args.save_conf) if self.args.save_crop: result.save_crop( save_dir=self.save_dir / "crops", file_name=self.data_path.stem + ("" if self.dataset.mode == "image" else f"_{frame}"), ) return log_string def postprocess(self, preds, img, orig_imgs): """Post-processes predictions for an image and returns them.""" return preds def __call__(self, source=None, model=None, stream=False, *args, **kwargs): """Performs inference on an image or stream.""" self.stream = stream if stream: return self.stream_inference(source, model, *args, **kwargs) else: return list(self.stream_inference(source, model, *args, **kwargs)) # merge list of Result into one def predict_cli(self, source=None, model=None): """ Method used for CLI prediction. It uses always generator as outputs as not required by CLI mode. """ gen = self.stream_inference(source, model) for _ in gen: # noqa, running CLI inference without accumulating any outputs (do not modify) pass def setup_source(self, source): """Sets up source and inference mode.""" self.imgsz = check_imgsz(self.args.imgsz, stride=self.model.stride, min_dim=2) # check image size self.transforms = ( getattr( self.model.model, "transforms", classify_transforms(self.imgsz[0], crop_fraction=self.args.crop_fraction), ) if self.args.task == "classify" else None ) self.dataset = load_inference_source( source=source, vid_stride=self.args.vid_stride, buffer=self.args.stream_buffer ) self.source_type = self.dataset.source_type if not getattr(self, "stream", True) and ( self.dataset.mode == "stream" # streams or len(self.dataset) > 1000 # images or any(getattr(self.dataset, "video_flag", [False])) ): # videos LOGGER.warning(STREAM_WARNING) self.vid_path = [None] * self.dataset.bs self.vid_writer = [None] * self.dataset.bs self.vid_frame = [None] * self.dataset.bs @smart_inference_mode() def stream_inference(self, source=None, model=None, *args, **kwargs): """Streams real-time inference on camera feed and saves results to file.""" if self.args.verbose: LOGGER.info("") # Setup model if not self.model: self.setup_model(model) with self._lock: # for thread-safe inference # Setup source every time predict is called self.setup_source(source if source is not None else self.args.source) # Check if save_dir/ label file exists if self.args.save or self.args.save_txt: (self.save_dir / "labels" if self.args.save_txt else self.save_dir).mkdir(parents=True, exist_ok=True) # Warmup model if not self.done_warmup: self.model.warmup(imgsz=(1 if self.model.pt or self.model.triton else self.dataset.bs, 3, *self.imgsz)) self.done_warmup = True self.seen, self.windows, self.batch = 0, [], None profilers = ( ops.Profile(device=self.device), ops.Profile(device=self.device), ops.Profile(device=self.device), ) self.run_callbacks("on_predict_start") for batch in self.dataset: self.run_callbacks("on_predict_batch_start") self.batch = batch path, im0s, vid_cap, s = batch # Preprocess with profilers[0]: im = self.preprocess(im0s) # Inference with profilers[1]: preds = self.inference(im, *args, **kwargs) if self.args.embed: yield from [preds] if isinstance(preds, torch.Tensor) else preds # yield embedding tensors continue # Postprocess with profilers[2]: self.results = self.postprocess(preds, im, im0s) self.run_callbacks("on_predict_postprocess_end") # Visualize, save, write results n = len(im0s) for i in range(n): self.seen += 1 self.results[i].speed = { "preprocess": profilers[0].dt * 1e3 / n, "inference": profilers[1].dt * 1e3 / n, "postprocess": profilers[2].dt * 1e3 / n, } p, im0 = path[i], None if self.source_type.tensor else im0s[i].copy() p = Path(p) if self.args.verbose or self.args.save or self.args.save_txt or self.args.show: s += self.write_results(i, self.results, (p, im, im0)) if self.args.save or self.args.save_txt: self.results[i].save_dir = self.save_dir.__str__() if self.args.show and self.plotted_img is not None: self.show(p) if self.args.save and self.plotted_img is not None: self.save_preds(vid_cap, i, str(self.save_dir / p.name)) self.run_callbacks("on_predict_batch_end") yield from self.results # Print time (inference-only) if self.args.verbose: LOGGER.info(f"{s}{profilers[1].dt * 1E3:.1f}ms") # Release assets if isinstance(self.vid_writer[-1], cv2.VideoWriter): self.vid_writer[-1].release() # release final video writer # Print results if self.args.verbose and self.seen: t = tuple(x.t / self.seen * 1e3 for x in profilers) # speeds per image LOGGER.info( f"Speed: %.1fms preprocess, %.1fms inference, %.1fms postprocess per image at shape " f"{(1, 3, *im.shape[2:])}" % t ) if self.args.save or self.args.save_txt or self.args.save_crop: nl = len(list(self.save_dir.glob("labels/*.txt"))) # number of labels s = f"\n{nl} label{'s' * (nl > 1)} saved to {self.save_dir / 'labels'}" if self.args.save_txt else "" LOGGER.info(f"Results saved to {colorstr('bold', self.save_dir)}{s}") self.run_callbacks("on_predict_end") def setup_model(self, model, verbose=True): """Initialize YOLO model with given parameters and set it to evaluation mode.""" self.model = AutoBackend( model or self.args.model, device=select_device(self.args.device, verbose=verbose), dnn=self.args.dnn, data=self.args.data, fp16=self.args.half, fuse=True, verbose=verbose, ) self.device = self.model.device # update device self.args.half = self.model.fp16 # update half self.model.eval() def show(self, p): """Display an image in a window using OpenCV imshow().""" im0 = self.plotted_img if platform.system() == "Linux" and p not in self.windows: self.windows.append(p) cv2.namedWindow(str(p), cv2.WINDOW_NORMAL | cv2.WINDOW_KEEPRATIO) # allow window resize (Linux) cv2.resizeWindow(str(p), im0.shape[1], im0.shape[0]) cv2.imshow(str(p), im0) cv2.waitKey(500 if self.batch[3].startswith("image") else 1) # 1 millisecond def save_preds(self, vid_cap, idx, save_path): """Save video predictions as mp4 at specified path.""" im0 = self.plotted_img # Save imgs if self.dataset.mode == "image": cv2.imwrite(save_path, im0) else: # 'video' or 'stream' frames_path = f'{save_path.split(".", 1)[0]}_frames/' if self.vid_path[idx] != save_path: # new video self.vid_path[idx] = save_path if self.args.save_frames: Path(frames_path).mkdir(parents=True, exist_ok=True) self.vid_frame[idx] = 0 if isinstance(self.vid_writer[idx], cv2.VideoWriter): self.vid_writer[idx].release() # release previous video writer if vid_cap: # video fps = int(vid_cap.get(cv2.CAP_PROP_FPS)) # integer required, floats produce error in MP4 codec w = int(vid_cap.get(cv2.CAP_PROP_FRAME_WIDTH)) h = int(vid_cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) else: # stream fps, w, h = 30, im0.shape[1], im0.shape[0] suffix, fourcc = (".mp4", "avc1") if MACOS else (".avi", "WMV2") if WINDOWS else (".avi", "MJPG") self.vid_writer[idx] = cv2.VideoWriter( str(Path(save_path).with_suffix(suffix)), cv2.VideoWriter_fourcc(*fourcc), fps, (w, h) ) # Write video self.vid_writer[idx].write(im0) # Write frame if self.args.save_frames: cv2.imwrite(f"{frames_path}{self.vid_frame[idx]}.jpg", im0) self.vid_frame[idx] += 1 def run_callbacks(self, event: str): """Runs all registered callbacks for a specific event.""" for callback in self.callbacks.get(event, []): callback(self) def add_callback(self, event: str, func): """Add callback.""" self.callbacks[event].append(func)
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/engine/predictor.py
Python
unknown
17,832
# Ultralytics YOLO 🚀, AGPL-3.0 license """ Ultralytics Results, Boxes and Masks classes for handling inference results. Usage: See https://docs.ultralytics.com/modes/predict/ """ from copy import deepcopy from functools import lru_cache from pathlib import Path import numpy as np import torch from ultralytics.data.augment import LetterBox from ultralytics.utils import LOGGER, SimpleClass, ops from ultralytics.utils.plotting import Annotator, colors, save_one_box from ultralytics.utils.torch_utils import smart_inference_mode class BaseTensor(SimpleClass): """Base tensor class with additional methods for easy manipulation and device handling.""" def __init__(self, data, orig_shape) -> None: """ Initialize BaseTensor with data and original shape. Args: data (torch.Tensor | np.ndarray): Predictions, such as bboxes, masks and keypoints. orig_shape (tuple): Original shape of image. """ assert isinstance(data, (torch.Tensor, np.ndarray)) self.data = data self.orig_shape = orig_shape @property def shape(self): """Return the shape of the data tensor.""" return self.data.shape def cpu(self): """Return a copy of the tensor on CPU memory.""" return self if isinstance(self.data, np.ndarray) else self.__class__(self.data.cpu(), self.orig_shape) def numpy(self): """Return a copy of the tensor as a numpy array.""" return self if isinstance(self.data, np.ndarray) else self.__class__(self.data.numpy(), self.orig_shape) def cuda(self): """Return a copy of the tensor on GPU memory.""" return self.__class__(torch.as_tensor(self.data).cuda(), self.orig_shape) def to(self, *args, **kwargs): """Return a copy of the tensor with the specified device and dtype.""" return self.__class__(torch.as_tensor(self.data).to(*args, **kwargs), self.orig_shape) def __len__(self): # override len(results) """Return the length of the data tensor.""" return len(self.data) def __getitem__(self, idx): """Return a BaseTensor with the specified index of the data tensor.""" return self.__class__(self.data[idx], self.orig_shape) class Results(SimpleClass): """ A class for storing and manipulating inference results. Attributes: orig_img (numpy.ndarray): Original image as a numpy array. orig_shape (tuple): Original image shape in (height, width) format. boxes (Boxes, optional): Object containing detection bounding boxes. masks (Masks, optional): Object containing detection masks. probs (Probs, optional): Object containing class probabilities for classification tasks. keypoints (Keypoints, optional): Object containing detected keypoints for each object. speed (dict): Dictionary of preprocess, inference, and postprocess speeds (ms/image). names (dict): Dictionary of class names. path (str): Path to the image file. Methods: update(boxes=None, masks=None, probs=None, obb=None): Updates object attributes with new detection results. cpu(): Returns a copy of the Results object with all tensors on CPU memory. numpy(): Returns a copy of the Results object with all tensors as numpy arrays. cuda(): Returns a copy of the Results object with all tensors on GPU memory. to(*args, **kwargs): Returns a copy of the Results object with tensors on a specified device and dtype. new(): Returns a new Results object with the same image, path, and names. plot(...): Plots detection results on an input image, returning an annotated image. show(): Show annotated results to screen. save(filename): Save annotated results to file. verbose(): Returns a log string for each task, detailing detections and classifications. save_txt(txt_file, save_conf=False): Saves detection results to a text file. save_crop(save_dir, file_name=Path("im.jpg")): Saves cropped detection images. tojson(normalize=False): Converts detection results to JSON format. """ def __init__(self, orig_img, path, names, boxes=None, masks=None, probs=None, keypoints=None, obb=None) -> None: """ Initialize the Results class. Args: orig_img (numpy.ndarray): The original image as a numpy array. path (str): The path to the image file. names (dict): A dictionary of class names. boxes (torch.tensor, optional): A 2D tensor of bounding box coordinates for each detection. masks (torch.tensor, optional): A 3D tensor of detection masks, where each mask is a binary image. probs (torch.tensor, optional): A 1D tensor of probabilities of each class for classification task. keypoints (torch.tensor, optional): A 2D tensor of keypoint coordinates for each detection. obb (torch.tensor, optional): A 2D tensor of oriented bounding box coordinates for each detection. """ self.orig_img = orig_img self.orig_shape = orig_img.shape[:2] self.boxes = Boxes(boxes, self.orig_shape) if boxes is not None else None # native size boxes self.masks = Masks(masks, self.orig_shape) if masks is not None else None # native size or imgsz masks self.probs = Probs(probs) if probs is not None else None self.keypoints = Keypoints(keypoints, self.orig_shape) if keypoints is not None else None self.obb = OBB(obb, self.orig_shape) if obb is not None else None self.speed = {"preprocess": None, "inference": None, "postprocess": None} # milliseconds per image self.names = names self.path = path self.save_dir = None self._keys = "boxes", "masks", "probs", "keypoints", "obb" def __getitem__(self, idx): """Return a Results object for the specified index.""" return self._apply("__getitem__", idx) def __len__(self): """Return the number of detections in the Results object.""" for k in self._keys: v = getattr(self, k) if v is not None: return len(v) def update(self, boxes=None, masks=None, probs=None, obb=None): """Update the boxes, masks, and probs attributes of the Results object.""" if boxes is not None: self.boxes = Boxes(ops.clip_boxes(boxes, self.orig_shape), self.orig_shape) if masks is not None: self.masks = Masks(masks, self.orig_shape) if probs is not None: self.probs = probs if obb is not None: self.obb = OBB(obb, self.orig_shape) def _apply(self, fn, *args, **kwargs): """ Applies a function to all non-empty attributes and returns a new Results object with modified attributes. This function is internally called by methods like .to(), .cuda(), .cpu(), etc. Args: fn (str): The name of the function to apply. *args: Variable length argument list to pass to the function. **kwargs: Arbitrary keyword arguments to pass to the function. Returns: Results: A new Results object with attributes modified by the applied function. """ r = self.new() for k in self._keys: v = getattr(self, k) if v is not None: setattr(r, k, getattr(v, fn)(*args, **kwargs)) return r def cpu(self): """Return a copy of the Results object with all tensors on CPU memory.""" return self._apply("cpu") def numpy(self): """Return a copy of the Results object with all tensors as numpy arrays.""" return self._apply("numpy") def cuda(self): """Return a copy of the Results object with all tensors on GPU memory.""" return self._apply("cuda") def to(self, *args, **kwargs): """Return a copy of the Results object with tensors on the specified device and dtype.""" return self._apply("to", *args, **kwargs) def new(self): """Return a new Results object with the same image, path, and names.""" return Results(orig_img=self.orig_img, path=self.path, names=self.names) def plot( self, conf=True, line_width=None, font_size=None, font="Arial.ttf", pil=False, img=None, im_gpu=None, kpt_radius=5, kpt_line=True, labels=True, boxes=True, masks=True, probs=True, show=False, save=False, filename=None, ): """ Plots the detection results on an input RGB image. Accepts a numpy array (cv2) or a PIL Image. Args: conf (bool): Whether to plot the detection confidence score. line_width (float, optional): The line width of the bounding boxes. If None, it is scaled to the image size. font_size (float, optional): The font size of the text. If None, it is scaled to the image size. font (str): The font to use for the text. pil (bool): Whether to return the image as a PIL Image. img (numpy.ndarray): Plot to another image. if not, plot to original image. im_gpu (torch.Tensor): Normalized image in gpu with shape (1, 3, 640, 640), for faster mask plotting. kpt_radius (int, optional): Radius of the drawn keypoints. Default is 5. kpt_line (bool): Whether to draw lines connecting keypoints. labels (bool): Whether to plot the label of bounding boxes. boxes (bool): Whether to plot the bounding boxes. masks (bool): Whether to plot the masks. probs (bool): Whether to plot classification probability show (bool): Whether to display the annotated image directly. save (bool): Whether to save the annotated image to `filename`. filename (str): Filename to save image to if save is True. Returns: (numpy.ndarray): A numpy array of the annotated image. Example: ```python from PIL import Image from ultralytics import YOLO model = YOLO('yolov8n.pt') results = model('bus.jpg') # results list for r in results: im_array = r.plot() # plot a BGR numpy array of predictions im = Image.fromarray(im_array[..., ::-1]) # RGB PIL image im.show() # show image im.save('results.jpg') # save image ``` """ if img is None and isinstance(self.orig_img, torch.Tensor): img = (self.orig_img[0].detach().permute(1, 2, 0).contiguous() * 255).to(torch.uint8).cpu().numpy() names = self.names is_obb = self.obb is not None pred_boxes, show_boxes = self.obb if is_obb else self.boxes, boxes pred_masks, show_masks = self.masks, masks pred_probs, show_probs = self.probs, probs annotator = Annotator( deepcopy(self.orig_img if img is None else img), line_width, font_size, font, pil or (pred_probs is not None and show_probs), # Classify tasks default to pil=True example=names, ) # Plot Segment results if pred_masks and show_masks: if im_gpu is None: img = LetterBox(pred_masks.shape[1:])(image=annotator.result()) im_gpu = ( torch.as_tensor(img, dtype=torch.float16, device=pred_masks.data.device) .permute(2, 0, 1) .flip(0) .contiguous() / 255 ) idx = pred_boxes.cls if pred_boxes else range(len(pred_masks)) annotator.masks(pred_masks.data, colors=[colors(x, True) for x in idx], im_gpu=im_gpu) # Plot Detect results if pred_boxes is not None and show_boxes: for d in reversed(pred_boxes): c, conf, id = int(d.cls), float(d.conf) if conf else None, None if d.id is None else int(d.id.item()) name = ("" if id is None else f"id:{id} ") + names[c] label = (f"{name} {conf:.2f}" if conf else name) if labels else None box = d.xyxyxyxy.reshape(-1, 4, 2).squeeze() if is_obb else d.xyxy.squeeze() annotator.box_label(box, label, color=colors(c, True), rotated=is_obb) # Plot Classify results if pred_probs is not None and show_probs: text = ",\n".join(f"{names[j] if names else j} {pred_probs.data[j]:.2f}" for j in pred_probs.top5) x = round(self.orig_shape[0] * 0.03) annotator.text([x, x], text, txt_color=(255, 255, 255)) # TODO: allow setting colors # Plot Pose results if self.keypoints is not None: for k in reversed(self.keypoints.data): annotator.kpts(k, self.orig_shape, radius=kpt_radius, kpt_line=kpt_line) # Show results if show: annotator.show(self.path) # Save results if save: annotator.save(filename) return annotator.result() def show(self, *args, **kwargs): """Show annotated results image.""" self.plot(show=True, *args, **kwargs) def save(self, filename=None, *args, **kwargs): """Save annotated results image.""" if not filename: filename = f"results_{Path(self.path).name}" self.plot(save=True, filename=filename, *args, **kwargs) return filename def verbose(self): """Return log string for each task.""" log_string = "" probs = self.probs boxes = self.boxes if len(self) == 0: return log_string if probs is not None else f"{log_string}(no detections), " if probs is not None: log_string += f"{', '.join(f'{self.names[j]} {probs.data[j]:.2f}' for j in probs.top5)}, " if boxes: for c in boxes.cls.unique(): n = (boxes.cls == c).sum() # detections per class log_string += f"{n} {self.names[int(c)]}{'s' * (n > 1)}, " return log_string def save_txt(self, txt_file, save_conf=False): """ Save predictions into txt file. Args: txt_file (str): txt file path. save_conf (bool): save confidence score or not. """ is_obb = self.obb is not None boxes = self.obb if is_obb else self.boxes masks = self.masks probs = self.probs kpts = self.keypoints texts = [] if probs is not None: # Classify [texts.append(f"{probs.data[j]:.2f} {self.names[j]}") for j in probs.top5] elif boxes: # Detect/segment/pose for j, d in enumerate(boxes): c, conf, id = int(d.cls), float(d.conf), None if d.id is None else int(d.id.item()) line = (c, *(d.xyxyxyxyn.view(-1) if is_obb else d.xywhn.view(-1))) if masks: seg = masks[j].xyn[0].copy().reshape(-1) # reversed mask.xyn, (n,2) to (n*2) line = (c, *seg) if kpts is not None: kpt = torch.cat((kpts[j].xyn, kpts[j].conf[..., None]), 2) if kpts[j].has_visible else kpts[j].xyn line += (*kpt.reshape(-1).tolist(),) line += (conf,) * save_conf + (() if id is None else (id,)) texts.append(("%g " * len(line)).rstrip() % line) if texts: Path(txt_file).parent.mkdir(parents=True, exist_ok=True) # make directory with open(txt_file, "a") as f: f.writelines(text + "\n" for text in texts) def save_crop(self, save_dir, file_name=Path("im.jpg")): """ Save cropped predictions to `save_dir/cls/file_name.jpg`. Args: save_dir (str | pathlib.Path): Save path. file_name (str | pathlib.Path): File name. """ if self.probs is not None: LOGGER.warning("WARNING ⚠️ Classify task do not support `save_crop`.") return if self.obb is not None: LOGGER.warning("WARNING ⚠️ OBB task do not support `save_crop`.") return for d in self.boxes: save_one_box( d.xyxy, self.orig_img.copy(), file=Path(save_dir) / self.names[int(d.cls)] / f"{Path(file_name)}.jpg", BGR=True, ) def tojson(self, normalize=False): """Convert the object to JSON format.""" if self.probs is not None: LOGGER.warning("Warning: Classify task do not support `tojson` yet.") return import json # Create list of detection dictionaries results = [] data = self.boxes.data.cpu().tolist() h, w = self.orig_shape if normalize else (1, 1) for i, row in enumerate(data): # xyxy, track_id if tracking, conf, class_id box = {"x1": row[0] / w, "y1": row[1] / h, "x2": row[2] / w, "y2": row[3] / h} conf = row[-2] class_id = int(row[-1]) name = self.names[class_id] result = {"name": name, "class": class_id, "confidence": conf, "box": box} if self.boxes.is_track: result["track_id"] = int(row[-3]) # track ID if self.masks: x, y = self.masks.xy[i][:, 0], self.masks.xy[i][:, 1] # numpy array result["segments"] = {"x": (x / w).tolist(), "y": (y / h).tolist()} if self.keypoints is not None: x, y, visible = self.keypoints[i].data[0].cpu().unbind(dim=1) # torch Tensor result["keypoints"] = {"x": (x / w).tolist(), "y": (y / h).tolist(), "visible": visible.tolist()} results.append(result) # Convert detections to JSON return json.dumps(results, indent=2) class Boxes(BaseTensor): """ Manages detection boxes, providing easy access and manipulation of box coordinates, confidence scores, class identifiers, and optional tracking IDs. Supports multiple formats for box coordinates, including both absolute and normalized forms. Attributes: data (torch.Tensor): The raw tensor containing detection boxes and their associated data. orig_shape (tuple): The original image size as a tuple (height, width), used for normalization. is_track (bool): Indicates whether tracking IDs are included in the box data. Properties: xyxy (torch.Tensor | numpy.ndarray): Boxes in [x1, y1, x2, y2] format. conf (torch.Tensor | numpy.ndarray): Confidence scores for each box. cls (torch.Tensor | numpy.ndarray): Class labels for each box. id (torch.Tensor | numpy.ndarray, optional): Tracking IDs for each box, if available. xywh (torch.Tensor | numpy.ndarray): Boxes in [x, y, width, height] format, calculated on demand. xyxyn (torch.Tensor | numpy.ndarray): Normalized [x1, y1, x2, y2] boxes, relative to `orig_shape`. xywhn (torch.Tensor | numpy.ndarray): Normalized [x, y, width, height] boxes, relative to `orig_shape`. Methods: cpu(): Moves the boxes to CPU memory. numpy(): Converts the boxes to a numpy array format. cuda(): Moves the boxes to CUDA (GPU) memory. to(device, dtype=None): Moves the boxes to the specified device. """ def __init__(self, boxes, orig_shape) -> None: """ Initialize the Boxes class. Args: boxes (torch.Tensor | numpy.ndarray): A tensor or numpy array containing the detection boxes, with shape (num_boxes, 6) or (num_boxes, 7). The last two columns contain confidence and class values. If present, the third last column contains track IDs. orig_shape (tuple): Original image size, in the format (height, width). """ if boxes.ndim == 1: boxes = boxes[None, :] n = boxes.shape[-1] assert n in (6, 7), f"expected 6 or 7 values but got {n}" # xyxy, track_id, conf, cls super().__init__(boxes, orig_shape) self.is_track = n == 7 self.orig_shape = orig_shape @property def xyxy(self): """Return the boxes in xyxy format.""" return self.data[:, :4] @property def conf(self): """Return the confidence values of the boxes.""" return self.data[:, -2] @property def cls(self): """Return the class values of the boxes.""" return self.data[:, -1] @property def id(self): """Return the track IDs of the boxes (if available).""" return self.data[:, -3] if self.is_track else None @property @lru_cache(maxsize=2) # maxsize 1 should suffice def xywh(self): """Return the boxes in xywh format.""" return ops.xyxy2xywh(self.xyxy) @property @lru_cache(maxsize=2) def xyxyn(self): """Return the boxes in xyxy format normalized by original image size.""" xyxy = self.xyxy.clone() if isinstance(self.xyxy, torch.Tensor) else np.copy(self.xyxy) xyxy[..., [0, 2]] /= self.orig_shape[1] xyxy[..., [1, 3]] /= self.orig_shape[0] return xyxy @property @lru_cache(maxsize=2) def xywhn(self): """Return the boxes in xywh format normalized by original image size.""" xywh = ops.xyxy2xywh(self.xyxy) xywh[..., [0, 2]] /= self.orig_shape[1] xywh[..., [1, 3]] /= self.orig_shape[0] return xywh class Masks(BaseTensor): """ A class for storing and manipulating detection masks. Attributes: xy (list): A list of segments in pixel coordinates. xyn (list): A list of normalized segments. Methods: cpu(): Returns the masks tensor on CPU memory. numpy(): Returns the masks tensor as a numpy array. cuda(): Returns the masks tensor on GPU memory. to(device, dtype): Returns the masks tensor with the specified device and dtype. """ def __init__(self, masks, orig_shape) -> None: """Initialize the Masks class with the given masks tensor and original image shape.""" if masks.ndim == 2: masks = masks[None, :] super().__init__(masks, orig_shape) @property @lru_cache(maxsize=1) def xyn(self): """Return normalized segments.""" return [ ops.scale_coords(self.data.shape[1:], x, self.orig_shape, normalize=True) for x in ops.masks2segments(self.data) ] @property @lru_cache(maxsize=1) def xy(self): """Return segments in pixel coordinates.""" return [ ops.scale_coords(self.data.shape[1:], x, self.orig_shape, normalize=False) for x in ops.masks2segments(self.data) ] class Keypoints(BaseTensor): """ A class for storing and manipulating detection keypoints. Attributes: xy (torch.Tensor): A collection of keypoints containing x, y coordinates for each detection. xyn (torch.Tensor): A normalized version of xy with coordinates in the range [0, 1]. conf (torch.Tensor): Confidence values associated with keypoints if available, otherwise None. Methods: cpu(): Returns a copy of the keypoints tensor on CPU memory. numpy(): Returns a copy of the keypoints tensor as a numpy array. cuda(): Returns a copy of the keypoints tensor on GPU memory. to(device, dtype): Returns a copy of the keypoints tensor with the specified device and dtype. """ @smart_inference_mode() # avoid keypoints < conf in-place error def __init__(self, keypoints, orig_shape) -> None: """Initializes the Keypoints object with detection keypoints and original image size.""" if keypoints.ndim == 2: keypoints = keypoints[None, :] if keypoints.shape[2] == 3: # x, y, conf mask = keypoints[..., 2] < 0.5 # points with conf < 0.5 (not visible) keypoints[..., :2][mask] = 0 super().__init__(keypoints, orig_shape) self.has_visible = self.data.shape[-1] == 3 @property @lru_cache(maxsize=1) def xy(self): """Returns x, y coordinates of keypoints.""" return self.data[..., :2] @property @lru_cache(maxsize=1) def xyn(self): """Returns normalized x, y coordinates of keypoints.""" xy = self.xy.clone() if isinstance(self.xy, torch.Tensor) else np.copy(self.xy) xy[..., 0] /= self.orig_shape[1] xy[..., 1] /= self.orig_shape[0] return xy @property @lru_cache(maxsize=1) def conf(self): """Returns confidence values of keypoints if available, else None.""" return self.data[..., 2] if self.has_visible else None class Probs(BaseTensor): """ A class for storing and manipulating classification predictions. Attributes: top1 (int): Index of the top 1 class. top5 (list[int]): Indices of the top 5 classes. top1conf (torch.Tensor): Confidence of the top 1 class. top5conf (torch.Tensor): Confidences of the top 5 classes. Methods: cpu(): Returns a copy of the probs tensor on CPU memory. numpy(): Returns a copy of the probs tensor as a numpy array. cuda(): Returns a copy of the probs tensor on GPU memory. to(): Returns a copy of the probs tensor with the specified device and dtype. """ def __init__(self, probs, orig_shape=None) -> None: """Initialize the Probs class with classification probabilities and optional original shape of the image.""" super().__init__(probs, orig_shape) @property @lru_cache(maxsize=1) def top1(self): """Return the index of top 1.""" return int(self.data.argmax()) @property @lru_cache(maxsize=1) def top5(self): """Return the indices of top 5.""" return (-self.data).argsort(0)[:5].tolist() # this way works with both torch and numpy. @property @lru_cache(maxsize=1) def top1conf(self): """Return the confidence of top 1.""" return self.data[self.top1] @property @lru_cache(maxsize=1) def top5conf(self): """Return the confidences of top 5.""" return self.data[self.top5] class OBB(BaseTensor): """ A class for storing and manipulating Oriented Bounding Boxes (OBB). Args: boxes (torch.Tensor | numpy.ndarray): A tensor or numpy array containing the detection boxes, with shape (num_boxes, 7) or (num_boxes, 8). The last two columns contain confidence and class values. If present, the third last column contains track IDs, and the fifth column from the left contains rotation. orig_shape (tuple): Original image size, in the format (height, width). Attributes: xywhr (torch.Tensor | numpy.ndarray): The boxes in [x_center, y_center, width, height, rotation] format. conf (torch.Tensor | numpy.ndarray): The confidence values of the boxes. cls (torch.Tensor | numpy.ndarray): The class values of the boxes. id (torch.Tensor | numpy.ndarray): The track IDs of the boxes (if available). xyxyxyxyn (torch.Tensor | numpy.ndarray): The rotated boxes in xyxyxyxy format normalized by orig image size. xyxyxyxy (torch.Tensor | numpy.ndarray): The rotated boxes in xyxyxyxy format. xyxy (torch.Tensor | numpy.ndarray): The horizontal boxes in xyxyxyxy format. data (torch.Tensor): The raw OBB tensor (alias for `boxes`). Methods: cpu(): Move the object to CPU memory. numpy(): Convert the object to a numpy array. cuda(): Move the object to CUDA memory. to(*args, **kwargs): Move the object to the specified device. """ def __init__(self, boxes, orig_shape) -> None: """Initialize the Boxes class.""" if boxes.ndim == 1: boxes = boxes[None, :] n = boxes.shape[-1] assert n in (7, 8), f"expected 7 or 8 values but got {n}" # xywh, rotation, track_id, conf, cls super().__init__(boxes, orig_shape) self.is_track = n == 8 self.orig_shape = orig_shape @property def xywhr(self): """Return the rotated boxes in xywhr format.""" return self.data[:, :5] @property def conf(self): """Return the confidence values of the boxes.""" return self.data[:, -2] @property def cls(self): """Return the class values of the boxes.""" return self.data[:, -1] @property def id(self): """Return the track IDs of the boxes (if available).""" return self.data[:, -3] if self.is_track else None @property @lru_cache(maxsize=2) def xyxyxyxy(self): """Return the boxes in xyxyxyxy format, (N, 4, 2).""" return ops.xywhr2xyxyxyxy(self.xywhr) @property @lru_cache(maxsize=2) def xyxyxyxyn(self): """Return the boxes in xyxyxyxy format, (N, 4, 2).""" xyxyxyxyn = self.xyxyxyxy.clone() if isinstance(self.xyxyxyxy, torch.Tensor) else np.copy(self.xyxyxyxy) xyxyxyxyn[..., 0] /= self.orig_shape[0] xyxyxyxyn[..., 1] /= self.orig_shape[1] return xyxyxyxyn @property @lru_cache(maxsize=2) def xyxy(self): """ Return the horizontal boxes in xyxy format, (N, 4). Accepts both torch and numpy boxes. """ x1 = self.xyxyxyxy[..., 0].min(1).values x2 = self.xyxyxyxy[..., 0].max(1).values y1 = self.xyxyxyxy[..., 1].min(1).values y2 = self.xyxyxyxy[..., 1].max(1).values xyxy = [x1, y1, x2, y2] return np.stack(xyxy, axis=-1) if isinstance(self.data, np.ndarray) else torch.stack(xyxy, dim=-1)
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/engine/results.py
Python
unknown
30,120
# Ultralytics YOLO 🚀, AGPL-3.0 license """ Train a model on a dataset. Usage: $ yolo mode=train model=yolov8n.pt data=coco128.yaml imgsz=640 epochs=100 batch=16 """ import math import os import subprocess import time import warnings from copy import deepcopy from datetime import datetime, timedelta from pathlib import Path import numpy as np import torch from torch import distributed as dist from torch import nn, optim from ultralytics.cfg import get_cfg, get_save_dir from ultralytics.data.utils import check_cls_dataset, check_det_dataset from ultralytics.nn.tasks import attempt_load_one_weight, attempt_load_weights from ultralytics.utils import ( DEFAULT_CFG, LOGGER, RANK, TQDM, __version__, callbacks, clean_url, colorstr, emojis, yaml_save, ) from ultralytics.utils.autobatch import check_train_batch_size from ultralytics.utils.checks import check_amp, check_file, check_imgsz, check_model_file_from_stem, print_args from ultralytics.utils.dist import ddp_cleanup, generate_ddp_command from ultralytics.utils.files import get_latest_run from ultralytics.utils.torch_utils import ( EarlyStopping, ModelEMA, de_parallel, init_seeds, one_cycle, select_device, strip_optimizer, ) class BaseTrainer: """ BaseTrainer. A base class for creating trainers. Attributes: args (SimpleNamespace): Configuration for the trainer. validator (BaseValidator): Validator instance. model (nn.Module): Model instance. callbacks (defaultdict): Dictionary of callbacks. save_dir (Path): Directory to save results. wdir (Path): Directory to save weights. last (Path): Path to the last checkpoint. best (Path): Path to the best checkpoint. save_period (int): Save checkpoint every x epochs (disabled if < 1). batch_size (int): Batch size for training. epochs (int): Number of epochs to train for. start_epoch (int): Starting epoch for training. device (torch.device): Device to use for training. amp (bool): Flag to enable AMP (Automatic Mixed Precision). scaler (amp.GradScaler): Gradient scaler for AMP. data (str): Path to data. trainset (torch.utils.data.Dataset): Training dataset. testset (torch.utils.data.Dataset): Testing dataset. ema (nn.Module): EMA (Exponential Moving Average) of the model. resume (bool): Resume training from a checkpoint. lf (nn.Module): Loss function. scheduler (torch.optim.lr_scheduler._LRScheduler): Learning rate scheduler. best_fitness (float): The best fitness value achieved. fitness (float): Current fitness value. loss (float): Current loss value. tloss (float): Total loss value. loss_names (list): List of loss names. csv (Path): Path to results CSV file. """ def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): """ Initializes the BaseTrainer class. Args: cfg (str, optional): Path to a configuration file. Defaults to DEFAULT_CFG. overrides (dict, optional): Configuration overrides. Defaults to None. """ self.args = get_cfg(cfg, overrides) self.check_resume(overrides) self.device = select_device(self.args.device, self.args.batch) self.validator = None self.metrics = None self.plots = {} init_seeds(self.args.seed + 1 + RANK, deterministic=self.args.deterministic) # Dirs self.save_dir = get_save_dir(self.args) self.args.name = self.save_dir.name # update name for loggers self.wdir = self.save_dir / "weights" # weights dir if RANK in (-1, 0): self.wdir.mkdir(parents=True, exist_ok=True) # make dir self.args.save_dir = str(self.save_dir) yaml_save(self.save_dir / "args.yaml", vars(self.args)) # save run args self.last, self.best = self.wdir / "last.pt", self.wdir / "best.pt" # checkpoint paths self.save_period = self.args.save_period self.batch_size = self.args.batch self.epochs = self.args.epochs self.start_epoch = 0 if RANK == -1: print_args(vars(self.args)) # Device if self.device.type in ("cpu", "mps"): self.args.workers = 0 # faster CPU training as time dominated by inference, not dataloading # Model and Dataset self.model = check_model_file_from_stem(self.args.model) # add suffix, i.e. yolov8n -> yolov8n.pt try: if self.args.task == "classify": self.data = check_cls_dataset(self.args.data) elif self.args.data.split(".")[-1] in ("yaml", "yml") or self.args.task in ("detect", "segment", "pose"): self.data = check_det_dataset(self.args.data) if "yaml_file" in self.data: self.args.data = self.data["yaml_file"] # for validating 'yolo train data=url.zip' usage except Exception as e: raise RuntimeError(emojis(f"Dataset '{clean_url(self.args.data)}' error ❌ {e}")) from e self.trainset, self.testset = self.get_dataset(self.data) self.ema = None # Optimization utils init self.lf = None self.scheduler = None # Epoch level metrics self.best_fitness = None self.fitness = None self.loss = None self.tloss = None self.loss_names = ["Loss"] self.csv = self.save_dir / "results.csv" self.plot_idx = [0, 1, 2] # Callbacks self.callbacks = _callbacks or callbacks.get_default_callbacks() if RANK in (-1, 0): callbacks.add_integration_callbacks(self) def add_callback(self, event: str, callback): """Appends the given callback.""" self.callbacks[event].append(callback) def set_callback(self, event: str, callback): """Overrides the existing callbacks with the given callback.""" self.callbacks[event] = [callback] def run_callbacks(self, event: str): """Run all existing callbacks associated with a particular event.""" for callback in self.callbacks.get(event, []): callback(self) def train(self,singal=None,singal_2=None,singal_3=None,singal_4=None): """Allow device='', device=None on Multi-GPU systems to default to device=0.""" if isinstance(self.args.device, str) and len(self.args.device): # i.e. device='0' or device='0,1,2,3' world_size = len(self.args.device.split(",")) elif isinstance(self.args.device, (tuple, list)): # i.e. device=[0, 1, 2, 3] (multi-GPU from CLI is list) world_size = len(self.args.device) elif torch.cuda.is_available(): # i.e. device=None or device='' or device=number world_size = 1 # default to device 0 else: # i.e. device='cpu' or 'mps' world_size = 0 # Run subprocess if DDP training, else train normally if world_size > 1 and "LOCAL_RANK" not in os.environ: # Argument checks if self.args.rect: LOGGER.warning("WARNING ⚠️ 'rect=True' is incompatible with Multi-GPU training, setting 'rect=False'") self.args.rect = False if self.args.batch == -1: LOGGER.warning( "WARNING ⚠️ 'batch=-1' for AutoBatch is incompatible with Multi-GPU training, setting " "default 'batch=16'" ) self.args.batch = 16 # Command cmd, file = generate_ddp_command(world_size, self) try: LOGGER.info(f'{colorstr("DDP:")} debug command {" ".join(cmd)}') subprocess.run(cmd, check=True) except Exception as e: raise e finally: ddp_cleanup(self, str(file)) else: self._do_train(RANK, singal=singal, singal_2=singal_2, singal_3=singal_3, singal_4=singal_4, world_size=world_size,) def _setup_scheduler(self): """Initialize training learning rate scheduler.""" if self.args.cos_lr: self.lf = one_cycle(1, self.args.lrf, self.epochs) # cosine 1->hyp['lrf'] else: self.lf = lambda x: max(1 - x / self.epochs, 0) * (1.0 - self.args.lrf) + self.args.lrf # linear self.scheduler = optim.lr_scheduler.LambdaLR(self.optimizer, lr_lambda=self.lf) def _setup_ddp(self, world_size): """Initializes and sets the DistributedDataParallel parameters for training.""" torch.cuda.set_device(RANK) self.device = torch.device("cuda", RANK) # LOGGER.info(f'DDP info: RANK {RANK}, WORLD_SIZE {world_size}, DEVICE {self.device}') os.environ["NCCL_BLOCKING_WAIT"] = "1" # set to enforce timeout dist.init_process_group( "nccl" if dist.is_nccl_available() else "gloo", timeout=timedelta(seconds=10800), # 3 hours rank=RANK, world_size=world_size, ) def _setup_train(self, world_size): """Builds dataloaders and optimizer on correct rank process.""" # Model self.run_callbacks("on_pretrain_routine_start") ckpt = self.setup_model() self.model = self.model.to(self.device) self.set_model_attributes() # Freeze layers freeze_list = ( self.args.freeze if isinstance(self.args.freeze, list) else range(self.args.freeze) if isinstance(self.args.freeze, int) else [] ) always_freeze_names = [".dfl"] # always freeze these layers freeze_layer_names = [f"model.{x}." for x in freeze_list] + always_freeze_names for k, v in self.model.named_parameters(): # v.register_hook(lambda x: torch.nan_to_num(x)) # NaN to 0 (commented for erratic training results) if any(x in k for x in freeze_layer_names): LOGGER.info(f"Freezing layer '{k}'") v.requires_grad = False elif not v.requires_grad: LOGGER.info( f"WARNING ⚠️ setting 'requires_grad=True' for frozen layer '{k}'. " "See ultralytics.engine.trainer for customization of frozen layers." ) v.requires_grad = True # Check AMP self.amp = torch.tensor(self.args.amp).to(self.device) # True or False if self.amp and RANK in (-1, 0): # Single-GPU and DDP callbacks_backup = callbacks.default_callbacks.copy() # backup callbacks as check_amp() resets them self.amp = torch.tensor(check_amp(self.model), device=self.device) callbacks.default_callbacks = callbacks_backup # restore callbacks if RANK > -1 and world_size > 1: # DDP dist.broadcast(self.amp, src=0) # broadcast the tensor from rank 0 to all other ranks (returns None) self.amp = bool(self.amp) # as boolean self.scaler = torch.cuda.amp.GradScaler(enabled=self.amp) if world_size > 1: self.model = nn.parallel.DistributedDataParallel(self.model, device_ids=[RANK]) # Check imgsz gs = max(int(self.model.stride.max() if hasattr(self.model, "stride") else 32), 32) # grid size (max stride) self.args.imgsz = check_imgsz(self.args.imgsz, stride=gs, floor=gs, max_dim=1) self.stride = gs # for multi-scale training # Batch size if self.batch_size == -1 and RANK == -1: # single-GPU only, estimate best batch size self.args.batch = self.batch_size = check_train_batch_size(self.model, self.args.imgsz, self.amp) # Dataloaders batch_size = self.batch_size // max(world_size, 1) self.train_loader = self.get_dataloader(self.trainset, batch_size=batch_size, rank=RANK, mode="train") if RANK in (-1, 0): # NOTE: When training DOTA dataset, double batch size could get OOM cause some images got more than 2000 objects. self.test_loader = self.get_dataloader( self.testset, batch_size=batch_size if self.args.task == "obb" else batch_size * 2, rank=-1, mode="val" ) self.validator = self.get_validator() metric_keys = self.validator.metrics.keys + self.label_loss_items(prefix="val") self.metrics = dict(zip(metric_keys, [0] * len(metric_keys))) self.ema = ModelEMA(self.model) if self.args.plots: self.plot_training_labels() # Optimizer self.accumulate = max(round(self.args.nbs / self.batch_size), 1) # accumulate loss before optimizing weight_decay = self.args.weight_decay * self.batch_size * self.accumulate / self.args.nbs # scale weight_decay iterations = math.ceil(len(self.train_loader.dataset) / max(self.batch_size, self.args.nbs)) * self.epochs self.optimizer = self.build_optimizer( model=self.model, name=self.args.optimizer, lr=self.args.lr0, momentum=self.args.momentum, decay=weight_decay, iterations=iterations, ) # Scheduler self._setup_scheduler() self.stopper, self.stop = EarlyStopping(patience=self.args.patience), False self.resume_training(ckpt) self.scheduler.last_epoch = self.start_epoch - 1 # do not move self.run_callbacks("on_pretrain_routine_end") def _do_train(self, RANK=-1, singal=None,singal_2=None,singal_3=None,singal_4=None, world_size=1): """Train completed, evaluate and plot if specified by arguments.""" if world_size > 1: self._setup_ddp(world_size) self._setup_train(world_size) nb = len(self.train_loader) # number of batches nw = max(round(self.args.warmup_epochs * nb), 100) if self.args.warmup_epochs > 0 else -1 # warmup iterations last_opt_step = -1 self.epoch_time = None self.epoch_time_start = time.time() self.train_time_start = time.time() self.run_callbacks("on_train_start") LOGGER.info( f'Image sizes {self.args.imgsz} train, {self.args.imgsz} val\n' f'Using {self.train_loader.num_workers * (world_size or 1)} dataloader workers\n' f"Logging results to {colorstr('bold', self.save_dir)}\n" f'Starting training for ' + (f"{self.args.time} hours..." if self.args.time else f"{self.epochs} epochs...") ) if self.args.close_mosaic: base_idx = (self.epochs - self.args.close_mosaic) * nb self.plot_idx.extend([base_idx, base_idx + 1, base_idx + 2]) epoch = self.start_epoch while True: self.epoch = epoch self.run_callbacks("on_train_epoch_start") self.model.train() if RANK != -1: self.train_loader.sampler.set_epoch(epoch) pbar = enumerate(self.train_loader) # Update dataloader attributes (optional) if epoch == (self.epochs - self.args.close_mosaic): self._close_dataloader_mosaic() self.train_loader.reset() if RANK in (-1, 0): LOGGER.info(self.progress_string()) pbar = TQDM(enumerate(self.train_loader), total=nb) self.tloss = None self.optimizer.zero_grad() singal_3.emit(len(pbar)) for i, batch in pbar: # print(batch) singal_2.emit(int(i)) self.run_callbacks("on_train_batch_start") # Warmup ni = i + nb * epoch if ni <= nw: xi = [0, nw] # x interp self.accumulate = max(1, int(np.interp(ni, xi, [1, self.args.nbs / self.batch_size]).round())) for j, x in enumerate(self.optimizer.param_groups): # Bias lr falls from 0.1 to lr0, all other lrs rise from 0.0 to lr0 x["lr"] = np.interp( ni, xi, [self.args.warmup_bias_lr if j == 0 else 0.0, x["initial_lr"] * self.lf(epoch)] ) if "momentum" in x: x["momentum"] = np.interp(ni, xi, [self.args.warmup_momentum, self.args.momentum]) # Forward with torch.cuda.amp.autocast(self.amp): batch = self.preprocess_batch(batch) self.loss, self.loss_items = self.model(batch) if RANK != -1: self.loss *= world_size self.tloss = ( (self.tloss * i + self.loss_items) / (i + 1) if self.tloss is not None else self.loss_items ) # Backward self.scaler.scale(self.loss).backward() # Optimize - https://pytorch.org/docs/master/notes/amp_examples.html if ni - last_opt_step >= self.accumulate: self.optimizer_step() last_opt_step = ni # Timed stopping if self.args.time: self.stop = (time.time() - self.train_time_start) > (self.args.time * 3600) if RANK != -1: # if DDP training broadcast_list = [self.stop if RANK == 0 else None] dist.broadcast_object_list(broadcast_list, 0) # broadcast 'stop' to all ranks self.stop = broadcast_list[0] if self.stop: # training time exceeded break # Log mem = f"{torch.cuda.memory_reserved() / 1E9 if torch.cuda.is_available() else 0:.3g}G" # (GB) loss_len = self.tloss.shape[0] if len(self.tloss.shape) else 1 losses = self.tloss if loss_len > 1 else torch.unsqueeze(self.tloss, 0) if RANK in (-1, 0): pbar.set_description( ("%11s" * 2 + "%11.4g" * (2 + loss_len)) % (f"{epoch + 1}/{self.epochs}", mem, *losses, batch["cls"].shape[0], batch["img"].shape[-1]) ) self.run_callbacks("on_batch_end") if self.args.plots and ni in self.plot_idx: self.plot_training_samples(batch, ni) self.run_callbacks("on_train_batch_end") self.lr = {f"lr/pg{ir}": x["lr"] for ir, x in enumerate(self.optimizer.param_groups)} # for loggers self.run_callbacks("on_train_epoch_end") if RANK in (-1, 0): final_epoch = epoch + 1 == self.epochs self.ema.update_attr(self.model, include=["yaml", "nc", "args", "names", "stride", "class_weights"]) # Validation if self.args.val or final_epoch or self.stopper.possible_stop or self.stop: self.metrics, self.fitness = self.validate() singal_4.emit(self.metrics) self.save_metrics(metrics={**self.label_loss_items(self.tloss), **self.metrics, **self.lr}) self.stop |= self.stopper(epoch + 1, self.fitness) or final_epoch if self.args.time: self.stop |= (time.time() - self.train_time_start) > (self.args.time * 3600) # Save model if self.args.save or final_epoch: self.save_model() self.run_callbacks("on_model_save") # Scheduler t = time.time() self.epoch_time = t - self.epoch_time_start self.epoch_time_start = t with warnings.catch_warnings(): warnings.simplefilter("ignore") # suppress 'Detected lr_scheduler.step() before optimizer.step()' if self.args.time: mean_epoch_time = (t - self.train_time_start) / (epoch - self.start_epoch + 1) self.epochs = self.args.epochs = math.ceil(self.args.time * 3600 / mean_epoch_time) self._setup_scheduler() self.scheduler.last_epoch = self.epoch # do not move self.stop |= epoch >= self.epochs # stop if exceeded epochs self.scheduler.step() self.run_callbacks("on_fit_epoch_end") torch.cuda.empty_cache() # clear GPU memory at end of epoch, may help reduce CUDA out of memory errors # Early Stopping if RANK != -1: # if DDP training broadcast_list = [self.stop if RANK == 0 else None] dist.broadcast_object_list(broadcast_list, 0) # broadcast 'stop' to all ranks self.stop = broadcast_list[0] if self.stop: break # must break all DDP ranks epoch += 1 singal.emit(int(epoch)) if RANK in (-1, 0): # Do final val with best.pt LOGGER.info( f"\n{epoch - self.start_epoch + 1} epochs completed in " f"{(time.time() - self.train_time_start) / 3600:.3f} hours." ) self.final_eval() if self.args.plots: self.plot_metrics() self.run_callbacks("on_train_end") torch.cuda.empty_cache() self.run_callbacks("teardown") def save_model(self): """Save model training checkpoints with additional metadata.""" import pandas as pd # scope for faster startup metrics = {**self.metrics, **{"fitness": self.fitness}} results = {k.strip(): v for k, v in pd.read_csv(self.csv).to_dict(orient="list").items()} ckpt = { "epoch": self.epoch, "best_fitness": self.best_fitness, "model": deepcopy(de_parallel(self.model)).half(), "ema": deepcopy(self.ema.ema).half(), "updates": self.ema.updates, "optimizer": self.optimizer.state_dict(), "train_args": vars(self.args), # save as dict "train_metrics": metrics, "train_results": results, "date": datetime.now().isoformat(), "version": __version__, } # Save last and best torch.save(ckpt, self.last) if self.best_fitness == self.fitness: torch.save(ckpt, self.best) if (self.save_period > 0) and (self.epoch > 0) and (self.epoch % self.save_period == 0): torch.save(ckpt, self.wdir / f"epoch{self.epoch}.pt") @staticmethod def get_dataset(data): """ Get train, val path from data dict if it exists. Returns None if data format is not recognized. """ return data["train"], data.get("val") or data.get("test") def setup_model(self): """Load/create/download model for any task.""" if isinstance(self.model, torch.nn.Module): # if model is loaded beforehand. No setup needed return model, weights = self.model, None ckpt = None if str(model).endswith(".pt"): weights, ckpt = attempt_load_one_weight(model) cfg = ckpt["model"].yaml else: cfg = model self.model = self.get_model(cfg=cfg, weights=weights, verbose=RANK == -1) # calls Model(cfg, weights) return ckpt def optimizer_step(self): """Perform a single step of the training optimizer with gradient clipping and EMA update.""" self.scaler.unscale_(self.optimizer) # unscale gradients torch.nn.utils.clip_grad_norm_(self.model.parameters(), max_norm=10.0) # clip gradients self.scaler.step(self.optimizer) self.scaler.update() self.optimizer.zero_grad() if self.ema: self.ema.update(self.model) def preprocess_batch(self, batch): """Allows custom preprocessing model inputs and ground truths depending on task type.""" return batch def validate(self): """ Runs validation on test set using self.validator. The returned dict is expected to contain "fitness" key. """ metrics = self.validator(self) fitness = metrics.pop("fitness", -self.loss.detach().cpu().numpy()) # use loss as fitness measure if not found # print(metrics) if not self.best_fitness or self.best_fitness < fitness: self.best_fitness = fitness return metrics, fitness def get_model(self, cfg=None, weights=None, verbose=True): """Get model and raise NotImplementedError for loading cfg files.""" raise NotImplementedError("This task trainer doesn't support loading cfg files") def get_validator(self): """Returns a NotImplementedError when the get_validator function is called.""" raise NotImplementedError("get_validator function not implemented in trainer") def get_dataloader(self, dataset_path, batch_size=16, rank=0, mode="train"): """Returns dataloader derived from torch.data.Dataloader.""" raise NotImplementedError("get_dataloader function not implemented in trainer") def build_dataset(self, img_path, mode="train", batch=None): """Build dataset.""" raise NotImplementedError("build_dataset function not implemented in trainer") def label_loss_items(self, loss_items=None, prefix="train"): """ Returns a loss dict with labelled training loss items tensor. Note: This is not needed for classification but necessary for segmentation & detection """ return {"loss": loss_items} if loss_items is not None else ["loss"] def set_model_attributes(self): """To set or update model parameters before training.""" self.model.names = self.data["names"] def build_targets(self, preds, targets): """Builds target tensors for training YOLO model.""" pass def progress_string(self): """Returns a string describing training progress.""" return "" # TODO: may need to put these following functions into callback def plot_training_samples(self, batch, ni): """Plots training samples during YOLO training.""" pass def plot_training_labels(self): """Plots training labels for YOLO model.""" pass def save_metrics(self, metrics): """Saves training metrics to a CSV file.""" keys, vals = list(metrics.keys()), list(metrics.values()) n = len(metrics) + 1 # number of cols s = "" if self.csv.exists() else (("%23s," * n % tuple(["epoch"] + keys)).rstrip(",") + "\n") # header with open(self.csv, "a") as f: f.write(s + ("%23.5g," * n % tuple([self.epoch + 1] + vals)).rstrip(",") + "\n") def plot_metrics(self): """Plot and display metrics visually.""" pass def on_plot(self, name, data=None): """Registers plots (e.g. to be consumed in callbacks)""" path = Path(name) self.plots[path] = {"data": data, "timestamp": time.time()} def final_eval(self): """Performs final evaluation and validation for object detection YOLO model.""" for f in self.last, self.best: if f.exists(): strip_optimizer(f) # strip optimizers if f is self.best: LOGGER.info(f"\nValidating {f}...") self.validator.args.plots = self.args.plots self.metrics = self.validator(model=f) self.metrics.pop("fitness", None) self.run_callbacks("on_fit_epoch_end") def check_resume(self, overrides): """Check if resume checkpoint exists and update arguments accordingly.""" resume = self.args.resume if resume: try: exists = isinstance(resume, (str, Path)) and Path(resume).exists() last = Path(check_file(resume) if exists else get_latest_run()) # Check that resume data YAML exists, otherwise strip to force re-download of dataset ckpt_args = attempt_load_weights(last).args if not Path(ckpt_args["data"]).exists(): ckpt_args["data"] = self.args.data resume = True self.args = get_cfg(ckpt_args) self.args.model = str(last) # reinstate model for k in "imgsz", "batch": # allow arg updates to reduce memory on resume if crashed due to CUDA OOM if k in overrides: setattr(self.args, k, overrides[k]) except Exception as e: raise FileNotFoundError( "Resume checkpoint not found. Please pass a valid checkpoint to resume from, " "i.e. 'yolo train resume model=path/to/last.pt'" ) from e self.resume = resume def resume_training(self, ckpt): """Resume YOLO training from given epoch and best fitness.""" if ckpt is None: return best_fitness = 0.0 start_epoch = ckpt["epoch"] + 1 if ckpt["optimizer"] is not None: self.optimizer.load_state_dict(ckpt["optimizer"]) # optimizer best_fitness = ckpt["best_fitness"] if self.ema and ckpt.get("ema"): self.ema.ema.load_state_dict(ckpt["ema"].float().state_dict()) # EMA self.ema.updates = ckpt["updates"] if self.resume: assert start_epoch > 0, ( f"{self.args.model} training to {self.epochs} epochs is finished, nothing to resume.\n" f"Start a new training without resuming, i.e. 'yolo train model={self.args.model}'" ) LOGGER.info( f"Resuming training from {self.args.model} from epoch {start_epoch + 1} to {self.epochs} total epochs" ) if self.epochs < start_epoch: LOGGER.info( f"{self.model} has been trained for {ckpt['epoch']} epochs. Fine-tuning for {self.epochs} more epochs." ) self.epochs += ckpt["epoch"] # finetune additional epochs self.best_fitness = best_fitness self.start_epoch = start_epoch if start_epoch > (self.epochs - self.args.close_mosaic): self._close_dataloader_mosaic() def _close_dataloader_mosaic(self): """Update dataloaders to stop using mosaic augmentation.""" if hasattr(self.train_loader.dataset, "mosaic"): self.train_loader.dataset.mosaic = False if hasattr(self.train_loader.dataset, "close_mosaic"): LOGGER.info("Closing dataloader mosaic") self.train_loader.dataset.close_mosaic(hyp=self.args) def build_optimizer(self, model, name="auto", lr=0.001, momentum=0.9, decay=1e-5, iterations=1e5): """ Constructs an optimizer for the given model, based on the specified optimizer name, learning rate, momentum, weight decay, and number of iterations. Args: model (torch.nn.Module): The model for which to build an optimizer. name (str, optional): The name of the optimizer to use. If 'auto', the optimizer is selected based on the number of iterations. Default: 'auto'. lr (float, optional): The learning rate for the optimizer. Default: 0.001. momentum (float, optional): The momentum factor for the optimizer. Default: 0.9. decay (float, optional): The weight decay for the optimizer. Default: 1e-5. iterations (float, optional): The number of iterations, which determines the optimizer if name is 'auto'. Default: 1e5. Returns: (torch.optim.Optimizer): The constructed optimizer. """ g = [], [], [] # optimizer parameter groups bn = tuple(v for k, v in nn.__dict__.items() if "Norm" in k) # normalization layers, i.e. BatchNorm2d() if name == "auto": LOGGER.info( f"{colorstr('optimizer:')} 'optimizer=auto' found, " f"ignoring 'lr0={self.args.lr0}' and 'momentum={self.args.momentum}' and " f"determining best 'optimizer', 'lr0' and 'momentum' automatically... " ) nc = getattr(model, "nc", 10) # number of classes lr_fit = round(0.002 * 5 / (4 + nc), 6) # lr0 fit equation to 6 decimal places name, lr, momentum = ("SGD", 0.01, 0.9) if iterations > 10000 else ("AdamW", lr_fit, 0.9) self.args.warmup_bias_lr = 0.0 # no higher than 0.01 for Adam for module_name, module in model.named_modules(): for param_name, param in module.named_parameters(recurse=False): fullname = f"{module_name}.{param_name}" if module_name else param_name if "bias" in fullname: # bias (no decay) g[2].append(param) elif isinstance(module, bn): # weight (no decay) g[1].append(param) else: # weight (with decay) g[0].append(param) if name in ("Adam", "Adamax", "AdamW", "NAdam", "RAdam"): optimizer = getattr(optim, name, optim.Adam)(g[2], lr=lr, betas=(momentum, 0.999), weight_decay=0.0) elif name == "RMSProp": optimizer = optim.RMSprop(g[2], lr=lr, momentum=momentum) elif name == "SGD": optimizer = optim.SGD(g[2], lr=lr, momentum=momentum, nesterov=True) else: raise NotImplementedError( f"Optimizer '{name}' not found in list of available optimizers " f"[Adam, AdamW, NAdam, RAdam, RMSProp, SGD, auto]." "To request support for addition optimizers please visit https://github.com/ultralytics/ultralytics." ) optimizer.add_param_group({"params": g[0], "weight_decay": decay}) # add g0 with weight_decay optimizer.add_param_group({"params": g[1], "weight_decay": 0.0}) # add g1 (BatchNorm2d weights) LOGGER.info( f"{colorstr('optimizer:')} {type(optimizer).__name__}(lr={lr}, momentum={momentum}) with parameter groups " f'{len(g[1])} weight(decay=0.0), {len(g[0])} weight(decay={decay}), {len(g[2])} bias(decay=0.0)' ) return optimizer
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/engine/trainer.py
Python
unknown
34,680
# Ultralytics YOLO 🚀, AGPL-3.0 license """ This module provides functionalities for hyperparameter tuning of the Ultralytics YOLO models for object detection, instance segmentation, image classification, pose estimation, and multi-object tracking. Hyperparameter tuning is the process of systematically searching for the optimal set of hyperparameters that yield the best model performance. This is particularly crucial in deep learning models like YOLO, where small changes in hyperparameters can lead to significant differences in model accuracy and efficiency. Example: Tune hyperparameters for YOLOv8n on COCO8 at imgsz=640 and epochs=30 for 300 tuning iterations. ```python from ultralytics import YOLO model = YOLO('yolov8n.pt') model.tune(data='coco8.yaml', epochs=10, iterations=300, optimizer='AdamW', plots=False, save=False, val=False) ``` """ import random import shutil import subprocess import time import numpy as np import torch from ultralytics.cfg import get_cfg, get_save_dir from ultralytics.utils import DEFAULT_CFG, LOGGER, callbacks, colorstr, remove_colorstr, yaml_print, yaml_save from ultralytics.utils.plotting import plot_tune_results class Tuner: """ Class responsible for hyperparameter tuning of YOLO models. The class evolves YOLO model hyperparameters over a given number of iterations by mutating them according to the search space and retraining the model to evaluate their performance. Attributes: space (dict): Hyperparameter search space containing bounds and scaling factors for mutation. tune_dir (Path): Directory where evolution logs and results will be saved. tune_csv (Path): Path to the CSV file where evolution logs are saved. Methods: _mutate(hyp: dict) -> dict: Mutates the given hyperparameters within the bounds specified in `self.space`. __call__(): Executes the hyperparameter evolution across multiple iterations. Example: Tune hyperparameters for YOLOv8n on COCO8 at imgsz=640 and epochs=30 for 300 tuning iterations. ```python from ultralytics import YOLO model = YOLO('yolov8n.pt') model.tune(data='coco8.yaml', epochs=10, iterations=300, optimizer='AdamW', plots=False, save=False, val=False) ``` Tune with custom search space. ```python from ultralytics import YOLO model = YOLO('yolov8n.pt') model.tune(space={key1: val1, key2: val2}) # custom search space dictionary ``` """ def __init__(self, args=DEFAULT_CFG, _callbacks=None): """ Initialize the Tuner with configurations. Args: args (dict, optional): Configuration for hyperparameter evolution. """ self.space = args.pop("space", None) or { # key: (min, max, gain(optional)) # 'optimizer': tune.choice(['SGD', 'Adam', 'AdamW', 'NAdam', 'RAdam', 'RMSProp']), "lr0": (1e-5, 1e-1), # initial learning rate (i.e. SGD=1E-2, Adam=1E-3) "lrf": (0.0001, 0.1), # final OneCycleLR learning rate (lr0 * lrf) "momentum": (0.7, 0.98, 0.3), # SGD momentum/Adam beta1 "weight_decay": (0.0, 0.001), # optimizer weight decay 5e-4 "warmup_epochs": (0.0, 5.0), # warmup epochs (fractions ok) "warmup_momentum": (0.0, 0.95), # warmup initial momentum "box": (1.0, 20.0), # box loss gain "cls": (0.2, 4.0), # cls loss gain (scale with pixels) "dfl": (0.4, 6.0), # dfl loss gain "hsv_h": (0.0, 0.1), # image HSV-Hue augmentation (fraction) "hsv_s": (0.0, 0.9), # image HSV-Saturation augmentation (fraction) "hsv_v": (0.0, 0.9), # image HSV-Value augmentation (fraction) "degrees": (0.0, 45.0), # image rotation (+/- deg) "translate": (0.0, 0.9), # image translation (+/- fraction) "scale": (0.0, 0.95), # image scale (+/- gain) "shear": (0.0, 10.0), # image shear (+/- deg) "perspective": (0.0, 0.001), # image perspective (+/- fraction), range 0-0.001 "flipud": (0.0, 1.0), # image flip up-down (probability) "fliplr": (0.0, 1.0), # image flip left-right (probability) "mosaic": (0.0, 1.0), # image mixup (probability) "mixup": (0.0, 1.0), # image mixup (probability) "copy_paste": (0.0, 1.0), # segment copy-paste (probability) } self.args = get_cfg(overrides=args) self.tune_dir = get_save_dir(self.args, name="tune") self.tune_csv = self.tune_dir / "tune_results.csv" self.callbacks = _callbacks or callbacks.get_default_callbacks() self.prefix = colorstr("Tuner: ") callbacks.add_integration_callbacks(self) LOGGER.info( f"{self.prefix}Initialized Tuner instance with 'tune_dir={self.tune_dir}'\n" f"{self.prefix}💡 Learn about tuning at https://docs.ultralytics.com/guides/hyperparameter-tuning" ) def _mutate(self, parent="single", n=5, mutation=0.8, sigma=0.2): """ Mutates the hyperparameters based on bounds and scaling factors specified in `self.space`. Args: parent (str): Parent selection method: 'single' or 'weighted'. n (int): Number of parents to consider. mutation (float): Probability of a parameter mutation in any given iteration. sigma (float): Standard deviation for Gaussian random number generator. Returns: (dict): A dictionary containing mutated hyperparameters. """ if self.tune_csv.exists(): # if CSV file exists: select best hyps and mutate # Select parent(s) x = np.loadtxt(self.tune_csv, ndmin=2, delimiter=",", skiprows=1) fitness = x[:, 0] # first column n = min(n, len(x)) # number of previous results to consider x = x[np.argsort(-fitness)][:n] # top n mutations w = x[:, 0] - x[:, 0].min() + 1e-6 # weights (sum > 0) if parent == "single" or len(x) == 1: # x = x[random.randint(0, n - 1)] # random selection x = x[random.choices(range(n), weights=w)[0]] # weighted selection elif parent == "weighted": x = (x * w.reshape(n, 1)).sum(0) / w.sum() # weighted combination # Mutate r = np.random # method r.seed(int(time.time())) g = np.array([v[2] if len(v) == 3 else 1.0 for k, v in self.space.items()]) # gains 0-1 ng = len(self.space) v = np.ones(ng) while all(v == 1): # mutate until a change occurs (prevent duplicates) v = (g * (r.random(ng) < mutation) * r.randn(ng) * r.random() * sigma + 1).clip(0.3, 3.0) hyp = {k: float(x[i + 1] * v[i]) for i, k in enumerate(self.space.keys())} else: hyp = {k: getattr(self.args, k) for k in self.space.keys()} # Constrain to limits for k, v in self.space.items(): hyp[k] = max(hyp[k], v[0]) # lower limit hyp[k] = min(hyp[k], v[1]) # upper limit hyp[k] = round(hyp[k], 5) # significant digits return hyp def __call__(self, model=None, iterations=10, cleanup=True): """ Executes the hyperparameter evolution process when the Tuner instance is called. This method iterates through the number of iterations, performing the following steps in each iteration: 1. Load the existing hyperparameters or initialize new ones. 2. Mutate the hyperparameters using the `mutate` method. 3. Train a YOLO model with the mutated hyperparameters. 4. Log the fitness score and mutated hyperparameters to a CSV file. Args: model (Model): A pre-initialized YOLO model to be used for training. iterations (int): The number of generations to run the evolution for. cleanup (bool): Whether to delete iteration weights to reduce storage space used during tuning. Note: The method utilizes the `self.tune_csv` Path object to read and log hyperparameters and fitness scores. Ensure this path is set correctly in the Tuner instance. """ t0 = time.time() best_save_dir, best_metrics = None, None (self.tune_dir / "weights").mkdir(parents=True, exist_ok=True) for i in range(iterations): # Mutate hyperparameters mutated_hyp = self._mutate() LOGGER.info(f"{self.prefix}Starting iteration {i + 1}/{iterations} with hyperparameters: {mutated_hyp}") metrics = {} train_args = {**vars(self.args), **mutated_hyp} save_dir = get_save_dir(get_cfg(train_args)) weights_dir = save_dir / "weights" ckpt_file = weights_dir / ("best.pt" if (weights_dir / "best.pt").exists() else "last.pt") try: # Train YOLO model with mutated hyperparameters (run in subprocess to avoid dataloader hang) cmd = ["yolo", "train", *(f"{k}={v}" for k, v in train_args.items())] return_code = subprocess.run(cmd, check=True).returncode metrics = torch.load(ckpt_file)["train_metrics"] assert return_code == 0, "training failed" except Exception as e: LOGGER.warning(f"WARNING ❌️ training failure for hyperparameter tuning iteration {i + 1}\n{e}") # Save results and mutated_hyp to CSV fitness = metrics.get("fitness", 0.0) log_row = [round(fitness, 5)] + [mutated_hyp[k] for k in self.space.keys()] headers = "" if self.tune_csv.exists() else (",".join(["fitness"] + list(self.space.keys())) + "\n") with open(self.tune_csv, "a") as f: f.write(headers + ",".join(map(str, log_row)) + "\n") # Get best results x = np.loadtxt(self.tune_csv, ndmin=2, delimiter=",", skiprows=1) fitness = x[:, 0] # first column best_idx = fitness.argmax() best_is_current = best_idx == i if best_is_current: best_save_dir = save_dir best_metrics = {k: round(v, 5) for k, v in metrics.items()} for ckpt in weights_dir.glob("*.pt"): shutil.copy2(ckpt, self.tune_dir / "weights") elif cleanup: shutil.rmtree(ckpt_file.parent) # remove iteration weights/ dir to reduce storage space # Plot tune results plot_tune_results(self.tune_csv) # Save and print tune results header = ( f'{self.prefix}{i + 1}/{iterations} iterations complete ✅ ({time.time() - t0:.2f}s)\n' f'{self.prefix}Results saved to {colorstr("bold", self.tune_dir)}\n' f'{self.prefix}Best fitness={fitness[best_idx]} observed at iteration {best_idx + 1}\n' f'{self.prefix}Best fitness metrics are {best_metrics}\n' f'{self.prefix}Best fitness model is {best_save_dir}\n' f'{self.prefix}Best fitness hyperparameters are printed below.\n' ) LOGGER.info("\n" + header) data = {k: float(x[best_idx, i + 1]) for i, k in enumerate(self.space.keys())} yaml_save( self.tune_dir / "best_hyperparameters.yaml", data=data, header=remove_colorstr(header.replace(self.prefix, "# ")) + "\n", ) yaml_print(self.tune_dir / "best_hyperparameters.yaml")
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/engine/tuner.py
Python
unknown
11,758
# Ultralytics YOLO 🚀, AGPL-3.0 license """ Check a model's accuracy on a test or val split of a dataset. Usage: $ yolo mode=val model=yolov8n.pt data=coco128.yaml imgsz=640 Usage - formats: $ yolo mode=val model=yolov8n.pt # PyTorch yolov8n.torchscript # TorchScript yolov8n.onnx # ONNX Runtime or OpenCV DNN with dnn=True yolov8n_openvino_model # OpenVINO yolov8n.engine # TensorRT yolov8n.mlpackage # CoreML (macOS-only) yolov8n_saved_model # TensorFlow SavedModel yolov8n.pb # TensorFlow GraphDef yolov8n.tflite # TensorFlow Lite yolov8n_edgetpu.tflite # TensorFlow Edge TPU yolov8n_paddle_model # PaddlePaddle """ import json import time from pathlib import Path import numpy as np import torch from ultralytics.cfg import get_cfg, get_save_dir from ultralytics.data.utils import check_cls_dataset, check_det_dataset from ultralytics.nn.autobackend import AutoBackend from ultralytics.utils import LOGGER, TQDM, callbacks, colorstr, emojis from ultralytics.utils.checks import check_imgsz from ultralytics.utils.ops import Profile from ultralytics.utils.torch_utils import de_parallel, select_device, smart_inference_mode class BaseValidator: """ BaseValidator. A base class for creating validators. Attributes: args (SimpleNamespace): Configuration for the validator. dataloader (DataLoader): Dataloader to use for validation. pbar (tqdm): Progress bar to update during validation. model (nn.Module): Model to validate. data (dict): Data dictionary. device (torch.device): Device to use for validation. batch_i (int): Current batch index. training (bool): Whether the model is in training mode. names (dict): Class names. seen: Records the number of images seen so far during validation. stats: Placeholder for statistics during validation. confusion_matrix: Placeholder for a confusion matrix. nc: Number of classes. iouv: (torch.Tensor): IoU thresholds from 0.50 to 0.95 in spaces of 0.05. jdict (dict): Dictionary to store JSON validation results. speed (dict): Dictionary with keys 'preprocess', 'inference', 'loss', 'postprocess' and their respective batch processing times in milliseconds. save_dir (Path): Directory to save results. plots (dict): Dictionary to store plots for visualization. callbacks (dict): Dictionary to store various callback functions. """ def __init__(self, dataloader=None, save_dir=None, pbar=None, args=None, _callbacks=None): """ Initializes a BaseValidator instance. Args: dataloader (torch.utils.data.DataLoader): Dataloader to be used for validation. save_dir (Path, optional): Directory to save results. pbar (tqdm.tqdm): Progress bar for displaying progress. args (SimpleNamespace): Configuration for the validator. _callbacks (dict): Dictionary to store various callback functions. """ self.args = get_cfg(overrides=args) self.dataloader = dataloader self.pbar = pbar self.stride = None self.data = None self.device = None self.batch_i = None self.training = True self.names = None self.seen = None self.stats = None self.confusion_matrix = None self.nc = None self.iouv = None self.jdict = None self.speed = {"preprocess": 0.0, "inference": 0.0, "loss": 0.0, "postprocess": 0.0} self.save_dir = save_dir or get_save_dir(self.args) (self.save_dir / "labels" if self.args.save_txt else self.save_dir).mkdir(parents=True, exist_ok=True) if self.args.conf is None: self.args.conf = 0.001 # default conf=0.001 self.args.imgsz = check_imgsz(self.args.imgsz, max_dim=1) self.plots = {} self.callbacks = _callbacks or callbacks.get_default_callbacks() @smart_inference_mode() def __call__(self, trainer=None, model=None): """Supports validation of a pre-trained model if passed or a model being trained if trainer is passed (trainer gets priority). """ self.training = trainer is not None augment = self.args.augment and (not self.training) if self.training: self.device = trainer.device self.data = trainer.data self.args.half = self.device.type != "cpu" # force FP16 val during training model = trainer.ema.ema or trainer.model model = model.half() if self.args.half else model.float() # self.model = model self.loss = torch.zeros_like(trainer.loss_items, device=trainer.device) self.args.plots &= trainer.stopper.possible_stop or (trainer.epoch == trainer.epochs - 1) model.eval() else: callbacks.add_integration_callbacks(self) model = AutoBackend( model or self.args.model, device=select_device(self.args.device, self.args.batch), dnn=self.args.dnn, data=self.args.data, fp16=self.args.half, ) # self.model = model self.device = model.device # update device self.args.half = model.fp16 # update half stride, pt, jit, engine = model.stride, model.pt, model.jit, model.engine imgsz = check_imgsz(self.args.imgsz, stride=stride) if engine: self.args.batch = model.batch_size elif not pt and not jit: self.args.batch = 1 # export.py models default to batch-size 1 LOGGER.info(f"Forcing batch=1 square inference (1,3,{imgsz},{imgsz}) for non-PyTorch models") if str(self.args.data).split(".")[-1] in ("yaml", "yml"): self.data = check_det_dataset(self.args.data) elif self.args.task == "classify": self.data = check_cls_dataset(self.args.data, split=self.args.split) else: raise FileNotFoundError(emojis(f"Dataset '{self.args.data}' for task={self.args.task} not found ❌")) if self.device.type in ("cpu", "mps"): self.args.workers = 0 # faster CPU val as time dominated by inference, not dataloading if not pt: self.args.rect = False self.stride = model.stride # used in get_dataloader() for padding self.dataloader = self.dataloader or self.get_dataloader(self.data.get(self.args.split), self.args.batch) model.eval() model.warmup(imgsz=(1 if pt else self.args.batch, 3, imgsz, imgsz)) # warmup self.run_callbacks("on_val_start") dt = ( Profile(device=self.device), Profile(device=self.device), Profile(device=self.device), Profile(device=self.device), ) bar = TQDM(self.dataloader, desc=self.get_desc(), total=len(self.dataloader)) self.init_metrics(de_parallel(model)) self.jdict = [] # empty before each val for batch_i, batch in enumerate(bar): self.run_callbacks("on_val_batch_start") self.batch_i = batch_i # Preprocess with dt[0]: batch = self.preprocess(batch) # Inference with dt[1]: preds = model(batch["img"], augment=augment) # Loss with dt[2]: if self.training: self.loss += model.loss(batch, preds)[1] # Postprocess with dt[3]: preds = self.postprocess(preds) self.update_metrics(preds, batch) if self.args.plots and batch_i < 3: self.plot_val_samples(batch, batch_i) self.plot_predictions(batch, preds, batch_i) self.run_callbacks("on_val_batch_end") stats = self.get_stats() self.check_stats(stats) self.speed = dict(zip(self.speed.keys(), (x.t / len(self.dataloader.dataset) * 1e3 for x in dt))) self.finalize_metrics() self.print_results() self.run_callbacks("on_val_end") if self.training: model.float() results = {**stats, **trainer.label_loss_items(self.loss.cpu() / len(self.dataloader), prefix="val")} return {k: round(float(v), 5) for k, v in results.items()} # return results as 5 decimal place floats else: LOGGER.info( "Speed: %.1fms preprocess, %.1fms inference, %.1fms loss, %.1fms postprocess per image" % tuple(self.speed.values()) ) if self.args.save_json and self.jdict: with open(str(self.save_dir / "predictions.json"), "w") as f: LOGGER.info(f"Saving {f.name}...") json.dump(self.jdict, f) # flatten and save stats = self.eval_json(stats) # update stats if self.args.plots or self.args.save_json: LOGGER.info(f"Results saved to {colorstr('bold', self.save_dir)}") return stats def match_predictions(self, pred_classes, true_classes, iou, use_scipy=False): """ Matches predictions to ground truth objects (pred_classes, true_classes) using IoU. Args: pred_classes (torch.Tensor): Predicted class indices of shape(N,). true_classes (torch.Tensor): Target class indices of shape(M,). iou (torch.Tensor): An NxM tensor containing the pairwise IoU values for predictions and ground of truth use_scipy (bool): Whether to use scipy for matching (more precise). Returns: (torch.Tensor): Correct tensor of shape(N,10) for 10 IoU thresholds. """ # Dx10 matrix, where D - detections, 10 - IoU thresholds correct = np.zeros((pred_classes.shape[0], self.iouv.shape[0])).astype(bool) # LxD matrix where L - labels (rows), D - detections (columns) correct_class = true_classes[:, None] == pred_classes iou = iou * correct_class # zero out the wrong classes iou = iou.cpu().numpy() for i, threshold in enumerate(self.iouv.cpu().tolist()): if use_scipy: # WARNING: known issue that reduces mAP in https://github.com/ultralytics/ultralytics/pull/4708 import scipy # scope import to avoid importing for all commands cost_matrix = iou * (iou >= threshold) if cost_matrix.any(): labels_idx, detections_idx = scipy.optimize.linear_sum_assignment(cost_matrix, maximize=True) valid = cost_matrix[labels_idx, detections_idx] > 0 if valid.any(): correct[detections_idx[valid], i] = True else: matches = np.nonzero(iou >= threshold) # IoU > threshold and classes match matches = np.array(matches).T if matches.shape[0]: if matches.shape[0] > 1: matches = matches[iou[matches[:, 0], matches[:, 1]].argsort()[::-1]] matches = matches[np.unique(matches[:, 1], return_index=True)[1]] # matches = matches[matches[:, 2].argsort()[::-1]] matches = matches[np.unique(matches[:, 0], return_index=True)[1]] correct[matches[:, 1].astype(int), i] = True return torch.tensor(correct, dtype=torch.bool, device=pred_classes.device) def add_callback(self, event: str, callback): """Appends the given callback.""" self.callbacks[event].append(callback) def run_callbacks(self, event: str): """Runs all callbacks associated with a specified event.""" for callback in self.callbacks.get(event, []): callback(self) def get_dataloader(self, dataset_path, batch_size): """Get data loader from dataset path and batch size.""" raise NotImplementedError("get_dataloader function not implemented for this validator") def build_dataset(self, img_path): """Build dataset.""" raise NotImplementedError("build_dataset function not implemented in validator") def preprocess(self, batch): """Preprocesses an input batch.""" return batch def postprocess(self, preds): """Describes and summarizes the purpose of 'postprocess()' but no details mentioned.""" return preds def init_metrics(self, model): """Initialize performance metrics for the YOLO model.""" pass def update_metrics(self, preds, batch): """Updates metrics based on predictions and batch.""" pass def finalize_metrics(self, *args, **kwargs): """Finalizes and returns all metrics.""" pass def get_stats(self): """Returns statistics about the model's performance.""" return {} def check_stats(self, stats): """Checks statistics.""" pass def print_results(self): """Prints the results of the model's predictions.""" pass def get_desc(self): """Get description of the YOLO model.""" pass @property def metric_keys(self): """Returns the metric keys used in YOLO training/validation.""" return [] def on_plot(self, name, data=None): """Registers plots (e.g. to be consumed in callbacks)""" self.plots[Path(name)] = {"data": data, "timestamp": time.time()} # TODO: may need to put these following functions into callback def plot_val_samples(self, batch, ni): """Plots validation samples during training.""" pass def plot_predictions(self, batch, preds, ni): """Plots YOLO model predictions on batch images.""" pass def pred_to_json(self, preds, batch): """Convert predictions to JSON format.""" pass def eval_json(self, stats): """Evaluate and return JSON format of prediction statistics.""" pass
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/engine/validator.py
Python
unknown
14,576
# Ultralytics YOLO 🚀, AGPL-3.0 license import requests from ultralytics.data.utils import HUBDatasetStats from ultralytics.hub.auth import Auth from ultralytics.hub.utils import HUB_API_ROOT, HUB_WEB_ROOT, PREFIX from ultralytics.utils import LOGGER, SETTINGS, checks def login(api_key: str = None, save=True) -> bool: """ Log in to the Ultralytics HUB API using the provided API key. The session is not stored; a new session is created when needed using the saved SETTINGS or the HUB_API_KEY environment variable if successfully authenticated. Args: api_key (str, optional): API key to use for authentication. If not provided, it will be retrieved from SETTINGS or HUB_API_KEY environment variable. save (bool, optional): Whether to save the API key to SETTINGS if authentication is successful. Returns: (bool): True if authentication is successful, False otherwise. """ checks.check_requirements("hub-sdk>=0.0.2") from hub_sdk import HUBClient api_key_url = f"{HUB_WEB_ROOT}/settings?tab=api+keys" # set the redirect URL saved_key = SETTINGS.get("api_key") active_key = api_key or saved_key credentials = {"api_key": active_key} if active_key and active_key != "" else None # set credentials client = HUBClient(credentials) # initialize HUBClient if client.authenticated: # Successfully authenticated with HUB if save and client.api_key != saved_key: SETTINGS.update({"api_key": client.api_key}) # update settings with valid API key # Set message based on whether key was provided or retrieved from settings log_message = ( "New authentication successful ✅" if client.api_key == api_key or not credentials else "Authenticated ✅" ) LOGGER.info(f"{PREFIX}{log_message}") return True else: # Failed to authenticate with HUB LOGGER.info(f"{PREFIX}Retrieve API key from {api_key_url}") return False def logout(): """ Log out of Ultralytics HUB by removing the API key from the settings file. To log in again, use 'yolo hub login'. Example: ```python from ultralytics import hub hub.logout() ``` """ SETTINGS["api_key"] = "" SETTINGS.save() LOGGER.info(f"{PREFIX}logged out ✅. To log in again, use 'yolo hub login'.") def reset_model(model_id=""): """Reset a trained model to an untrained state.""" r = requests.post(f"{HUB_API_ROOT}/model-reset", json={"modelId": model_id}, headers={"x-api-key": Auth().api_key}) if r.status_code == 200: LOGGER.info(f"{PREFIX}Model reset successfully") return LOGGER.warning(f"{PREFIX}Model reset failure {r.status_code} {r.reason}") def export_fmts_hub(): """Returns a list of HUB-supported export formats.""" from ultralytics.engine.exporter import export_formats return list(export_formats()["Argument"][1:]) + ["ultralytics_tflite", "ultralytics_coreml"] def export_model(model_id="", format="torchscript"): """Export a model to all formats.""" assert format in export_fmts_hub(), f"Unsupported export format '{format}', valid formats are {export_fmts_hub()}" r = requests.post( f"{HUB_API_ROOT}/v1/models/{model_id}/export", json={"format": format}, headers={"x-api-key": Auth().api_key} ) assert r.status_code == 200, f"{PREFIX}{format} export failure {r.status_code} {r.reason}" LOGGER.info(f"{PREFIX}{format} export started ✅") def get_export(model_id="", format="torchscript"): """Get an exported model dictionary with download URL.""" assert format in export_fmts_hub(), f"Unsupported export format '{format}', valid formats are {export_fmts_hub()}" r = requests.post( f"{HUB_API_ROOT}/get-export", json={"apiKey": Auth().api_key, "modelId": model_id, "format": format}, headers={"x-api-key": Auth().api_key}, ) assert r.status_code == 200, f"{PREFIX}{format} get_export failure {r.status_code} {r.reason}" return r.json() def check_dataset(path="", task="detect"): """ Function for error-checking HUB dataset Zip file before upload. It checks a dataset for errors before it is uploaded to the HUB. Usage examples are given below. Args: path (str, optional): Path to data.zip (with data.yaml inside data.zip). Defaults to ''. task (str, optional): Dataset task. Options are 'detect', 'segment', 'pose', 'classify'. Defaults to 'detect'. Example: ```python from ultralytics.hub import check_dataset check_dataset('path/to/coco8.zip', task='detect') # detect dataset check_dataset('path/to/coco8-seg.zip', task='segment') # segment dataset check_dataset('path/to/coco8-pose.zip', task='pose') # pose dataset ``` """ HUBDatasetStats(path=path, task=task).get_json() LOGGER.info(f"Checks completed correctly ✅. Upload this dataset to {HUB_WEB_ROOT}/datasets/.")
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/hub/__init__.py
Python
unknown
5,035
# Ultralytics YOLO 🚀, AGPL-3.0 license import requests from ultralytics.hub.utils import HUB_API_ROOT, HUB_WEB_ROOT, PREFIX, request_with_credentials from ultralytics.utils import LOGGER, SETTINGS, emojis, is_colab API_KEY_URL = f"{HUB_WEB_ROOT}/settings?tab=api+keys" class Auth: """ Manages authentication processes including API key handling, cookie-based authentication, and header generation. The class supports different methods of authentication: 1. Directly using an API key. 2. Authenticating using browser cookies (specifically in Google Colab). 3. Prompting the user to enter an API key. Attributes: id_token (str or bool): Token used for identity verification, initialized as False. api_key (str or bool): API key for authentication, initialized as False. model_key (bool): Placeholder for model key, initialized as False. """ id_token = api_key = model_key = False def __init__(self, api_key="", verbose=False): """ Initialize the Auth class with an optional API key. Args: api_key (str, optional): May be an API key or a combination API key and model ID, i.e. key_id """ # Split the input API key in case it contains a combined key_model and keep only the API key part api_key = api_key.split("_")[0] # Set API key attribute as value passed or SETTINGS API key if none passed self.api_key = api_key or SETTINGS.get("api_key", "") # If an API key is provided if self.api_key: # If the provided API key matches the API key in the SETTINGS if self.api_key == SETTINGS.get("api_key"): # Log that the user is already logged in if verbose: LOGGER.info(f"{PREFIX}Authenticated ✅") return else: # Attempt to authenticate with the provided API key success = self.authenticate() # If the API key is not provided and the environment is a Google Colab notebook elif is_colab(): # Attempt to authenticate using browser cookies success = self.auth_with_cookies() else: # Request an API key success = self.request_api_key() # Update SETTINGS with the new API key after successful authentication if success: SETTINGS.update({"api_key": self.api_key}) # Log that the new login was successful if verbose: LOGGER.info(f"{PREFIX}New authentication successful ✅") elif verbose: LOGGER.info(f"{PREFIX}Retrieve API key from {API_KEY_URL}") def request_api_key(self, max_attempts=3): """ Prompt the user to input their API key. Returns the model ID. """ import getpass for attempts in range(max_attempts): LOGGER.info(f"{PREFIX}Login. Attempt {attempts + 1} of {max_attempts}") input_key = getpass.getpass(f"Enter API key from {API_KEY_URL} ") self.api_key = input_key.split("_")[0] # remove model id if present if self.authenticate(): return True raise ConnectionError(emojis(f"{PREFIX}Failed to authenticate ❌")) def authenticate(self) -> bool: """ Attempt to authenticate with the server using either id_token or API key. Returns: (bool): True if authentication is successful, False otherwise. """ try: if header := self.get_auth_header(): r = requests.post(f"{HUB_API_ROOT}/v1/auth", headers=header) if not r.json().get("success", False): raise ConnectionError("Unable to authenticate.") return True raise ConnectionError("User has not authenticated locally.") except ConnectionError: self.id_token = self.api_key = False # reset invalid LOGGER.warning(f"{PREFIX}Invalid API key ⚠️") return False def auth_with_cookies(self) -> bool: """ Attempt to fetch authentication via cookies and set id_token. User must be logged in to HUB and running in a supported browser. Returns: (bool): True if authentication is successful, False otherwise. """ if not is_colab(): return False # Currently only works with Colab try: authn = request_with_credentials(f"{HUB_API_ROOT}/v1/auth/auto") if authn.get("success", False): self.id_token = authn.get("data", {}).get("idToken", None) self.authenticate() return True raise ConnectionError("Unable to fetch browser authentication details.") except ConnectionError: self.id_token = False # reset invalid return False def get_auth_header(self): """ Get the authentication header for making API requests. Returns: (dict): The authentication header if id_token or API key is set, None otherwise. """ if self.id_token: return {"authorization": f"Bearer {self.id_token}"} elif self.api_key: return {"x-api-key": self.api_key} # else returns None
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/hub/auth.py
Python
unknown
5,370
# Ultralytics YOLO 🚀, AGPL-3.0 license import threading import time from http import HTTPStatus from pathlib import Path import requests from ultralytics.hub.utils import HUB_WEB_ROOT, HELP_MSG, PREFIX, TQDM from ultralytics.utils import LOGGER, SETTINGS, __version__, checks, emojis, is_colab from ultralytics.utils.errors import HUBModelError AGENT_NAME = f"python-{__version__}-colab" if is_colab() else f"python-{__version__}-local" class HUBTrainingSession: """ HUB training session for Ultralytics HUB YOLO models. Handles model initialization, heartbeats, and checkpointing. Attributes: agent_id (str): Identifier for the instance communicating with the server. model_id (str): Identifier for the YOLO model being trained. model_url (str): URL for the model in Ultralytics HUB. api_url (str): API URL for the model in Ultralytics HUB. auth_header (dict): Authentication header for the Ultralytics HUB API requests. rate_limits (dict): Rate limits for different API calls (in seconds). timers (dict): Timers for rate limiting. metrics_queue (dict): Queue for the model's metrics. model (dict): Model data fetched from Ultralytics HUB. alive (bool): Indicates if the heartbeat loop is active. """ def __init__(self, identifier): """ Initialize the HUBTrainingSession with the provided model identifier. Args: identifier (str): Model identifier used to initialize the HUB training session. It can be a URL string or a model key with specific format. Raises: ValueError: If the provided model identifier is invalid. ConnectionError: If connecting with global API key is not supported. ModuleNotFoundError: If hub-sdk package is not installed. """ from hub_sdk import HUBClient self.rate_limits = { "metrics": 3.0, "ckpt": 900.0, "heartbeat": 300.0, } # rate limits (seconds) self.metrics_queue = {} # holds metrics for each epoch until upload self.timers = {} # holds timers in ultralytics/utils/callbacks/hub.py # Parse input api_key, model_id, self.filename = self._parse_identifier(identifier) # Get credentials active_key = api_key or SETTINGS.get("api_key") credentials = {"api_key": active_key} if active_key else None # set credentials # Initialize client self.client = HUBClient(credentials) if model_id: self.load_model(model_id) # load existing model else: self.model = self.client.model() # load empty model def load_model(self, model_id): """Loads an existing model from Ultralytics HUB using the provided model identifier.""" self.model = self.client.model(model_id) if not self.model.data: # then model does not exist raise ValueError(emojis("❌ The specified HUB model does not exist")) # TODO: improve error handling self.model_url = f"{HUB_WEB_ROOT}/models/{self.model.id}" self._set_train_args() # Start heartbeats for HUB to monitor agent self.model.start_heartbeat(self.rate_limits["heartbeat"]) LOGGER.info(f"{PREFIX}View model at {self.model_url} 🚀") def create_model(self, model_args): """Initializes a HUB training session with the specified model identifier.""" payload = { "config": { "batchSize": model_args.get("batch", -1), "epochs": model_args.get("epochs", 300), "imageSize": model_args.get("imgsz", 640), "patience": model_args.get("patience", 100), "device": model_args.get("device", ""), "cache": model_args.get("cache", "ram"), }, "dataset": {"name": model_args.get("data")}, "lineage": { "architecture": { "name": self.filename.replace(".pt", "").replace(".yaml", ""), }, "parent": {}, }, "meta": {"name": self.filename}, } if self.filename.endswith(".pt"): payload["lineage"]["parent"]["name"] = self.filename self.model.create_model(payload) # Model could not be created # TODO: improve error handling if not self.model.id: return self.model_url = f"{HUB_WEB_ROOT}/models/{self.model.id}" # Start heartbeats for HUB to monitor agent self.model.start_heartbeat(self.rate_limits["heartbeat"]) LOGGER.info(f"{PREFIX}View model at {self.model_url} 🚀") def _parse_identifier(self, identifier): """ Parses the given identifier to determine the type of identifier and extract relevant components. The method supports different identifier formats: - A HUB URL, which starts with HUB_WEB_ROOT followed by '/models/' - An identifier containing an API key and a model ID separated by an underscore - An identifier that is solely a model ID of a fixed length - A local filename that ends with '.pt' or '.yaml' Args: identifier (str): The identifier string to be parsed. Returns: (tuple): A tuple containing the API key, model ID, and filename as applicable. Raises: HUBModelError: If the identifier format is not recognized. """ # Initialize variables api_key, model_id, filename = None, None, None # Check if identifier is a HUB URL if identifier.startswith(f"{HUB_WEB_ROOT}/models/"): # Extract the model_id after the HUB_WEB_ROOT URL model_id = identifier.split(f"{HUB_WEB_ROOT}/models/")[-1] else: # Split the identifier based on underscores only if it's not a HUB URL parts = identifier.split("_") # Check if identifier is in the format of API key and model ID if len(parts) == 2 and len(parts[0]) == 42 and len(parts[1]) == 20: api_key, model_id = parts # Check if identifier is a single model ID elif len(parts) == 1 and len(parts[0]) == 20: model_id = parts[0] # Check if identifier is a local filename elif identifier.endswith(".pt") or identifier.endswith(".yaml"): filename = identifier else: raise HUBModelError( f"model='{identifier}' could not be parsed. Check format is correct. " f"Supported formats are Ultralytics HUB URL, apiKey_modelId, modelId, local pt or yaml file." ) return api_key, model_id, filename def _set_train_args(self, **kwargs): """Initializes training arguments and creates a model entry on the Ultralytics HUB.""" if self.model.is_trained(): # Model is already trained raise ValueError(emojis(f"Model is already trained and uploaded to {self.model_url} 🚀")) if self.model.is_resumable(): # Model has saved weights self.train_args = {"data": self.model.get_dataset_url(), "resume": True} self.model_file = self.model.get_weights_url("last") else: # Model has no saved weights def get_train_args(config): """Parses an identifier to extract API key, model ID, and filename if applicable.""" return { "batch": config["batchSize"], "epochs": config["epochs"], "imgsz": config["imageSize"], "patience": config["patience"], "device": config["device"], "cache": config["cache"], "data": self.model.get_dataset_url(), } self.train_args = get_train_args(self.model.data.get("config")) # Set the model file as either a *.pt or *.yaml file self.model_file = ( self.model.get_weights_url("parent") if self.model.is_pretrained() else self.model.get_architecture() ) if not self.train_args.get("data"): raise ValueError("Dataset may still be processing. Please wait a minute and try again.") # RF fix self.model_file = checks.check_yolov5u_filename(self.model_file, verbose=False) # YOLOv5->YOLOv5u self.model_id = self.model.id def request_queue( self, request_func, retry=3, timeout=30, thread=True, verbose=True, progress_total=None, *args, **kwargs, ): def retry_request(): """Attempts to call `request_func` with retries, timeout, and optional threading.""" t0 = time.time() # Record the start time for the timeout for i in range(retry + 1): if (time.time() - t0) > timeout: LOGGER.warning(f"{PREFIX}Timeout for request reached. {HELP_MSG}") break # Timeout reached, exit loop response = request_func(*args, **kwargs) if response is None: LOGGER.warning(f"{PREFIX}Received no response from the request. {HELP_MSG}") time.sleep(2**i) # Exponential backoff before retrying continue # Skip further processing and retry if progress_total: self._show_upload_progress(progress_total, response) if HTTPStatus.OK <= response.status_code < HTTPStatus.MULTIPLE_CHOICES: return response # Success, no need to retry if i == 0: # Initial attempt, check status code and provide messages message = self._get_failure_message(response, retry, timeout) if verbose: LOGGER.warning(f"{PREFIX}{message} {HELP_MSG} ({response.status_code})") if not self._should_retry(response.status_code): LOGGER.warning(f"{PREFIX}Request failed. {HELP_MSG} ({response.status_code}") break # Not an error that should be retried, exit loop time.sleep(2**i) # Exponential backoff for retries return response if thread: # Start a new thread to run the retry_request function threading.Thread(target=retry_request, daemon=True).start() else: # If running in the main thread, call retry_request directly return retry_request() def _should_retry(self, status_code): """Determines if a request should be retried based on the HTTP status code.""" retry_codes = { HTTPStatus.REQUEST_TIMEOUT, HTTPStatus.BAD_GATEWAY, HTTPStatus.GATEWAY_TIMEOUT, } return status_code in retry_codes def _get_failure_message(self, response: requests.Response, retry: int, timeout: int): """ Generate a retry message based on the response status code. Args: response: The HTTP response object. retry: The number of retry attempts allowed. timeout: The maximum timeout duration. Returns: (str): The retry message. """ if self._should_retry(response.status_code): return f"Retrying {retry}x for {timeout}s." if retry else "" elif response.status_code == HTTPStatus.TOO_MANY_REQUESTS: # rate limit headers = response.headers return ( f"Rate limit reached ({headers['X-RateLimit-Remaining']}/{headers['X-RateLimit-Limit']}). " f"Please retry after {headers['Retry-After']}s." ) else: try: return response.json().get("message", "No JSON message.") except AttributeError: return "Unable to read JSON." def upload_metrics(self): """Upload model metrics to Ultralytics HUB.""" return self.request_queue(self.model.upload_metrics, metrics=self.metrics_queue.copy(), thread=True) def upload_model( self, epoch: int, weights: str, is_best: bool = False, map: float = 0.0, final: bool = False, ) -> None: """ Upload a model checkpoint to Ultralytics HUB. Args: epoch (int): The current training epoch. weights (str): Path to the model weights file. is_best (bool): Indicates if the current model is the best one so far. map (float): Mean average precision of the model. final (bool): Indicates if the model is the final model after training. """ if Path(weights).is_file(): progress_total = Path(weights).stat().st_size if final else None # Only show progress if final self.request_queue( self.model.upload_model, epoch=epoch, weights=weights, is_best=is_best, map=map, final=final, retry=10, timeout=3600, thread=not final, progress_total=progress_total, ) else: LOGGER.warning(f"{PREFIX}WARNING ⚠️ Model upload issue. Missing model {weights}.") def _show_upload_progress(self, content_length: int, response: requests.Response) -> None: """ Display a progress bar to track the upload progress of a file download. Args: content_length (int): The total size of the content to be downloaded in bytes. response (requests.Response): The response object from the file download request. Returns: None """ with TQDM(total=content_length, unit="B", unit_scale=True, unit_divisor=1024) as pbar: for data in response.iter_content(chunk_size=1024): pbar.update(len(data))
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/hub/session.py
Python
unknown
14,226
# Ultralytics YOLO 🚀, AGPL-3.0 license import os import platform import random import sys import threading import time from pathlib import Path import requests from ultralytics.utils import ( ENVIRONMENT, LOGGER, ONLINE, RANK, SETTINGS, TESTS_RUNNING, TQDM, TryExcept, __version__, colorstr, get_git_origin_url, is_colab, is_git_dir, is_pip_package, ) from ultralytics.utils.downloads import GITHUB_ASSETS_NAMES HUB_API_ROOT = os.environ.get("ULTRALYTICS_HUB_API", "https://api.ultralytics.com") HUB_WEB_ROOT = os.environ.get("ULTRALYTICS_HUB_WEB", "https://hub.ultralytics.com") PREFIX = colorstr("Ultralytics HUB: ") HELP_MSG = "If this issue persists please visit https://github.com/ultralytics/hub/issues for assistance." def request_with_credentials(url: str) -> any: """ Make an AJAX request with cookies attached in a Google Colab environment. Args: url (str): The URL to make the request to. Returns: (any): The response data from the AJAX request. Raises: OSError: If the function is not run in a Google Colab environment. """ if not is_colab(): raise OSError("request_with_credentials() must run in a Colab environment") from google.colab import output # noqa from IPython import display # noqa display.display( display.Javascript( """ window._hub_tmp = new Promise((resolve, reject) => { const timeout = setTimeout(() => reject("Failed authenticating existing browser session"), 5000) fetch("%s", { method: 'POST', credentials: 'include' }) .then((response) => resolve(response.json())) .then((json) => { clearTimeout(timeout); }).catch((err) => { clearTimeout(timeout); reject(err); }); }); """ % url ) ) return output.eval_js("_hub_tmp") def requests_with_progress(method, url, **kwargs): """ Make an HTTP request using the specified method and URL, with an optional progress bar. Args: method (str): The HTTP method to use (e.g. 'GET', 'POST'). url (str): The URL to send the request to. **kwargs (dict): Additional keyword arguments to pass to the underlying `requests.request` function. Returns: (requests.Response): The response object from the HTTP request. Note: - If 'progress' is set to True, the progress bar will display the download progress for responses with a known content length. - If 'progress' is a number then progress bar will display assuming content length = progress. """ progress = kwargs.pop("progress", False) if not progress: return requests.request(method, url, **kwargs) response = requests.request(method, url, stream=True, **kwargs) total = int(response.headers.get("content-length", 0) if isinstance(progress, bool) else progress) # total size try: pbar = TQDM(total=total, unit="B", unit_scale=True, unit_divisor=1024) for data in response.iter_content(chunk_size=1024): pbar.update(len(data)) pbar.close() except requests.exceptions.ChunkedEncodingError: # avoid 'Connection broken: IncompleteRead' warnings response.close() return response def smart_request(method, url, retry=3, timeout=30, thread=True, code=-1, verbose=True, progress=False, **kwargs): """ Makes an HTTP request using the 'requests' library, with exponential backoff retries up to a specified timeout. Args: method (str): The HTTP method to use for the request. Choices are 'post' and 'get'. url (str): The URL to make the request to. retry (int, optional): Number of retries to attempt before giving up. Default is 3. timeout (int, optional): Timeout in seconds after which the function will give up retrying. Default is 30. thread (bool, optional): Whether to execute the request in a separate daemon thread. Default is True. code (int, optional): An identifier for the request, used for logging purposes. Default is -1. verbose (bool, optional): A flag to determine whether to print out to console or not. Default is True. progress (bool, optional): Whether to show a progress bar during the request. Default is False. **kwargs (dict): Keyword arguments to be passed to the requests function specified in method. Returns: (requests.Response): The HTTP response object. If the request is executed in a separate thread, returns None. """ retry_codes = (408, 500) # retry only these codes @TryExcept(verbose=verbose) def func(func_method, func_url, **func_kwargs): """Make HTTP requests with retries and timeouts, with optional progress tracking.""" r = None # response t0 = time.time() # initial time for timer for i in range(retry + 1): if (time.time() - t0) > timeout: break r = requests_with_progress(func_method, func_url, **func_kwargs) # i.e. get(url, data, json, files) if r.status_code < 300: # return codes in the 2xx range are generally considered "good" or "successful" break try: m = r.json().get("message", "No JSON message.") except AttributeError: m = "Unable to read JSON." if i == 0: if r.status_code in retry_codes: m += f" Retrying {retry}x for {timeout}s." if retry else "" elif r.status_code == 429: # rate limit h = r.headers # response headers m = ( f"Rate limit reached ({h['X-RateLimit-Remaining']}/{h['X-RateLimit-Limit']}). " f"Please retry after {h['Retry-After']}s." ) if verbose: LOGGER.warning(f"{PREFIX}{m} {HELP_MSG} ({r.status_code} #{code})") if r.status_code not in retry_codes: return r time.sleep(2**i) # exponential standoff return r args = method, url kwargs["progress"] = progress if thread: threading.Thread(target=func, args=args, kwargs=kwargs, daemon=True).start() else: return func(*args, **kwargs) class Events: """ A class for collecting anonymous event analytics. Event analytics are enabled when sync=True in settings and disabled when sync=False. Run 'yolo settings' to see and update settings YAML file. Attributes: url (str): The URL to send anonymous events. rate_limit (float): The rate limit in seconds for sending events. metadata (dict): A dictionary containing metadata about the environment. enabled (bool): A flag to enable or disable Events based on certain conditions. """ url = "https://www.google-analytics.com/mp/collect?measurement_id=G-X8NCJYTQXM&api_secret=QLQrATrNSwGRFRLE-cbHJw" def __init__(self): """Initializes the Events object with default values for events, rate_limit, and metadata.""" self.events = [] # events list self.rate_limit = 60.0 # rate limit (seconds) self.t = 0.0 # rate limit timer (seconds) self.metadata = { "cli": Path(sys.argv[0]).name == "yolo", "install": "git" if is_git_dir() else "pip" if is_pip_package() else "other", "python": ".".join(platform.python_version_tuple()[:2]), # i.e. 3.10 "version": __version__, "env": ENVIRONMENT, "session_id": round(random.random() * 1e15), "engagement_time_msec": 1000, } self.enabled = ( SETTINGS["sync"] and RANK in (-1, 0) and not TESTS_RUNNING and ONLINE and (is_pip_package() or get_git_origin_url() == "https://github.com/ultralytics/ultralytics.git") ) def __call__(self, cfg): """ Attempts to add a new event to the events list and send events if the rate limit is reached. Args: cfg (IterableSimpleNamespace): The configuration object containing mode and task information. """ if not self.enabled: # Events disabled, do nothing return # Attempt to add to events if len(self.events) < 25: # Events list limited to 25 events (drop any events past this) params = { **self.metadata, "task": cfg.task, "model": cfg.model if cfg.model in GITHUB_ASSETS_NAMES else "custom", } if cfg.mode == "export": params["format"] = cfg.format self.events.append({"name": cfg.mode, "params": params}) # Check rate limit t = time.time() if (t - self.t) < self.rate_limit: # Time is under rate limiter, wait to send return # Time is over rate limiter, send now data = {"client_id": SETTINGS["uuid"], "events": self.events} # SHA-256 anonymized UUID hash and events list # POST equivalent to requests.post(self.url, json=data) smart_request("post", self.url, json=data, retry=0, verbose=False) # Reset events and rate limit timer self.events = [] self.t = t # Run below code on hub/utils init ------------------------------------------------------------------------------------- events = Events()
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/hub/utils.py
Python
unknown
9,736
# Ultralytics YOLO 🚀, AGPL-3.0 license from .rtdetr import RTDETR from .sam import SAM from .yolo import YOLO __all__ = "YOLO", "RTDETR", "SAM" # allow simpler import
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/__init__.py
Python
unknown
173
# Ultralytics YOLO 🚀, AGPL-3.0 license from .model import FastSAM from .predict import FastSAMPredictor from .prompt import FastSAMPrompt from .val import FastSAMValidator __all__ = "FastSAMPredictor", "FastSAM", "FastSAMPrompt", "FastSAMValidator"
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/fastsam/__init__.py
Python
unknown
254
# Ultralytics YOLO 🚀, AGPL-3.0 license from pathlib import Path from ultralytics.engine.model import Model from .predict import FastSAMPredictor from .val import FastSAMValidator class FastSAM(Model): """ FastSAM model interface. Example: ```python from ultralytics import FastSAM model = FastSAM('last.pt') results = model.predict('ultralytics/assets/bus.jpg') ``` """ def __init__(self, model="FastSAM-x.pt"): """Call the __init__ method of the parent class (YOLO) with the updated default model.""" if str(model) == "FastSAM.pt": model = "FastSAM-x.pt" assert Path(model).suffix not in (".yaml", ".yml"), "FastSAM models only support pre-trained models." super().__init__(model=model, task="segment") @property def task_map(self): """Returns a dictionary mapping segment task to corresponding predictor and validator classes.""" return {"segment": {"predictor": FastSAMPredictor, "validator": FastSAMValidator}}
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/fastsam/model.py
Python
unknown
1,054
# Ultralytics YOLO 🚀, AGPL-3.0 license import torch from ultralytics.engine.results import Results from ultralytics.models.fastsam.utils import bbox_iou from ultralytics.models.yolo.detect.predict import DetectionPredictor from ultralytics.utils import DEFAULT_CFG, ops class FastSAMPredictor(DetectionPredictor): """ FastSAMPredictor is specialized for fast SAM (Segment Anything Model) segmentation prediction tasks in Ultralytics YOLO framework. This class extends the DetectionPredictor, customizing the prediction pipeline specifically for fast SAM. It adjusts post-processing steps to incorporate mask prediction and non-max suppression while optimizing for single-class segmentation. Attributes: cfg (dict): Configuration parameters for prediction. overrides (dict, optional): Optional parameter overrides for custom behavior. _callbacks (dict, optional): Optional list of callback functions to be invoked during prediction. """ def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): """ Initializes the FastSAMPredictor class, inheriting from DetectionPredictor and setting the task to 'segment'. Args: cfg (dict): Configuration parameters for prediction. overrides (dict, optional): Optional parameter overrides for custom behavior. _callbacks (dict, optional): Optional list of callback functions to be invoked during prediction. """ super().__init__(cfg, overrides, _callbacks) self.args.task = "segment" def postprocess(self, preds, img, orig_imgs): """ Perform post-processing steps on predictions, including non-max suppression and scaling boxes to original image size, and returns the final results. Args: preds (list): The raw output predictions from the model. img (torch.Tensor): The processed image tensor. orig_imgs (list | torch.Tensor): The original image or list of images. Returns: (list): A list of Results objects, each containing processed boxes, masks, and other metadata. """ p = ops.non_max_suppression( preds[0], self.args.conf, self.args.iou, agnostic=self.args.agnostic_nms, max_det=self.args.max_det, nc=1, # set to 1 class since SAM has no class predictions classes=self.args.classes, ) full_box = torch.zeros(p[0].shape[1], device=p[0].device) full_box[2], full_box[3], full_box[4], full_box[6:] = img.shape[3], img.shape[2], 1.0, 1.0 full_box = full_box.view(1, -1) critical_iou_index = bbox_iou(full_box[0][:4], p[0][:, :4], iou_thres=0.9, image_shape=img.shape[2:]) if critical_iou_index.numel() != 0: full_box[0][4] = p[0][critical_iou_index][:, 4] full_box[0][6:] = p[0][critical_iou_index][:, 6:] p[0][critical_iou_index] = full_box if not isinstance(orig_imgs, list): # input images are a torch.Tensor, not a list orig_imgs = ops.convert_torch2numpy_batch(orig_imgs) results = [] proto = preds[1][-1] if len(preds[1]) == 3 else preds[1] # second output is len 3 if pt, but only 1 if exported for i, pred in enumerate(p): orig_img = orig_imgs[i] img_path = self.batch[0][i] if not len(pred): # save empty boxes masks = None elif self.args.retina_masks: pred[:, :4] = ops.scale_boxes(img.shape[2:], pred[:, :4], orig_img.shape) masks = ops.process_mask_native(proto[i], pred[:, 6:], pred[:, :4], orig_img.shape[:2]) # HWC else: masks = ops.process_mask(proto[i], pred[:, 6:], pred[:, :4], img.shape[2:], upsample=True) # HWC pred[:, :4] = ops.scale_boxes(img.shape[2:], pred[:, :4], orig_img.shape) results.append(Results(orig_img, path=img_path, names=self.model.names, boxes=pred[:, :6], masks=masks)) return results
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/fastsam/predict.py
Python
unknown
4,121
# Ultralytics YOLO 🚀, AGPL-3.0 license import os from pathlib import Path import cv2 import matplotlib.pyplot as plt import numpy as np import torch from PIL import Image from ultralytics.utils import TQDM class FastSAMPrompt: """ Fast Segment Anything Model class for image annotation and visualization. Attributes: device (str): Computing device ('cuda' or 'cpu'). results: Object detection or segmentation results. source: Source image or image path. clip: CLIP model for linear assignment. """ def __init__(self, source, results, device="cuda") -> None: """Initializes FastSAMPrompt with given source, results and device, and assigns clip for linear assignment.""" self.device = device self.results = results self.source = source # Import and assign clip try: import clip # for linear_assignment except ImportError: from ultralytics.utils.checks import check_requirements check_requirements("git+https://github.com/openai/CLIP.git") import clip self.clip = clip @staticmethod def _segment_image(image, bbox): """Segments the given image according to the provided bounding box coordinates.""" image_array = np.array(image) segmented_image_array = np.zeros_like(image_array) x1, y1, x2, y2 = bbox segmented_image_array[y1:y2, x1:x2] = image_array[y1:y2, x1:x2] segmented_image = Image.fromarray(segmented_image_array) black_image = Image.new("RGB", image.size, (255, 255, 255)) # transparency_mask = np.zeros_like((), dtype=np.uint8) transparency_mask = np.zeros((image_array.shape[0], image_array.shape[1]), dtype=np.uint8) transparency_mask[y1:y2, x1:x2] = 255 transparency_mask_image = Image.fromarray(transparency_mask, mode="L") black_image.paste(segmented_image, mask=transparency_mask_image) return black_image @staticmethod def _format_results(result, filter=0): """Formats detection results into list of annotations each containing ID, segmentation, bounding box, score and area. """ annotations = [] n = len(result.masks.data) if result.masks is not None else 0 for i in range(n): mask = result.masks.data[i] == 1.0 if torch.sum(mask) >= filter: annotation = { "id": i, "segmentation": mask.cpu().numpy(), "bbox": result.boxes.data[i], "score": result.boxes.conf[i], } annotation["area"] = annotation["segmentation"].sum() annotations.append(annotation) return annotations @staticmethod def _get_bbox_from_mask(mask): """Applies morphological transformations to the mask, displays it, and if with_contours is True, draws contours. """ mask = mask.astype(np.uint8) contours, hierarchy = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) x1, y1, w, h = cv2.boundingRect(contours[0]) x2, y2 = x1 + w, y1 + h if len(contours) > 1: for b in contours: x_t, y_t, w_t, h_t = cv2.boundingRect(b) x1 = min(x1, x_t) y1 = min(y1, y_t) x2 = max(x2, x_t + w_t) y2 = max(y2, y_t + h_t) return [x1, y1, x2, y2] def plot( self, annotations, output, bbox=None, points=None, point_label=None, mask_random_color=True, better_quality=True, retina=False, with_contours=True, ): """ Plots annotations, bounding boxes, and points on images and saves the output. Args: annotations (list): Annotations to be plotted. output (str or Path): Output directory for saving the plots. bbox (list, optional): Bounding box coordinates [x1, y1, x2, y2]. Defaults to None. points (list, optional): Points to be plotted. Defaults to None. point_label (list, optional): Labels for the points. Defaults to None. mask_random_color (bool, optional): Whether to use random color for masks. Defaults to True. better_quality (bool, optional): Whether to apply morphological transformations for better mask quality. Defaults to True. retina (bool, optional): Whether to use retina mask. Defaults to False. with_contours (bool, optional): Whether to plot contours. Defaults to True. """ pbar = TQDM(annotations, total=len(annotations)) for ann in pbar: result_name = os.path.basename(ann.path) image = ann.orig_img[..., ::-1] # BGR to RGB original_h, original_w = ann.orig_shape # For macOS only # plt.switch_backend('TkAgg') plt.figure(figsize=(original_w / 100, original_h / 100)) # Add subplot with no margin. plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0) plt.margins(0, 0) plt.gca().xaxis.set_major_locator(plt.NullLocator()) plt.gca().yaxis.set_major_locator(plt.NullLocator()) plt.imshow(image) if ann.masks is not None: masks = ann.masks.data if better_quality: if isinstance(masks[0], torch.Tensor): masks = np.array(masks.cpu()) for i, mask in enumerate(masks): mask = cv2.morphologyEx(mask.astype(np.uint8), cv2.MORPH_CLOSE, np.ones((3, 3), np.uint8)) masks[i] = cv2.morphologyEx(mask.astype(np.uint8), cv2.MORPH_OPEN, np.ones((8, 8), np.uint8)) self.fast_show_mask( masks, plt.gca(), random_color=mask_random_color, bbox=bbox, points=points, pointlabel=point_label, retinamask=retina, target_height=original_h, target_width=original_w, ) if with_contours: contour_all = [] temp = np.zeros((original_h, original_w, 1)) for i, mask in enumerate(masks): mask = mask.astype(np.uint8) if not retina: mask = cv2.resize(mask, (original_w, original_h), interpolation=cv2.INTER_NEAREST) contours, _ = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) contour_all.extend(iter(contours)) cv2.drawContours(temp, contour_all, -1, (255, 255, 255), 2) color = np.array([0 / 255, 0 / 255, 1.0, 0.8]) contour_mask = temp / 255 * color.reshape(1, 1, -1) plt.imshow(contour_mask) # Save the figure save_path = Path(output) / result_name save_path.parent.mkdir(exist_ok=True, parents=True) plt.axis("off") plt.savefig(save_path, bbox_inches="tight", pad_inches=0, transparent=True) plt.close() pbar.set_description(f"Saving {result_name} to {save_path}") @staticmethod def fast_show_mask( annotation, ax, random_color=False, bbox=None, points=None, pointlabel=None, retinamask=True, target_height=960, target_width=960, ): """ Quickly shows the mask annotations on the given matplotlib axis. Args: annotation (array-like): Mask annotation. ax (matplotlib.axes.Axes): Matplotlib axis. random_color (bool, optional): Whether to use random color for masks. Defaults to False. bbox (list, optional): Bounding box coordinates [x1, y1, x2, y2]. Defaults to None. points (list, optional): Points to be plotted. Defaults to None. pointlabel (list, optional): Labels for the points. Defaults to None. retinamask (bool, optional): Whether to use retina mask. Defaults to True. target_height (int, optional): Target height for resizing. Defaults to 960. target_width (int, optional): Target width for resizing. Defaults to 960. """ n, h, w = annotation.shape # batch, height, width areas = np.sum(annotation, axis=(1, 2)) annotation = annotation[np.argsort(areas)] index = (annotation != 0).argmax(axis=0) if random_color: color = np.random.random((n, 1, 1, 3)) else: color = np.ones((n, 1, 1, 3)) * np.array([30 / 255, 144 / 255, 1.0]) transparency = np.ones((n, 1, 1, 1)) * 0.6 visual = np.concatenate([color, transparency], axis=-1) mask_image = np.expand_dims(annotation, -1) * visual show = np.zeros((h, w, 4)) h_indices, w_indices = np.meshgrid(np.arange(h), np.arange(w), indexing="ij") indices = (index[h_indices, w_indices], h_indices, w_indices, slice(None)) show[h_indices, w_indices, :] = mask_image[indices] if bbox is not None: x1, y1, x2, y2 = bbox ax.add_patch(plt.Rectangle((x1, y1), x2 - x1, y2 - y1, fill=False, edgecolor="b", linewidth=1)) # Draw point if points is not None: plt.scatter( [point[0] for i, point in enumerate(points) if pointlabel[i] == 1], [point[1] for i, point in enumerate(points) if pointlabel[i] == 1], s=20, c="y", ) plt.scatter( [point[0] for i, point in enumerate(points) if pointlabel[i] == 0], [point[1] for i, point in enumerate(points) if pointlabel[i] == 0], s=20, c="m", ) if not retinamask: show = cv2.resize(show, (target_width, target_height), interpolation=cv2.INTER_NEAREST) ax.imshow(show) @torch.no_grad() def retrieve(self, model, preprocess, elements, search_text: str, device) -> int: """Processes images and text with a model, calculates similarity, and returns softmax score.""" preprocessed_images = [preprocess(image).to(device) for image in elements] tokenized_text = self.clip.tokenize([search_text]).to(device) stacked_images = torch.stack(preprocessed_images) image_features = model.encode_image(stacked_images) text_features = model.encode_text(tokenized_text) image_features /= image_features.norm(dim=-1, keepdim=True) text_features /= text_features.norm(dim=-1, keepdim=True) probs = 100.0 * image_features @ text_features.T return probs[:, 0].softmax(dim=0) def _crop_image(self, format_results): """Crops an image based on provided annotation format and returns cropped images and related data.""" if os.path.isdir(self.source): raise ValueError(f"'{self.source}' is a directory, not a valid source for this function.") image = Image.fromarray(cv2.cvtColor(self.results[0].orig_img, cv2.COLOR_BGR2RGB)) ori_w, ori_h = image.size annotations = format_results mask_h, mask_w = annotations[0]["segmentation"].shape if ori_w != mask_w or ori_h != mask_h: image = image.resize((mask_w, mask_h)) cropped_boxes = [] cropped_images = [] not_crop = [] filter_id = [] for _, mask in enumerate(annotations): if np.sum(mask["segmentation"]) <= 100: filter_id.append(_) continue bbox = self._get_bbox_from_mask(mask["segmentation"]) # bbox from mask cropped_boxes.append(self._segment_image(image, bbox)) # save cropped image cropped_images.append(bbox) # save cropped image bbox return cropped_boxes, cropped_images, not_crop, filter_id, annotations def box_prompt(self, bbox): """Modifies the bounding box properties and calculates IoU between masks and bounding box.""" if self.results[0].masks is not None: assert bbox[2] != 0 and bbox[3] != 0 if os.path.isdir(self.source): raise ValueError(f"'{self.source}' is a directory, not a valid source for this function.") masks = self.results[0].masks.data target_height, target_width = self.results[0].orig_shape h = masks.shape[1] w = masks.shape[2] if h != target_height or w != target_width: bbox = [ int(bbox[0] * w / target_width), int(bbox[1] * h / target_height), int(bbox[2] * w / target_width), int(bbox[3] * h / target_height), ] bbox[0] = max(round(bbox[0]), 0) bbox[1] = max(round(bbox[1]), 0) bbox[2] = min(round(bbox[2]), w) bbox[3] = min(round(bbox[3]), h) # IoUs = torch.zeros(len(masks), dtype=torch.float32) bbox_area = (bbox[3] - bbox[1]) * (bbox[2] - bbox[0]) masks_area = torch.sum(masks[:, bbox[1] : bbox[3], bbox[0] : bbox[2]], dim=(1, 2)) orig_masks_area = torch.sum(masks, dim=(1, 2)) union = bbox_area + orig_masks_area - masks_area iou = masks_area / union max_iou_index = torch.argmax(iou) self.results[0].masks.data = torch.tensor(np.array([masks[max_iou_index].cpu().numpy()])) return self.results def point_prompt(self, points, pointlabel): # numpy """Adjusts points on detected masks based on user input and returns the modified results.""" if self.results[0].masks is not None: if os.path.isdir(self.source): raise ValueError(f"'{self.source}' is a directory, not a valid source for this function.") masks = self._format_results(self.results[0], 0) target_height, target_width = self.results[0].orig_shape h = masks[0]["segmentation"].shape[0] w = masks[0]["segmentation"].shape[1] if h != target_height or w != target_width: points = [[int(point[0] * w / target_width), int(point[1] * h / target_height)] for point in points] onemask = np.zeros((h, w)) for annotation in masks: mask = annotation["segmentation"] if isinstance(annotation, dict) else annotation for i, point in enumerate(points): if mask[point[1], point[0]] == 1 and pointlabel[i] == 1: onemask += mask if mask[point[1], point[0]] == 1 and pointlabel[i] == 0: onemask -= mask onemask = onemask >= 1 self.results[0].masks.data = torch.tensor(np.array([onemask])) return self.results def text_prompt(self, text): """Processes a text prompt, applies it to existing results and returns the updated results.""" if self.results[0].masks is not None: format_results = self._format_results(self.results[0], 0) cropped_boxes, cropped_images, not_crop, filter_id, annotations = self._crop_image(format_results) clip_model, preprocess = self.clip.load("ViT-B/32", device=self.device) scores = self.retrieve(clip_model, preprocess, cropped_boxes, text, device=self.device) max_idx = scores.argsort() max_idx = max_idx[-1] max_idx += sum(np.array(filter_id) <= int(max_idx)) self.results[0].masks.data = torch.tensor(np.array([annotations[max_idx]["segmentation"]])) return self.results def everything_prompt(self): """Returns the processed results from the previous methods in the class.""" return self.results
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/fastsam/prompt.py
Python
unknown
16,190
# Ultralytics YOLO 🚀, AGPL-3.0 license import torch def adjust_bboxes_to_image_border(boxes, image_shape, threshold=20): """ Adjust bounding boxes to stick to image border if they are within a certain threshold. Args: boxes (torch.Tensor): (n, 4) image_shape (tuple): (height, width) threshold (int): pixel threshold Returns: adjusted_boxes (torch.Tensor): adjusted bounding boxes """ # Image dimensions h, w = image_shape # Adjust boxes boxes[boxes[:, 0] < threshold, 0] = 0 # x1 boxes[boxes[:, 1] < threshold, 1] = 0 # y1 boxes[boxes[:, 2] > w - threshold, 2] = w # x2 boxes[boxes[:, 3] > h - threshold, 3] = h # y2 return boxes def bbox_iou(box1, boxes, iou_thres=0.9, image_shape=(640, 640), raw_output=False): """ Compute the Intersection-Over-Union of a bounding box with respect to an array of other bounding boxes. Args: box1 (torch.Tensor): (4, ) boxes (torch.Tensor): (n, 4) iou_thres (float): IoU threshold image_shape (tuple): (height, width) raw_output (bool): If True, return the raw IoU values instead of the indices Returns: high_iou_indices (torch.Tensor): Indices of boxes with IoU > thres """ boxes = adjust_bboxes_to_image_border(boxes, image_shape) # Obtain coordinates for intersections x1 = torch.max(box1[0], boxes[:, 0]) y1 = torch.max(box1[1], boxes[:, 1]) x2 = torch.min(box1[2], boxes[:, 2]) y2 = torch.min(box1[3], boxes[:, 3]) # Compute the area of intersection intersection = (x2 - x1).clamp(0) * (y2 - y1).clamp(0) # Compute the area of both individual boxes box1_area = (box1[2] - box1[0]) * (box1[3] - box1[1]) box2_area = (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1]) # Compute the area of union union = box1_area + box2_area - intersection # Compute the IoU iou = intersection / union # Should be shape (n, ) if raw_output: return 0 if iou.numel() == 0 else iou # return indices of boxes with IoU > thres return torch.nonzero(iou > iou_thres).flatten()
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/fastsam/utils.py
Python
unknown
2,157
# Ultralytics YOLO 🚀, AGPL-3.0 license from ultralytics.models.yolo.segment import SegmentationValidator from ultralytics.utils.metrics import SegmentMetrics class FastSAMValidator(SegmentationValidator): """ Custom validation class for fast SAM (Segment Anything Model) segmentation in Ultralytics YOLO framework. Extends the SegmentationValidator class, customizing the validation process specifically for fast SAM. This class sets the task to 'segment' and uses the SegmentMetrics for evaluation. Additionally, plotting features are disabled to avoid errors during validation. Attributes: dataloader: The data loader object used for validation. save_dir (str): The directory where validation results will be saved. pbar: A progress bar object. args: Additional arguments for customization. _callbacks: List of callback functions to be invoked during validation. """ def __init__(self, dataloader=None, save_dir=None, pbar=None, args=None, _callbacks=None): """ Initialize the FastSAMValidator class, setting the task to 'segment' and metrics to SegmentMetrics. Args: dataloader (torch.utils.data.DataLoader): Dataloader to be used for validation. save_dir (Path, optional): Directory to save results. pbar (tqdm.tqdm): Progress bar for displaying progress. args (SimpleNamespace): Configuration for the validator. _callbacks (dict): Dictionary to store various callback functions. Notes: Plots for ConfusionMatrix and other related metrics are disabled in this class to avoid errors. """ super().__init__(dataloader, save_dir, pbar, args, _callbacks) self.args.task = "segment" self.args.plots = False # disable ConfusionMatrix and other plots to avoid errors self.metrics = SegmentMetrics(save_dir=self.save_dir, on_plot=self.on_plot)
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/fastsam/val.py
Python
unknown
1,967
# Ultralytics YOLO 🚀, AGPL-3.0 license from .model import NAS from .predict import NASPredictor from .val import NASValidator __all__ = "NASPredictor", "NASValidator", "NAS"
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/nas/__init__.py
Python
unknown
179
# Ultralytics YOLO 🚀, AGPL-3.0 license """ YOLO-NAS model interface. Example: ```python from ultralytics import NAS model = NAS('yolo_nas_s') results = model.predict('ultralytics/assets/bus.jpg') ``` """ from pathlib import Path import torch from ultralytics.engine.model import Model from ultralytics.utils.torch_utils import model_info, smart_inference_mode from .predict import NASPredictor from .val import NASValidator class NAS(Model): """ YOLO NAS model for object detection. This class provides an interface for the YOLO-NAS models and extends the `Model` class from Ultralytics engine. It is designed to facilitate the task of object detection using pre-trained or custom-trained YOLO-NAS models. Example: ```python from ultralytics import NAS model = NAS('yolo_nas_s') results = model.predict('ultralytics/assets/bus.jpg') ``` Attributes: model (str): Path to the pre-trained model or model name. Defaults to 'yolo_nas_s.pt'. Note: YOLO-NAS models only support pre-trained models. Do not provide YAML configuration files. """ def __init__(self, model="yolo_nas_s.pt") -> None: """Initializes the NAS model with the provided or default 'yolo_nas_s.pt' model.""" assert Path(model).suffix not in (".yaml", ".yml"), "YOLO-NAS models only support pre-trained models." super().__init__(model, task="detect") @smart_inference_mode() def _load(self, weights: str, task: str): """Loads an existing NAS model weights or creates a new NAS model with pretrained weights if not provided.""" import super_gradients suffix = Path(weights).suffix if suffix == ".pt": self.model = torch.load(weights) elif suffix == "": self.model = super_gradients.training.models.get(weights, pretrained_weights="coco") # Standardize model self.model.fuse = lambda verbose=True: self.model self.model.stride = torch.tensor([32]) self.model.names = dict(enumerate(self.model._class_names)) self.model.is_fused = lambda: False # for info() self.model.yaml = {} # for info() self.model.pt_path = weights # for export() self.model.task = "detect" # for export() def info(self, detailed=False, verbose=True): """ Logs model info. Args: detailed (bool): Show detailed information about model. verbose (bool): Controls verbosity. """ return model_info(self.model, detailed=detailed, verbose=verbose, imgsz=640) @property def task_map(self): """Returns a dictionary mapping tasks to respective predictor and validator classes.""" return {"detect": {"predictor": NASPredictor, "validator": NASValidator}}
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/nas/model.py
Python
unknown
2,864
# Ultralytics YOLO 🚀, AGPL-3.0 license from .model import RTDETR from .predict import RTDETRPredictor from .val import RTDETRValidator __all__ = "RTDETRPredictor", "RTDETRValidator", "RTDETR"
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/rtdetr/__init__.py
Python
unknown
197
# Ultralytics YOLO 🚀, AGPL-3.0 license """ Interface for Baidu's RT-DETR, a Vision Transformer-based real-time object detector. RT-DETR offers real-time performance and high accuracy, excelling in accelerated backends like CUDA with TensorRT. It features an efficient hybrid encoder and IoU-aware query selection for enhanced detection accuracy. For more information on RT-DETR, visit: https://arxiv.org/pdf/2304.08069.pdf """ from ultralytics.engine.model import Model from ultralytics.nn.tasks import RTDETRDetectionModel from .predict import RTDETRPredictor from .train import RTDETRTrainer from .val import RTDETRValidator class RTDETR(Model): """ Interface for Baidu's RT-DETR model. This Vision Transformer-based object detector provides real-time performance with high accuracy. It supports efficient hybrid encoding, IoU-aware query selection, and adaptable inference speed. Attributes: model (str): Path to the pre-trained model. Defaults to 'rtdetr-l.pt'. """ def __init__(self, model="rtdetr-l.pt") -> None: """ Initializes the RT-DETR model with the given pre-trained model file. Supports .pt and .yaml formats. Args: model (str): Path to the pre-trained model. Defaults to 'rtdetr-l.pt'. Raises: NotImplementedError: If the model file extension is not 'pt', 'yaml', or 'yml'. """ if model and model.split(".")[-1] not in ("pt", "yaml", "yml"): raise NotImplementedError("RT-DETR only supports creating from *.pt, *.yaml, or *.yml files.") super().__init__(model=model, task="detect") @property def task_map(self) -> dict: """ Returns a task map for RT-DETR, associating tasks with corresponding Ultralytics classes. Returns: dict: A dictionary mapping task names to Ultralytics task classes for the RT-DETR model. """ return { "detect": { "predictor": RTDETRPredictor, "validator": RTDETRValidator, "trainer": RTDETRTrainer, "model": RTDETRDetectionModel, } }
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/rtdetr/model.py
Python
unknown
2,167
# Ultralytics YOLO 🚀, AGPL-3.0 license import torch from ultralytics.data.augment import LetterBox from ultralytics.engine.predictor import BasePredictor from ultralytics.engine.results import Results from ultralytics.utils import ops class RTDETRPredictor(BasePredictor): """ RT-DETR (Real-Time Detection Transformer) Predictor extending the BasePredictor class for making predictions using Baidu's RT-DETR model. This class leverages the power of Vision Transformers to provide real-time object detection while maintaining high accuracy. It supports key features like efficient hybrid encoding and IoU-aware query selection. Example: ```python from ultralytics.utils import ASSETS from ultralytics.models.rtdetr import RTDETRPredictor args = dict(model='rtdetr-l.pt', source=ASSETS) predictor = RTDETRPredictor(overrides=args) predictor.predict_cli() ``` Attributes: imgsz (int): Image size for inference (must be square and scale-filled). args (dict): Argument overrides for the predictor. """ def postprocess(self, preds, img, orig_imgs): """ Postprocess the raw predictions from the model to generate bounding boxes and confidence scores. The method filters detections based on confidence and class if specified in `self.args`. Args: preds (torch.Tensor): Raw predictions from the model. img (torch.Tensor): Processed input images. orig_imgs (list or torch.Tensor): Original, unprocessed images. Returns: (list[Results]): A list of Results objects containing the post-processed bounding boxes, confidence scores, and class labels. """ nd = preds[0].shape[-1] bboxes, scores = preds[0].split((4, nd - 4), dim=-1) if not isinstance(orig_imgs, list): # input images are a torch.Tensor, not a list orig_imgs = ops.convert_torch2numpy_batch(orig_imgs) results = [] for i, bbox in enumerate(bboxes): # (300, 4) bbox = ops.xywh2xyxy(bbox) score, cls = scores[i].max(-1, keepdim=True) # (300, 1) idx = score.squeeze(-1) > self.args.conf # (300, ) if self.args.classes is not None: idx = (cls == torch.tensor(self.args.classes, device=cls.device)).any(1) & idx pred = torch.cat([bbox, score, cls], dim=-1)[idx] # filter orig_img = orig_imgs[i] oh, ow = orig_img.shape[:2] pred[..., [0, 2]] *= ow pred[..., [1, 3]] *= oh img_path = self.batch[0][i] results.append(Results(orig_img, path=img_path, names=self.model.names, boxes=pred)) return results def pre_transform(self, im): """ Pre-transforms the input images before feeding them into the model for inference. The input images are letterboxed to ensure a square aspect ratio and scale-filled. The size must be square(640) and scaleFilled. Args: im (list[np.ndarray] |torch.Tensor): Input images of shape (N,3,h,w) for tensor, [(h,w,3) x N] for list. Returns: (list): List of pre-transformed images ready for model inference. """ letterbox = LetterBox(self.imgsz, auto=False, scaleFill=True) return [letterbox(image=x) for x in im]
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/rtdetr/predict.py
Python
unknown
3,425
# Ultralytics YOLO 🚀, AGPL-3.0 license from copy import copy import torch from ultralytics.models.yolo.detect import DetectionTrainer from ultralytics.nn.tasks import RTDETRDetectionModel from ultralytics.utils import RANK, colorstr from .val import RTDETRDataset, RTDETRValidator class RTDETRTrainer(DetectionTrainer): """ Trainer class for the RT-DETR model developed by Baidu for real-time object detection. Extends the DetectionTrainer class for YOLO to adapt to the specific features and architecture of RT-DETR. This model leverages Vision Transformers and has capabilities like IoU-aware query selection and adaptable inference speed. Notes: - F.grid_sample used in RT-DETR does not support the `deterministic=True` argument. - AMP training can lead to NaN outputs and may produce errors during bipartite graph matching. Example: ```python from ultralytics.models.rtdetr.train import RTDETRTrainer args = dict(model='rtdetr-l.yaml', data='coco8.yaml', imgsz=640, epochs=3) trainer = RTDETRTrainer(overrides=args) trainer.train() ``` """ def get_model(self, cfg=None, weights=None, verbose=True): """ Initialize and return an RT-DETR model for object detection tasks. Args: cfg (dict, optional): Model configuration. Defaults to None. weights (str, optional): Path to pre-trained model weights. Defaults to None. verbose (bool): Verbose logging if True. Defaults to True. Returns: (RTDETRDetectionModel): Initialized model. """ model = RTDETRDetectionModel(cfg, nc=self.data["nc"], verbose=verbose and RANK == -1) if weights: model.load(weights) return model def build_dataset(self, img_path, mode="val", batch=None): """ Build and return an RT-DETR dataset for training or validation. Args: img_path (str): Path to the folder containing images. mode (str): Dataset mode, either 'train' or 'val'. batch (int, optional): Batch size for rectangle training. Defaults to None. Returns: (RTDETRDataset): Dataset object for the specific mode. """ return RTDETRDataset( img_path=img_path, imgsz=self.args.imgsz, batch_size=batch, augment=mode == "train", hyp=self.args, rect=False, cache=self.args.cache or None, prefix=colorstr(f"{mode}: "), data=self.data, ) def get_validator(self): """ Returns a DetectionValidator suitable for RT-DETR model validation. Returns: (RTDETRValidator): Validator object for model validation. """ self.loss_names = "giou_loss", "cls_loss", "l1_loss" return RTDETRValidator(self.test_loader, save_dir=self.save_dir, args=copy(self.args)) def preprocess_batch(self, batch): """ Preprocess a batch of images. Scales and converts the images to float format. Args: batch (dict): Dictionary containing a batch of images, bboxes, and labels. Returns: (dict): Preprocessed batch. """ batch = super().preprocess_batch(batch) bs = len(batch["img"]) batch_idx = batch["batch_idx"] gt_bbox, gt_class = [], [] for i in range(bs): gt_bbox.append(batch["bboxes"][batch_idx == i].to(batch_idx.device)) gt_class.append(batch["cls"][batch_idx == i].to(device=batch_idx.device, dtype=torch.long)) return batch
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/rtdetr/train.py
Python
unknown
3,684
# Ultralytics YOLO 🚀, AGPL-3.0 license import torch from ultralytics.data import YOLODataset from ultralytics.data.augment import Compose, Format, v8_transforms from ultralytics.models.yolo.detect import DetectionValidator from ultralytics.utils import colorstr, ops __all__ = ("RTDETRValidator",) # tuple or list class RTDETRDataset(YOLODataset): """ Real-Time DEtection and TRacking (RT-DETR) dataset class extending the base YOLODataset class. This specialized dataset class is designed for use with the RT-DETR object detection model and is optimized for real-time detection and tracking tasks. """ def __init__(self, *args, data=None, **kwargs): """Initialize the RTDETRDataset class by inheriting from the YOLODataset class.""" super().__init__(*args, data=data, **kwargs) # NOTE: add stretch version load_image for RTDETR mosaic def load_image(self, i, rect_mode=False): """Loads 1 image from dataset index 'i', returns (im, resized hw).""" return super().load_image(i=i, rect_mode=rect_mode) def build_transforms(self, hyp=None): """Temporary, only for evaluation.""" if self.augment: hyp.mosaic = hyp.mosaic if self.augment and not self.rect else 0.0 hyp.mixup = hyp.mixup if self.augment and not self.rect else 0.0 transforms = v8_transforms(self, self.imgsz, hyp, stretch=True) else: # transforms = Compose([LetterBox(new_shape=(self.imgsz, self.imgsz), auto=False, scaleFill=True)]) transforms = Compose([]) transforms.append( Format( bbox_format="xywh", normalize=True, return_mask=self.use_segments, return_keypoint=self.use_keypoints, batch_idx=True, mask_ratio=hyp.mask_ratio, mask_overlap=hyp.overlap_mask, ) ) return transforms class RTDETRValidator(DetectionValidator): """ RTDETRValidator extends the DetectionValidator class to provide validation capabilities specifically tailored for the RT-DETR (Real-Time DETR) object detection model. The class allows building of an RTDETR-specific dataset for validation, applies Non-maximum suppression for post-processing, and updates evaluation metrics accordingly. Example: ```python from ultralytics.models.rtdetr import RTDETRValidator args = dict(model='rtdetr-l.pt', data='coco8.yaml') validator = RTDETRValidator(args=args) validator() ``` Note: For further details on the attributes and methods, refer to the parent DetectionValidator class. """ def build_dataset(self, img_path, mode="val", batch=None): """ Build an RTDETR Dataset. Args: img_path (str): Path to the folder containing images. mode (str): `train` mode or `val` mode, users are able to customize different augmentations for each mode. batch (int, optional): Size of batches, this is for `rect`. Defaults to None. """ return RTDETRDataset( img_path=img_path, imgsz=self.args.imgsz, batch_size=batch, augment=False, # no augmentation hyp=self.args, rect=False, # no rect cache=self.args.cache or None, prefix=colorstr(f"{mode}: "), data=self.data, ) def postprocess(self, preds): """Apply Non-maximum suppression to prediction outputs.""" bs, _, nd = preds[0].shape bboxes, scores = preds[0].split((4, nd - 4), dim=-1) bboxes *= self.args.imgsz outputs = [torch.zeros((0, 6), device=bboxes.device)] * bs for i, bbox in enumerate(bboxes): # (300, 4) bbox = ops.xywh2xyxy(bbox) score, cls = scores[i].max(-1) # (300, ) # Do not need threshold for evaluation as only got 300 boxes here # idx = score > self.args.conf pred = torch.cat([bbox, score[..., None], cls[..., None]], dim=-1) # filter # Sort by confidence to correctly get internal metrics pred = pred[score.argsort(descending=True)] outputs[i] = pred # [idx] return outputs def _prepare_batch(self, si, batch): """Prepares a batch for training or inference by applying transformations.""" idx = batch["batch_idx"] == si cls = batch["cls"][idx].squeeze(-1) bbox = batch["bboxes"][idx] ori_shape = batch["ori_shape"][si] imgsz = batch["img"].shape[2:] ratio_pad = batch["ratio_pad"][si] if len(cls): bbox = ops.xywh2xyxy(bbox) # target boxes bbox[..., [0, 2]] *= ori_shape[1] # native-space pred bbox[..., [1, 3]] *= ori_shape[0] # native-space pred return dict(cls=cls, bbox=bbox, ori_shape=ori_shape, imgsz=imgsz, ratio_pad=ratio_pad) def _prepare_pred(self, pred, pbatch): """Prepares and returns a batch with transformed bounding boxes and class labels.""" predn = pred.clone() predn[..., [0, 2]] *= pbatch["ori_shape"][1] / self.args.imgsz # native-space pred predn[..., [1, 3]] *= pbatch["ori_shape"][0] / self.args.imgsz # native-space pred return predn.float()
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/rtdetr/val.py
Python
unknown
5,401
# Ultralytics YOLO 🚀, AGPL-3.0 license from .model import SAM from .predict import Predictor __all__ = "SAM", "Predictor" # tuple or list
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/sam/__init__.py
Python
unknown
144
# Ultralytics YOLO 🚀, AGPL-3.0 license import math from itertools import product from typing import Any, Generator, List, Tuple import numpy as np import torch def is_box_near_crop_edge( boxes: torch.Tensor, crop_box: List[int], orig_box: List[int], atol: float = 20.0 ) -> torch.Tensor: """Return a boolean tensor indicating if boxes are near the crop edge.""" crop_box_torch = torch.as_tensor(crop_box, dtype=torch.float, device=boxes.device) orig_box_torch = torch.as_tensor(orig_box, dtype=torch.float, device=boxes.device) boxes = uncrop_boxes_xyxy(boxes, crop_box).float() near_crop_edge = torch.isclose(boxes, crop_box_torch[None, :], atol=atol, rtol=0) near_image_edge = torch.isclose(boxes, orig_box_torch[None, :], atol=atol, rtol=0) near_crop_edge = torch.logical_and(near_crop_edge, ~near_image_edge) return torch.any(near_crop_edge, dim=1) def batch_iterator(batch_size: int, *args) -> Generator[List[Any], None, None]: """Yield batches of data from the input arguments.""" assert args and all(len(a) == len(args[0]) for a in args), "Batched iteration must have same-size inputs." n_batches = len(args[0]) // batch_size + int(len(args[0]) % batch_size != 0) for b in range(n_batches): yield [arg[b * batch_size : (b + 1) * batch_size] for arg in args] def calculate_stability_score(masks: torch.Tensor, mask_threshold: float, threshold_offset: float) -> torch.Tensor: """ Computes the stability score for a batch of masks. The stability score is the IoU between the binary masks obtained by thresholding the predicted mask logits at high and low values. Notes: - One mask is always contained inside the other. - Save memory by preventing unnecessary cast to torch.int64 """ intersections = (masks > (mask_threshold + threshold_offset)).sum(-1, dtype=torch.int16).sum(-1, dtype=torch.int32) unions = (masks > (mask_threshold - threshold_offset)).sum(-1, dtype=torch.int16).sum(-1, dtype=torch.int32) return intersections / unions def build_point_grid(n_per_side: int) -> np.ndarray: """Generate a 2D grid of evenly spaced points in the range [0,1]x[0,1].""" offset = 1 / (2 * n_per_side) points_one_side = np.linspace(offset, 1 - offset, n_per_side) points_x = np.tile(points_one_side[None, :], (n_per_side, 1)) points_y = np.tile(points_one_side[:, None], (1, n_per_side)) return np.stack([points_x, points_y], axis=-1).reshape(-1, 2) def build_all_layer_point_grids(n_per_side: int, n_layers: int, scale_per_layer: int) -> List[np.ndarray]: """Generate point grids for all crop layers.""" return [build_point_grid(int(n_per_side / (scale_per_layer**i))) for i in range(n_layers + 1)] def generate_crop_boxes( im_size: Tuple[int, ...], n_layers: int, overlap_ratio: float ) -> Tuple[List[List[int]], List[int]]: """ Generates a list of crop boxes of different sizes. Each layer has (2**i)**2 boxes for the ith layer. """ crop_boxes, layer_idxs = [], [] im_h, im_w = im_size short_side = min(im_h, im_w) # Original image crop_boxes.append([0, 0, im_w, im_h]) layer_idxs.append(0) def crop_len(orig_len, n_crops, overlap): """Crops bounding boxes to the size of the input image.""" return int(math.ceil((overlap * (n_crops - 1) + orig_len) / n_crops)) for i_layer in range(n_layers): n_crops_per_side = 2 ** (i_layer + 1) overlap = int(overlap_ratio * short_side * (2 / n_crops_per_side)) crop_w = crop_len(im_w, n_crops_per_side, overlap) crop_h = crop_len(im_h, n_crops_per_side, overlap) crop_box_x0 = [int((crop_w - overlap) * i) for i in range(n_crops_per_side)] crop_box_y0 = [int((crop_h - overlap) * i) for i in range(n_crops_per_side)] # Crops in XYWH format for x0, y0 in product(crop_box_x0, crop_box_y0): box = [x0, y0, min(x0 + crop_w, im_w), min(y0 + crop_h, im_h)] crop_boxes.append(box) layer_idxs.append(i_layer + 1) return crop_boxes, layer_idxs def uncrop_boxes_xyxy(boxes: torch.Tensor, crop_box: List[int]) -> torch.Tensor: """Uncrop bounding boxes by adding the crop box offset.""" x0, y0, _, _ = crop_box offset = torch.tensor([[x0, y0, x0, y0]], device=boxes.device) # Check if boxes has a channel dimension if len(boxes.shape) == 3: offset = offset.unsqueeze(1) return boxes + offset def uncrop_points(points: torch.Tensor, crop_box: List[int]) -> torch.Tensor: """Uncrop points by adding the crop box offset.""" x0, y0, _, _ = crop_box offset = torch.tensor([[x0, y0]], device=points.device) # Check if points has a channel dimension if len(points.shape) == 3: offset = offset.unsqueeze(1) return points + offset def uncrop_masks(masks: torch.Tensor, crop_box: List[int], orig_h: int, orig_w: int) -> torch.Tensor: """Uncrop masks by padding them to the original image size.""" x0, y0, x1, y1 = crop_box if x0 == 0 and y0 == 0 and x1 == orig_w and y1 == orig_h: return masks # Coordinate transform masks pad_x, pad_y = orig_w - (x1 - x0), orig_h - (y1 - y0) pad = (x0, pad_x - x0, y0, pad_y - y0) return torch.nn.functional.pad(masks, pad, value=0) def remove_small_regions(mask: np.ndarray, area_thresh: float, mode: str) -> Tuple[np.ndarray, bool]: """Remove small disconnected regions or holes in a mask, returning the mask and a modification indicator.""" import cv2 # type: ignore assert mode in {"holes", "islands"} correct_holes = mode == "holes" working_mask = (correct_holes ^ mask).astype(np.uint8) n_labels, regions, stats, _ = cv2.connectedComponentsWithStats(working_mask, 8) sizes = stats[:, -1][1:] # Row 0 is background label small_regions = [i + 1 for i, s in enumerate(sizes) if s < area_thresh] if not small_regions: return mask, False fill_labels = [0] + small_regions if not correct_holes: # If every region is below threshold, keep largest fill_labels = [i for i in range(n_labels) if i not in fill_labels] or [int(np.argmax(sizes)) + 1] mask = np.isin(regions, fill_labels) return mask, True def batched_mask_to_box(masks: torch.Tensor) -> torch.Tensor: """ Calculates boxes in XYXY format around masks. Return [0,0,0,0] for an empty mask. For input shape C1xC2x...xHxW, the output shape is C1xC2x...x4. """ # torch.max below raises an error on empty inputs, just skip in this case if torch.numel(masks) == 0: return torch.zeros(*masks.shape[:-2], 4, device=masks.device) # Normalize shape to CxHxW shape = masks.shape h, w = shape[-2:] masks = masks.flatten(0, -3) if len(shape) > 2 else masks.unsqueeze(0) # Get top and bottom edges in_height, _ = torch.max(masks, dim=-1) in_height_coords = in_height * torch.arange(h, device=in_height.device)[None, :] bottom_edges, _ = torch.max(in_height_coords, dim=-1) in_height_coords = in_height_coords + h * (~in_height) top_edges, _ = torch.min(in_height_coords, dim=-1) # Get left and right edges in_width, _ = torch.max(masks, dim=-2) in_width_coords = in_width * torch.arange(w, device=in_width.device)[None, :] right_edges, _ = torch.max(in_width_coords, dim=-1) in_width_coords = in_width_coords + w * (~in_width) left_edges, _ = torch.min(in_width_coords, dim=-1) # If the mask is empty the right edge will be to the left of the left edge. # Replace these boxes with [0, 0, 0, 0] empty_filter = (right_edges < left_edges) | (bottom_edges < top_edges) out = torch.stack([left_edges, top_edges, right_edges, bottom_edges], dim=-1) out = out * (~empty_filter).unsqueeze(-1) # Return to original shape return out.reshape(*shape[:-2], 4) if len(shape) > 2 else out[0]
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/sam/amg.py
Python
unknown
7,935
# Ultralytics YOLO 🚀, AGPL-3.0 license # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from functools import partial import torch from ultralytics.utils.downloads import attempt_download_asset from .modules.decoders import MaskDecoder from .modules.encoders import ImageEncoderViT, PromptEncoder from .modules.sam import Sam from .modules.tiny_encoder import TinyViT from .modules.transformer import TwoWayTransformer def build_sam_vit_h(checkpoint=None): """Build and return a Segment Anything Model (SAM) h-size model.""" return _build_sam( encoder_embed_dim=1280, encoder_depth=32, encoder_num_heads=16, encoder_global_attn_indexes=[7, 15, 23, 31], checkpoint=checkpoint, ) def build_sam_vit_l(checkpoint=None): """Build and return a Segment Anything Model (SAM) l-size model.""" return _build_sam( encoder_embed_dim=1024, encoder_depth=24, encoder_num_heads=16, encoder_global_attn_indexes=[5, 11, 17, 23], checkpoint=checkpoint, ) def build_sam_vit_b(checkpoint=None): """Build and return a Segment Anything Model (SAM) b-size model.""" return _build_sam( encoder_embed_dim=768, encoder_depth=12, encoder_num_heads=12, encoder_global_attn_indexes=[2, 5, 8, 11], checkpoint=checkpoint, ) def build_mobile_sam(checkpoint=None): """Build and return Mobile Segment Anything Model (Mobile-SAM).""" return _build_sam( encoder_embed_dim=[64, 128, 160, 320], encoder_depth=[2, 2, 6, 2], encoder_num_heads=[2, 4, 5, 10], encoder_global_attn_indexes=None, mobile_sam=True, checkpoint=checkpoint, ) def _build_sam( encoder_embed_dim, encoder_depth, encoder_num_heads, encoder_global_attn_indexes, checkpoint=None, mobile_sam=False ): """Builds the selected SAM model architecture.""" prompt_embed_dim = 256 image_size = 1024 vit_patch_size = 16 image_embedding_size = image_size // vit_patch_size image_encoder = ( TinyViT( img_size=1024, in_chans=3, num_classes=1000, embed_dims=encoder_embed_dim, depths=encoder_depth, num_heads=encoder_num_heads, window_sizes=[7, 7, 14, 7], mlp_ratio=4.0, drop_rate=0.0, drop_path_rate=0.0, use_checkpoint=False, mbconv_expand_ratio=4.0, local_conv_size=3, layer_lr_decay=0.8, ) if mobile_sam else ImageEncoderViT( depth=encoder_depth, embed_dim=encoder_embed_dim, img_size=image_size, mlp_ratio=4, norm_layer=partial(torch.nn.LayerNorm, eps=1e-6), num_heads=encoder_num_heads, patch_size=vit_patch_size, qkv_bias=True, use_rel_pos=True, global_attn_indexes=encoder_global_attn_indexes, window_size=14, out_chans=prompt_embed_dim, ) ) sam = Sam( image_encoder=image_encoder, prompt_encoder=PromptEncoder( embed_dim=prompt_embed_dim, image_embedding_size=(image_embedding_size, image_embedding_size), input_image_size=(image_size, image_size), mask_in_chans=16, ), mask_decoder=MaskDecoder( num_multimask_outputs=3, transformer=TwoWayTransformer( depth=2, embedding_dim=prompt_embed_dim, mlp_dim=2048, num_heads=8, ), transformer_dim=prompt_embed_dim, iou_head_depth=3, iou_head_hidden_dim=256, ), pixel_mean=[123.675, 116.28, 103.53], pixel_std=[58.395, 57.12, 57.375], ) if checkpoint is not None: checkpoint = attempt_download_asset(checkpoint) with open(checkpoint, "rb") as f: state_dict = torch.load(f) sam.load_state_dict(state_dict) sam.eval() # sam.load_state_dict(torch.load(checkpoint), strict=True) # sam.eval() return sam sam_model_map = { "sam_h.pt": build_sam_vit_h, "sam_l.pt": build_sam_vit_l, "sam_b.pt": build_sam_vit_b, "mobile_sam.pt": build_mobile_sam, } def build_sam(ckpt="sam_b.pt"): """Build a SAM model specified by ckpt.""" model_builder = None ckpt = str(ckpt) # to allow Path ckpt types for k in sam_model_map.keys(): if ckpt.endswith(k): model_builder = sam_model_map.get(k) if not model_builder: raise FileNotFoundError(f"{ckpt} is not a supported SAM model. Available models are: \n {sam_model_map.keys()}") return model_builder(ckpt)
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/sam/build.py
Python
unknown
4,943
# Ultralytics YOLO 🚀, AGPL-3.0 license """ SAM model interface. This module provides an interface to the Segment Anything Model (SAM) from Ultralytics, designed for real-time image segmentation tasks. The SAM model allows for promptable segmentation with unparalleled versatility in image analysis, and has been trained on the SA-1B dataset. It features zero-shot performance capabilities, enabling it to adapt to new image distributions and tasks without prior knowledge. Key Features: - Promptable segmentation - Real-time performance - Zero-shot transfer capabilities - Trained on SA-1B dataset """ from pathlib import Path from ultralytics.engine.model import Model from ultralytics.utils.torch_utils import model_info from .build import build_sam from .predict import Predictor class SAM(Model): """ SAM (Segment Anything Model) interface class. SAM is designed for promptable real-time image segmentation. It can be used with a variety of prompts such as bounding boxes, points, or labels. The model has capabilities for zero-shot performance and is trained on the SA-1B dataset. """ def __init__(self, model="sam_b.pt") -> None: """ Initializes the SAM model with a pre-trained model file. Args: model (str): Path to the pre-trained SAM model file. File should have a .pt or .pth extension. Raises: NotImplementedError: If the model file extension is not .pt or .pth. """ if model and Path(model).suffix not in (".pt", ".pth"): raise NotImplementedError("SAM prediction requires pre-trained *.pt or *.pth model.") super().__init__(model=model, task="segment") def _load(self, weights: str, task=None): """ Loads the specified weights into the SAM model. Args: weights (str): Path to the weights file. task (str, optional): Task name. Defaults to None. """ self.model = build_sam(weights) def predict(self, source, stream=False, bboxes=None, points=None, labels=None, **kwargs): """ Performs segmentation prediction on the given image or video source. Args: source (str): Path to the image or video file, or a PIL.Image object, or a numpy.ndarray object. stream (bool, optional): If True, enables real-time streaming. Defaults to False. bboxes (list, optional): List of bounding box coordinates for prompted segmentation. Defaults to None. points (list, optional): List of points for prompted segmentation. Defaults to None. labels (list, optional): List of labels for prompted segmentation. Defaults to None. Returns: (list): The model predictions. """ overrides = dict(conf=0.25, task="segment", mode="predict", imgsz=1024) kwargs.update(overrides) prompts = dict(bboxes=bboxes, points=points, labels=labels) return super().predict(source, stream, prompts=prompts, **kwargs) def __call__(self, source=None, stream=False, bboxes=None, points=None, labels=None, **kwargs): """ Alias for the 'predict' method. Args: source (str): Path to the image or video file, or a PIL.Image object, or a numpy.ndarray object. stream (bool, optional): If True, enables real-time streaming. Defaults to False. bboxes (list, optional): List of bounding box coordinates for prompted segmentation. Defaults to None. points (list, optional): List of points for prompted segmentation. Defaults to None. labels (list, optional): List of labels for prompted segmentation. Defaults to None. Returns: (list): The model predictions. """ return self.predict(source, stream, bboxes, points, labels, **kwargs) def info(self, detailed=False, verbose=True): """ Logs information about the SAM model. Args: detailed (bool, optional): If True, displays detailed information about the model. Defaults to False. verbose (bool, optional): If True, displays information on the console. Defaults to True. Returns: (tuple): A tuple containing the model's information. """ return model_info(self.model, detailed=detailed, verbose=verbose) @property def task_map(self): """ Provides a mapping from the 'segment' task to its corresponding 'Predictor'. Returns: (dict): A dictionary mapping the 'segment' task to its corresponding 'Predictor'. """ return {"segment": {"predictor": Predictor}}
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/sam/model.py
Python
unknown
4,706
# Ultralytics YOLO 🚀, AGPL-3.0 license
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/sam/modules/__init__.py
Python
unknown
42
# Ultralytics YOLO 🚀, AGPL-3.0 license from typing import List, Tuple, Type import torch from torch import nn from torch.nn import functional as F from ultralytics.nn.modules import LayerNorm2d class MaskDecoder(nn.Module): """ Decoder module for generating masks and their associated quality scores, using a transformer architecture to predict masks given image and prompt embeddings. Attributes: transformer_dim (int): Channel dimension for the transformer module. transformer (nn.Module): The transformer module used for mask prediction. num_multimask_outputs (int): Number of masks to predict for disambiguating masks. iou_token (nn.Embedding): Embedding for the IoU token. num_mask_tokens (int): Number of mask tokens. mask_tokens (nn.Embedding): Embedding for the mask tokens. output_upscaling (nn.Sequential): Neural network sequence for upscaling the output. output_hypernetworks_mlps (nn.ModuleList): Hypernetwork MLPs for generating masks. iou_prediction_head (nn.Module): MLP for predicting mask quality. """ def __init__( self, *, transformer_dim: int, transformer: nn.Module, num_multimask_outputs: int = 3, activation: Type[nn.Module] = nn.GELU, iou_head_depth: int = 3, iou_head_hidden_dim: int = 256, ) -> None: """ Predicts masks given an image and prompt embeddings, using a transformer architecture. Args: transformer_dim (int): the channel dimension of the transformer module transformer (nn.Module): the transformer used to predict masks num_multimask_outputs (int): the number of masks to predict when disambiguating masks activation (nn.Module): the type of activation to use when upscaling masks iou_head_depth (int): the depth of the MLP used to predict mask quality iou_head_hidden_dim (int): the hidden dimension of the MLP used to predict mask quality """ super().__init__() self.transformer_dim = transformer_dim self.transformer = transformer self.num_multimask_outputs = num_multimask_outputs self.iou_token = nn.Embedding(1, transformer_dim) self.num_mask_tokens = num_multimask_outputs + 1 self.mask_tokens = nn.Embedding(self.num_mask_tokens, transformer_dim) self.output_upscaling = nn.Sequential( nn.ConvTranspose2d(transformer_dim, transformer_dim // 4, kernel_size=2, stride=2), LayerNorm2d(transformer_dim // 4), activation(), nn.ConvTranspose2d(transformer_dim // 4, transformer_dim // 8, kernel_size=2, stride=2), activation(), ) self.output_hypernetworks_mlps = nn.ModuleList( [MLP(transformer_dim, transformer_dim, transformer_dim // 8, 3) for _ in range(self.num_mask_tokens)] ) self.iou_prediction_head = MLP(transformer_dim, iou_head_hidden_dim, self.num_mask_tokens, iou_head_depth) def forward( self, image_embeddings: torch.Tensor, image_pe: torch.Tensor, sparse_prompt_embeddings: torch.Tensor, dense_prompt_embeddings: torch.Tensor, multimask_output: bool, ) -> Tuple[torch.Tensor, torch.Tensor]: """ Predict masks given image and prompt embeddings. Args: image_embeddings (torch.Tensor): the embeddings from the image encoder image_pe (torch.Tensor): positional encoding with the shape of image_embeddings sparse_prompt_embeddings (torch.Tensor): the embeddings of the points and boxes dense_prompt_embeddings (torch.Tensor): the embeddings of the mask inputs multimask_output (bool): Whether to return multiple masks or a single mask. Returns: torch.Tensor: batched predicted masks torch.Tensor: batched predictions of mask quality """ masks, iou_pred = self.predict_masks( image_embeddings=image_embeddings, image_pe=image_pe, sparse_prompt_embeddings=sparse_prompt_embeddings, dense_prompt_embeddings=dense_prompt_embeddings, ) # Select the correct mask or masks for output mask_slice = slice(1, None) if multimask_output else slice(0, 1) masks = masks[:, mask_slice, :, :] iou_pred = iou_pred[:, mask_slice] # Prepare output return masks, iou_pred def predict_masks( self, image_embeddings: torch.Tensor, image_pe: torch.Tensor, sparse_prompt_embeddings: torch.Tensor, dense_prompt_embeddings: torch.Tensor, ) -> Tuple[torch.Tensor, torch.Tensor]: """ Predicts masks. See 'forward' for more details. """ # Concatenate output tokens output_tokens = torch.cat([self.iou_token.weight, self.mask_tokens.weight], dim=0) output_tokens = output_tokens.unsqueeze(0).expand(sparse_prompt_embeddings.shape[0], -1, -1) tokens = torch.cat((output_tokens, sparse_prompt_embeddings), dim=1) # Expand per-image data in batch direction to be per-mask src = torch.repeat_interleave(image_embeddings, tokens.shape[0], dim=0) src = src + dense_prompt_embeddings pos_src = torch.repeat_interleave(image_pe, tokens.shape[0], dim=0) b, c, h, w = src.shape # Run the transformer hs, src = self.transformer(src, pos_src, tokens) iou_token_out = hs[:, 0, :] mask_tokens_out = hs[:, 1 : (1 + self.num_mask_tokens), :] # Upscale mask embeddings and predict masks using the mask tokens src = src.transpose(1, 2).view(b, c, h, w) upscaled_embedding = self.output_upscaling(src) hyper_in_list: List[torch.Tensor] = [ self.output_hypernetworks_mlps[i](mask_tokens_out[:, i, :]) for i in range(self.num_mask_tokens) ] hyper_in = torch.stack(hyper_in_list, dim=1) b, c, h, w = upscaled_embedding.shape masks = (hyper_in @ upscaled_embedding.view(b, c, h * w)).view(b, -1, h, w) # Generate mask quality predictions iou_pred = self.iou_prediction_head(iou_token_out) return masks, iou_pred class MLP(nn.Module): """ MLP (Multi-Layer Perceptron) model lightly adapted from https://github.com/facebookresearch/MaskFormer/blob/main/mask_former/modeling/transformer/transformer_predictor.py """ def __init__( self, input_dim: int, hidden_dim: int, output_dim: int, num_layers: int, sigmoid_output: bool = False, ) -> None: """ Initializes the MLP (Multi-Layer Perceptron) model. Args: input_dim (int): The dimensionality of the input features. hidden_dim (int): The dimensionality of the hidden layers. output_dim (int): The dimensionality of the output layer. num_layers (int): The number of hidden layers. sigmoid_output (bool, optional): Apply a sigmoid activation to the output layer. Defaults to False. """ super().__init__() self.num_layers = num_layers h = [hidden_dim] * (num_layers - 1) self.layers = nn.ModuleList(nn.Linear(n, k) for n, k in zip([input_dim] + h, h + [output_dim])) self.sigmoid_output = sigmoid_output def forward(self, x): """Executes feedforward within the neural network module and applies activation.""" for i, layer in enumerate(self.layers): x = F.relu(layer(x)) if i < self.num_layers - 1 else layer(x) if self.sigmoid_output: x = torch.sigmoid(x) return x
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/sam/modules/decoders.py
Python
unknown
7,816
# Ultralytics YOLO 🚀, AGPL-3.0 license from typing import Any, Optional, Tuple, Type import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from ultralytics.nn.modules import LayerNorm2d, MLPBlock class ImageEncoderViT(nn.Module): """ An image encoder using Vision Transformer (ViT) architecture for encoding an image into a compact latent space. The encoder takes an image, splits it into patches, and processes these patches through a series of transformer blocks. The encoded patches are then processed through a neck to generate the final encoded representation. This class and its supporting functions below lightly adapted from the ViTDet backbone available at https://github.com/facebookresearch/detectron2/blob/main/detectron2/modeling/backbone/vit.py. Attributes: img_size (int): Dimension of input images, assumed to be square. patch_embed (PatchEmbed): Module for patch embedding. pos_embed (nn.Parameter, optional): Absolute positional embedding for patches. blocks (nn.ModuleList): List of transformer blocks for processing patch embeddings. neck (nn.Sequential): Neck module to further process the output. """ def __init__( self, img_size: int = 1024, patch_size: int = 16, in_chans: int = 3, embed_dim: int = 768, depth: int = 12, num_heads: int = 12, mlp_ratio: float = 4.0, out_chans: int = 256, qkv_bias: bool = True, norm_layer: Type[nn.Module] = nn.LayerNorm, act_layer: Type[nn.Module] = nn.GELU, use_abs_pos: bool = True, use_rel_pos: bool = False, rel_pos_zero_init: bool = True, window_size: int = 0, global_attn_indexes: Tuple[int, ...] = (), ) -> None: """ Args: img_size (int): Input image size. patch_size (int): Patch size. in_chans (int): Number of input image channels. embed_dim (int): Patch embedding dimension. depth (int): Depth of ViT. num_heads (int): Number of attention heads in each ViT block. mlp_ratio (float): Ratio of mlp hidden dim to embedding dim. qkv_bias (bool): If True, add a learnable bias to query, key, value. norm_layer (nn.Module): Normalization layer. act_layer (nn.Module): Activation layer. use_abs_pos (bool): If True, use absolute positional embeddings. use_rel_pos (bool): If True, add relative positional embeddings to the attention map. rel_pos_zero_init (bool): If True, zero initialize relative positional parameters. window_size (int): Window size for window attention blocks. global_attn_indexes (list): Indexes for blocks using global attention. """ super().__init__() self.img_size = img_size self.patch_embed = PatchEmbed( kernel_size=(patch_size, patch_size), stride=(patch_size, patch_size), in_chans=in_chans, embed_dim=embed_dim, ) self.pos_embed: Optional[nn.Parameter] = None if use_abs_pos: # Initialize absolute positional embedding with pretrain image size. self.pos_embed = nn.Parameter(torch.zeros(1, img_size // patch_size, img_size // patch_size, embed_dim)) self.blocks = nn.ModuleList() for i in range(depth): block = Block( dim=embed_dim, num_heads=num_heads, mlp_ratio=mlp_ratio, qkv_bias=qkv_bias, norm_layer=norm_layer, act_layer=act_layer, use_rel_pos=use_rel_pos, rel_pos_zero_init=rel_pos_zero_init, window_size=window_size if i not in global_attn_indexes else 0, input_size=(img_size // patch_size, img_size // patch_size), ) self.blocks.append(block) self.neck = nn.Sequential( nn.Conv2d( embed_dim, out_chans, kernel_size=1, bias=False, ), LayerNorm2d(out_chans), nn.Conv2d( out_chans, out_chans, kernel_size=3, padding=1, bias=False, ), LayerNorm2d(out_chans), ) def forward(self, x: torch.Tensor) -> torch.Tensor: """Processes input through patch embedding, applies positional embedding if present, and passes through blocks and neck. """ x = self.patch_embed(x) if self.pos_embed is not None: x = x + self.pos_embed for blk in self.blocks: x = blk(x) return self.neck(x.permute(0, 3, 1, 2)) class PromptEncoder(nn.Module): """ Encodes different types of prompts, including points, boxes, and masks, for input to SAM's mask decoder. The encoder produces both sparse and dense embeddings for the input prompts. Attributes: embed_dim (int): Dimension of the embeddings. input_image_size (Tuple[int, int]): Size of the input image as (H, W). image_embedding_size (Tuple[int, int]): Spatial size of the image embedding as (H, W). pe_layer (PositionEmbeddingRandom): Module for random position embedding. num_point_embeddings (int): Number of point embeddings for different types of points. point_embeddings (nn.ModuleList): List of point embeddings. not_a_point_embed (nn.Embedding): Embedding for points that are not a part of any label. mask_input_size (Tuple[int, int]): Size of the input mask. mask_downscaling (nn.Sequential): Neural network for downscaling the mask. no_mask_embed (nn.Embedding): Embedding for cases where no mask is provided. """ def __init__( self, embed_dim: int, image_embedding_size: Tuple[int, int], input_image_size: Tuple[int, int], mask_in_chans: int, activation: Type[nn.Module] = nn.GELU, ) -> None: """ Encodes prompts for input to SAM's mask decoder. Args: embed_dim (int): The prompts' embedding dimension image_embedding_size (tuple(int, int)): The spatial size of the image embedding, as (H, W). input_image_size (int): The padded size of the image as input to the image encoder, as (H, W). mask_in_chans (int): The number of hidden channels used for encoding input masks. activation (nn.Module): The activation to use when encoding input masks. """ super().__init__() self.embed_dim = embed_dim self.input_image_size = input_image_size self.image_embedding_size = image_embedding_size self.pe_layer = PositionEmbeddingRandom(embed_dim // 2) self.num_point_embeddings: int = 4 # pos/neg point + 2 box corners point_embeddings = [nn.Embedding(1, embed_dim) for _ in range(self.num_point_embeddings)] self.point_embeddings = nn.ModuleList(point_embeddings) self.not_a_point_embed = nn.Embedding(1, embed_dim) self.mask_input_size = (4 * image_embedding_size[0], 4 * image_embedding_size[1]) self.mask_downscaling = nn.Sequential( nn.Conv2d(1, mask_in_chans // 4, kernel_size=2, stride=2), LayerNorm2d(mask_in_chans // 4), activation(), nn.Conv2d(mask_in_chans // 4, mask_in_chans, kernel_size=2, stride=2), LayerNorm2d(mask_in_chans), activation(), nn.Conv2d(mask_in_chans, embed_dim, kernel_size=1), ) self.no_mask_embed = nn.Embedding(1, embed_dim) def get_dense_pe(self) -> torch.Tensor: """ Returns the positional encoding used to encode point prompts, applied to a dense set of points the shape of the image encoding. Returns: torch.Tensor: Positional encoding with shape 1x(embed_dim)x(embedding_h)x(embedding_w) """ return self.pe_layer(self.image_embedding_size).unsqueeze(0) def _embed_points(self, points: torch.Tensor, labels: torch.Tensor, pad: bool) -> torch.Tensor: """Embeds point prompts.""" points = points + 0.5 # Shift to center of pixel if pad: padding_point = torch.zeros((points.shape[0], 1, 2), device=points.device) padding_label = -torch.ones((labels.shape[0], 1), device=labels.device) points = torch.cat([points, padding_point], dim=1) labels = torch.cat([labels, padding_label], dim=1) point_embedding = self.pe_layer.forward_with_coords(points, self.input_image_size) point_embedding[labels == -1] = 0.0 point_embedding[labels == -1] += self.not_a_point_embed.weight point_embedding[labels == 0] += self.point_embeddings[0].weight point_embedding[labels == 1] += self.point_embeddings[1].weight return point_embedding def _embed_boxes(self, boxes: torch.Tensor) -> torch.Tensor: """Embeds box prompts.""" boxes = boxes + 0.5 # Shift to center of pixel coords = boxes.reshape(-1, 2, 2) corner_embedding = self.pe_layer.forward_with_coords(coords, self.input_image_size) corner_embedding[:, 0, :] += self.point_embeddings[2].weight corner_embedding[:, 1, :] += self.point_embeddings[3].weight return corner_embedding def _embed_masks(self, masks: torch.Tensor) -> torch.Tensor: """Embeds mask inputs.""" return self.mask_downscaling(masks) def _get_batch_size( self, points: Optional[Tuple[torch.Tensor, torch.Tensor]], boxes: Optional[torch.Tensor], masks: Optional[torch.Tensor], ) -> int: """Gets the batch size of the output given the batch size of the input prompts.""" if points is not None: return points[0].shape[0] elif boxes is not None: return boxes.shape[0] elif masks is not None: return masks.shape[0] else: return 1 def _get_device(self) -> torch.device: """Returns the device of the first point embedding's weight tensor.""" return self.point_embeddings[0].weight.device def forward( self, points: Optional[Tuple[torch.Tensor, torch.Tensor]], boxes: Optional[torch.Tensor], masks: Optional[torch.Tensor], ) -> Tuple[torch.Tensor, torch.Tensor]: """ Embeds different types of prompts, returning both sparse and dense embeddings. Args: points (tuple(torch.Tensor, torch.Tensor), None): point coordinates and labels to embed. boxes (torch.Tensor, None): boxes to embed masks (torch.Tensor, None): masks to embed Returns: torch.Tensor: sparse embeddings for the points and boxes, with shape BxNx(embed_dim), where N is determined by the number of input points and boxes. torch.Tensor: dense embeddings for the masks, in the shape Bx(embed_dim)x(embed_H)x(embed_W) """ bs = self._get_batch_size(points, boxes, masks) sparse_embeddings = torch.empty((bs, 0, self.embed_dim), device=self._get_device()) if points is not None: coords, labels = points point_embeddings = self._embed_points(coords, labels, pad=(boxes is None)) sparse_embeddings = torch.cat([sparse_embeddings, point_embeddings], dim=1) if boxes is not None: box_embeddings = self._embed_boxes(boxes) sparse_embeddings = torch.cat([sparse_embeddings, box_embeddings], dim=1) if masks is not None: dense_embeddings = self._embed_masks(masks) else: dense_embeddings = self.no_mask_embed.weight.reshape(1, -1, 1, 1).expand( bs, -1, self.image_embedding_size[0], self.image_embedding_size[1] ) return sparse_embeddings, dense_embeddings class PositionEmbeddingRandom(nn.Module): """Positional encoding using random spatial frequencies.""" def __init__(self, num_pos_feats: int = 64, scale: Optional[float] = None) -> None: """Initializes a position embedding using random spatial frequencies.""" super().__init__() if scale is None or scale <= 0.0: scale = 1.0 self.register_buffer("positional_encoding_gaussian_matrix", scale * torch.randn((2, num_pos_feats))) # Set non-deterministic for forward() error 'cumsum_cuda_kernel does not have a deterministic implementation' torch.use_deterministic_algorithms(False) torch.backends.cudnn.deterministic = False def _pe_encoding(self, coords: torch.Tensor) -> torch.Tensor: """Positionally encode points that are normalized to [0,1].""" # Assuming coords are in [0, 1]^2 square and have d_1 x ... x d_n x 2 shape coords = 2 * coords - 1 coords = coords @ self.positional_encoding_gaussian_matrix coords = 2 * np.pi * coords # Outputs d_1 x ... x d_n x C shape return torch.cat([torch.sin(coords), torch.cos(coords)], dim=-1) def forward(self, size: Tuple[int, int]) -> torch.Tensor: """Generate positional encoding for a grid of the specified size.""" h, w = size device: Any = self.positional_encoding_gaussian_matrix.device grid = torch.ones((h, w), device=device, dtype=torch.float32) y_embed = grid.cumsum(dim=0) - 0.5 x_embed = grid.cumsum(dim=1) - 0.5 y_embed = y_embed / h x_embed = x_embed / w pe = self._pe_encoding(torch.stack([x_embed, y_embed], dim=-1)) return pe.permute(2, 0, 1) # C x H x W def forward_with_coords(self, coords_input: torch.Tensor, image_size: Tuple[int, int]) -> torch.Tensor: """Positionally encode points that are not normalized to [0,1].""" coords = coords_input.clone() coords[:, :, 0] = coords[:, :, 0] / image_size[1] coords[:, :, 1] = coords[:, :, 1] / image_size[0] return self._pe_encoding(coords.to(torch.float)) # B x N x C class Block(nn.Module): """Transformer blocks with support of window attention and residual propagation blocks.""" def __init__( self, dim: int, num_heads: int, mlp_ratio: float = 4.0, qkv_bias: bool = True, norm_layer: Type[nn.Module] = nn.LayerNorm, act_layer: Type[nn.Module] = nn.GELU, use_rel_pos: bool = False, rel_pos_zero_init: bool = True, window_size: int = 0, input_size: Optional[Tuple[int, int]] = None, ) -> None: """ Args: dim (int): Number of input channels. num_heads (int): Number of attention heads in each ViT block. mlp_ratio (float): Ratio of mlp hidden dim to embedding dim. qkv_bias (bool): If True, add a learnable bias to query, key, value. norm_layer (nn.Module): Normalization layer. act_layer (nn.Module): Activation layer. use_rel_pos (bool): If True, add relative positional embeddings to the attention map. rel_pos_zero_init (bool): If True, zero initialize relative positional parameters. window_size (int): Window size for window attention blocks. If it equals 0, then use global attention. input_size (tuple(int, int), None): Input resolution for calculating the relative positional parameter size. """ super().__init__() self.norm1 = norm_layer(dim) self.attn = Attention( dim, num_heads=num_heads, qkv_bias=qkv_bias, use_rel_pos=use_rel_pos, rel_pos_zero_init=rel_pos_zero_init, input_size=input_size if window_size == 0 else (window_size, window_size), ) self.norm2 = norm_layer(dim) self.mlp = MLPBlock(embedding_dim=dim, mlp_dim=int(dim * mlp_ratio), act=act_layer) self.window_size = window_size def forward(self, x: torch.Tensor) -> torch.Tensor: """Executes a forward pass through the transformer block with window attention and non-overlapping windows.""" shortcut = x x = self.norm1(x) # Window partition if self.window_size > 0: H, W = x.shape[1], x.shape[2] x, pad_hw = window_partition(x, self.window_size) x = self.attn(x) # Reverse window partition if self.window_size > 0: x = window_unpartition(x, self.window_size, pad_hw, (H, W)) x = shortcut + x return x + self.mlp(self.norm2(x)) class Attention(nn.Module): """Multi-head Attention block with relative position embeddings.""" def __init__( self, dim: int, num_heads: int = 8, qkv_bias: bool = True, use_rel_pos: bool = False, rel_pos_zero_init: bool = True, input_size: Optional[Tuple[int, int]] = None, ) -> None: """ Initialize Attention module. Args: dim (int): Number of input channels. num_heads (int): Number of attention heads. qkv_bias (bool): If True, add a learnable bias to query, key, value. rel_pos_zero_init (bool): If True, zero initialize relative positional parameters. input_size (tuple(int, int), None): Input resolution for calculating the relative positional parameter size. """ super().__init__() self.num_heads = num_heads head_dim = dim // num_heads self.scale = head_dim**-0.5 self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias) self.proj = nn.Linear(dim, dim) self.use_rel_pos = use_rel_pos if self.use_rel_pos: assert input_size is not None, "Input size must be provided if using relative positional encoding." # Initialize relative positional embeddings self.rel_pos_h = nn.Parameter(torch.zeros(2 * input_size[0] - 1, head_dim)) self.rel_pos_w = nn.Parameter(torch.zeros(2 * input_size[1] - 1, head_dim)) def forward(self, x: torch.Tensor) -> torch.Tensor: """Applies the forward operation including attention, normalization, MLP, and indexing within window limits.""" B, H, W, _ = x.shape # qkv with shape (3, B, nHead, H * W, C) qkv = self.qkv(x).reshape(B, H * W, 3, self.num_heads, -1).permute(2, 0, 3, 1, 4) # q, k, v with shape (B * nHead, H * W, C) q, k, v = qkv.reshape(3, B * self.num_heads, H * W, -1).unbind(0) attn = (q * self.scale) @ k.transpose(-2, -1) if self.use_rel_pos: attn = add_decomposed_rel_pos(attn, q, self.rel_pos_h, self.rel_pos_w, (H, W), (H, W)) attn = attn.softmax(dim=-1) x = (attn @ v).view(B, self.num_heads, H, W, -1).permute(0, 2, 3, 1, 4).reshape(B, H, W, -1) return self.proj(x) def window_partition(x: torch.Tensor, window_size: int) -> Tuple[torch.Tensor, Tuple[int, int]]: """ Partition into non-overlapping windows with padding if needed. Args: x (tensor): input tokens with [B, H, W, C]. window_size (int): window size. Returns: windows: windows after partition with [B * num_windows, window_size, window_size, C]. (Hp, Wp): padded height and width before partition """ B, H, W, C = x.shape pad_h = (window_size - H % window_size) % window_size pad_w = (window_size - W % window_size) % window_size if pad_h > 0 or pad_w > 0: x = F.pad(x, (0, 0, 0, pad_w, 0, pad_h)) Hp, Wp = H + pad_h, W + pad_w x = x.view(B, Hp // window_size, window_size, Wp // window_size, window_size, C) windows = x.permute(0, 1, 3, 2, 4, 5).contiguous().view(-1, window_size, window_size, C) return windows, (Hp, Wp) def window_unpartition( windows: torch.Tensor, window_size: int, pad_hw: Tuple[int, int], hw: Tuple[int, int] ) -> torch.Tensor: """ Window unpartition into original sequences and removing padding. Args: windows (tensor): input tokens with [B * num_windows, window_size, window_size, C]. window_size (int): window size. pad_hw (Tuple): padded height and width (Hp, Wp). hw (Tuple): original height and width (H, W) before padding. Returns: x: unpartitioned sequences with [B, H, W, C]. """ Hp, Wp = pad_hw H, W = hw B = windows.shape[0] // (Hp * Wp // window_size // window_size) x = windows.view(B, Hp // window_size, Wp // window_size, window_size, window_size, -1) x = x.permute(0, 1, 3, 2, 4, 5).contiguous().view(B, Hp, Wp, -1) if Hp > H or Wp > W: x = x[:, :H, :W, :].contiguous() return x def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torch.Tensor: """ Get relative positional embeddings according to the relative positions of query and key sizes. Args: q_size (int): size of query q. k_size (int): size of key k. rel_pos (Tensor): relative position embeddings (L, C). Returns: Extracted positional embeddings according to relative positions. """ max_rel_dist = int(2 * max(q_size, k_size) - 1) # Interpolate rel pos if needed. if rel_pos.shape[0] != max_rel_dist: # Interpolate rel pos. rel_pos_resized = F.interpolate( rel_pos.reshape(1, rel_pos.shape[0], -1).permute(0, 2, 1), size=max_rel_dist, mode="linear", ) rel_pos_resized = rel_pos_resized.reshape(-1, max_rel_dist).permute(1, 0) else: rel_pos_resized = rel_pos # Scale the coords with short length if shapes for q and k are different. q_coords = torch.arange(q_size)[:, None] * max(k_size / q_size, 1.0) k_coords = torch.arange(k_size)[None, :] * max(q_size / k_size, 1.0) relative_coords = (q_coords - k_coords) + (k_size - 1) * max(q_size / k_size, 1.0) return rel_pos_resized[relative_coords.long()] def add_decomposed_rel_pos( attn: torch.Tensor, q: torch.Tensor, rel_pos_h: torch.Tensor, rel_pos_w: torch.Tensor, q_size: Tuple[int, int], k_size: Tuple[int, int], ) -> torch.Tensor: """ Calculate decomposed Relative Positional Embeddings from mvitv2 paper at https://github.com/facebookresearch/mvit/blob/main/mvit/models/attention.py. Args: attn (Tensor): attention map. q (Tensor): query q in the attention layer with shape (B, q_h * q_w, C). rel_pos_h (Tensor): relative position embeddings (Lh, C) for height axis. rel_pos_w (Tensor): relative position embeddings (Lw, C) for width axis. q_size (Tuple): spatial sequence size of query q with (q_h, q_w). k_size (Tuple): spatial sequence size of key k with (k_h, k_w). Returns: attn (Tensor): attention map with added relative positional embeddings. """ q_h, q_w = q_size k_h, k_w = k_size Rh = get_rel_pos(q_h, k_h, rel_pos_h) Rw = get_rel_pos(q_w, k_w, rel_pos_w) B, _, dim = q.shape r_q = q.reshape(B, q_h, q_w, dim) rel_h = torch.einsum("bhwc,hkc->bhwk", r_q, Rh) rel_w = torch.einsum("bhwc,wkc->bhwk", r_q, Rw) attn = (attn.view(B, q_h, q_w, k_h, k_w) + rel_h[:, :, :, :, None] + rel_w[:, :, :, None, :]).view( B, q_h * q_w, k_h * k_w ) return attn class PatchEmbed(nn.Module): """Image to Patch Embedding.""" def __init__( self, kernel_size: Tuple[int, int] = (16, 16), stride: Tuple[int, int] = (16, 16), padding: Tuple[int, int] = (0, 0), in_chans: int = 3, embed_dim: int = 768, ) -> None: """ Initialize PatchEmbed module. Args: kernel_size (Tuple): kernel size of the projection layer. stride (Tuple): stride of the projection layer. padding (Tuple): padding size of the projection layer. in_chans (int): Number of input image channels. embed_dim (int): Patch embedding dimension. """ super().__init__() self.proj = nn.Conv2d(in_chans, embed_dim, kernel_size=kernel_size, stride=stride, padding=padding) def forward(self, x: torch.Tensor) -> torch.Tensor: """Computes patch embedding by applying convolution and transposing resulting tensor.""" return self.proj(x).permute(0, 2, 3, 1) # B C H W -> B H W C
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/sam/modules/encoders.py
Python
unknown
24,746
# Ultralytics YOLO 🚀, AGPL-3.0 license # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from typing import List import torch from torch import nn from .decoders import MaskDecoder from .encoders import ImageEncoderViT, PromptEncoder class Sam(nn.Module): """ Sam (Segment Anything Model) is designed for object segmentation tasks. It uses image encoders to generate image embeddings, and prompt encoders to encode various types of input prompts. These embeddings are then used by the mask decoder to predict object masks. Attributes: mask_threshold (float): Threshold value for mask prediction. image_format (str): Format of the input image, default is 'RGB'. image_encoder (ImageEncoderViT): The backbone used to encode the image into embeddings. prompt_encoder (PromptEncoder): Encodes various types of input prompts. mask_decoder (MaskDecoder): Predicts object masks from the image and prompt embeddings. pixel_mean (List[float]): Mean pixel values for image normalization. pixel_std (List[float]): Standard deviation values for image normalization. """ mask_threshold: float = 0.0 image_format: str = "RGB" def __init__( self, image_encoder: ImageEncoderViT, prompt_encoder: PromptEncoder, mask_decoder: MaskDecoder, pixel_mean: List[float] = (123.675, 116.28, 103.53), pixel_std: List[float] = (58.395, 57.12, 57.375), ) -> None: """ Initialize the Sam class to predict object masks from an image and input prompts. Note: All forward() operations moved to SAMPredictor. Args: image_encoder (ImageEncoderViT): The backbone used to encode the image into image embeddings. prompt_encoder (PromptEncoder): Encodes various types of input prompts. mask_decoder (MaskDecoder): Predicts masks from the image embeddings and encoded prompts. pixel_mean (List[float], optional): Mean values for normalizing pixels in the input image. Defaults to (123.675, 116.28, 103.53). pixel_std (List[float], optional): Std values for normalizing pixels in the input image. Defaults to (58.395, 57.12, 57.375). """ super().__init__() self.image_encoder = image_encoder self.prompt_encoder = prompt_encoder self.mask_decoder = mask_decoder self.register_buffer("pixel_mean", torch.Tensor(pixel_mean).view(-1, 1, 1), False) self.register_buffer("pixel_std", torch.Tensor(pixel_std).view(-1, 1, 1), False)
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/sam/modules/sam.py
Python
unknown
2,783
# Ultralytics YOLO 🚀, AGPL-3.0 license # -------------------------------------------------------- # TinyViT Model Architecture # Copyright (c) 2022 Microsoft # Adapted from LeViT and Swin Transformer # LeViT: (https://github.com/facebookresearch/levit) # Swin: (https://github.com/microsoft/swin-transformer) # Build the TinyViT Model # -------------------------------------------------------- import itertools from typing import Tuple import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint as checkpoint from ultralytics.utils.instance import to_2tuple class Conv2d_BN(torch.nn.Sequential): """A sequential container that performs 2D convolution followed by batch normalization.""" def __init__(self, a, b, ks=1, stride=1, pad=0, dilation=1, groups=1, bn_weight_init=1): """Initializes the MBConv model with given input channels, output channels, expansion ratio, activation, and drop path. """ super().__init__() self.add_module("c", torch.nn.Conv2d(a, b, ks, stride, pad, dilation, groups, bias=False)) bn = torch.nn.BatchNorm2d(b) torch.nn.init.constant_(bn.weight, bn_weight_init) torch.nn.init.constant_(bn.bias, 0) self.add_module("bn", bn) class PatchEmbed(nn.Module): """Embeds images into patches and projects them into a specified embedding dimension.""" def __init__(self, in_chans, embed_dim, resolution, activation): """Initialize the PatchMerging class with specified input, output dimensions, resolution and activation function. """ super().__init__() img_size: Tuple[int, int] = to_2tuple(resolution) self.patches_resolution = (img_size[0] // 4, img_size[1] // 4) self.num_patches = self.patches_resolution[0] * self.patches_resolution[1] self.in_chans = in_chans self.embed_dim = embed_dim n = embed_dim self.seq = nn.Sequential( Conv2d_BN(in_chans, n // 2, 3, 2, 1), activation(), Conv2d_BN(n // 2, n, 3, 2, 1), ) def forward(self, x): """Runs input tensor 'x' through the PatchMerging model's sequence of operations.""" return self.seq(x) class MBConv(nn.Module): """Mobile Inverted Bottleneck Conv (MBConv) layer, part of the EfficientNet architecture.""" def __init__(self, in_chans, out_chans, expand_ratio, activation, drop_path): """Initializes a convolutional layer with specified dimensions, input resolution, depth, and activation function. """ super().__init__() self.in_chans = in_chans self.hidden_chans = int(in_chans * expand_ratio) self.out_chans = out_chans self.conv1 = Conv2d_BN(in_chans, self.hidden_chans, ks=1) self.act1 = activation() self.conv2 = Conv2d_BN(self.hidden_chans, self.hidden_chans, ks=3, stride=1, pad=1, groups=self.hidden_chans) self.act2 = activation() self.conv3 = Conv2d_BN(self.hidden_chans, out_chans, ks=1, bn_weight_init=0.0) self.act3 = activation() # NOTE: `DropPath` is needed only for training. # self.drop_path = DropPath(drop_path) if drop_path > 0. else nn.Identity() self.drop_path = nn.Identity() def forward(self, x): """Implements the forward pass for the model architecture.""" shortcut = x x = self.conv1(x) x = self.act1(x) x = self.conv2(x) x = self.act2(x) x = self.conv3(x) x = self.drop_path(x) x += shortcut return self.act3(x) class PatchMerging(nn.Module): """Merges neighboring patches in the feature map and projects to a new dimension.""" def __init__(self, input_resolution, dim, out_dim, activation): """Initializes the ConvLayer with specific dimension, input resolution, depth, activation, drop path, and other optional parameters. """ super().__init__() self.input_resolution = input_resolution self.dim = dim self.out_dim = out_dim self.act = activation() self.conv1 = Conv2d_BN(dim, out_dim, 1, 1, 0) stride_c = 1 if out_dim in [320, 448, 576] else 2 self.conv2 = Conv2d_BN(out_dim, out_dim, 3, stride_c, 1, groups=out_dim) self.conv3 = Conv2d_BN(out_dim, out_dim, 1, 1, 0) def forward(self, x): """Applies forward pass on the input utilizing convolution and activation layers, and returns the result.""" if x.ndim == 3: H, W = self.input_resolution B = len(x) # (B, C, H, W) x = x.view(B, H, W, -1).permute(0, 3, 1, 2) x = self.conv1(x) x = self.act(x) x = self.conv2(x) x = self.act(x) x = self.conv3(x) return x.flatten(2).transpose(1, 2) class ConvLayer(nn.Module): """ Convolutional Layer featuring multiple MobileNetV3-style inverted bottleneck convolutions (MBConv). Optionally applies downsample operations to the output, and provides support for gradient checkpointing. """ def __init__( self, dim, input_resolution, depth, activation, drop_path=0.0, downsample=None, use_checkpoint=False, out_dim=None, conv_expand_ratio=4.0, ): """ Initializes the ConvLayer with the given dimensions and settings. Args: dim (int): The dimensionality of the input and output. input_resolution (Tuple[int, int]): The resolution of the input image. depth (int): The number of MBConv layers in the block. activation (Callable): Activation function applied after each convolution. drop_path (Union[float, List[float]]): Drop path rate. Single float or a list of floats for each MBConv. downsample (Optional[Callable]): Function for downsampling the output. None to skip downsampling. use_checkpoint (bool): Whether to use gradient checkpointing to save memory. out_dim (Optional[int]): The dimensionality of the output. None means it will be the same as `dim`. conv_expand_ratio (float): Expansion ratio for the MBConv layers. """ super().__init__() self.dim = dim self.input_resolution = input_resolution self.depth = depth self.use_checkpoint = use_checkpoint # Build blocks self.blocks = nn.ModuleList( [ MBConv( dim, dim, conv_expand_ratio, activation, drop_path[i] if isinstance(drop_path, list) else drop_path, ) for i in range(depth) ] ) # Patch merging layer self.downsample = ( None if downsample is None else downsample(input_resolution, dim=dim, out_dim=out_dim, activation=activation) ) def forward(self, x): """Processes the input through a series of convolutional layers and returns the activated output.""" for blk in self.blocks: x = checkpoint.checkpoint(blk, x) if self.use_checkpoint else blk(x) return x if self.downsample is None else self.downsample(x) class Mlp(nn.Module): """ Multi-layer Perceptron (MLP) for transformer architectures. This layer takes an input with in_features, applies layer normalization and two fully-connected layers. """ def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0): """Initializes Attention module with the given parameters including dimension, key_dim, number of heads, etc.""" super().__init__() out_features = out_features or in_features hidden_features = hidden_features or in_features self.norm = nn.LayerNorm(in_features) self.fc1 = nn.Linear(in_features, hidden_features) self.fc2 = nn.Linear(hidden_features, out_features) self.act = act_layer() self.drop = nn.Dropout(drop) def forward(self, x): """Applies operations on input x and returns modified x, runs downsample if not None.""" x = self.norm(x) x = self.fc1(x) x = self.act(x) x = self.drop(x) x = self.fc2(x) return self.drop(x) class Attention(torch.nn.Module): """ Multi-head attention module with support for spatial awareness, applying attention biases based on spatial resolution. Implements trainable attention biases for each unique offset between spatial positions in the resolution grid. Attributes: ab (Tensor, optional): Cached attention biases for inference, deleted during training. """ def __init__( self, dim, key_dim, num_heads=8, attn_ratio=4, resolution=(14, 14), ): """ Initializes the Attention module. Args: dim (int): The dimensionality of the input and output. key_dim (int): The dimensionality of the keys and queries. num_heads (int, optional): Number of attention heads. Default is 8. attn_ratio (float, optional): Attention ratio, affecting the dimensions of the value vectors. Default is 4. resolution (Tuple[int, int], optional): Spatial resolution of the input feature map. Default is (14, 14). Raises: AssertionError: If `resolution` is not a tuple of length 2. """ super().__init__() assert isinstance(resolution, tuple) and len(resolution) == 2 self.num_heads = num_heads self.scale = key_dim**-0.5 self.key_dim = key_dim self.nh_kd = nh_kd = key_dim * num_heads self.d = int(attn_ratio * key_dim) self.dh = int(attn_ratio * key_dim) * num_heads self.attn_ratio = attn_ratio h = self.dh + nh_kd * 2 self.norm = nn.LayerNorm(dim) self.qkv = nn.Linear(dim, h) self.proj = nn.Linear(self.dh, dim) points = list(itertools.product(range(resolution[0]), range(resolution[1]))) N = len(points) attention_offsets = {} idxs = [] for p1 in points: for p2 in points: offset = (abs(p1[0] - p2[0]), abs(p1[1] - p2[1])) if offset not in attention_offsets: attention_offsets[offset] = len(attention_offsets) idxs.append(attention_offsets[offset]) self.attention_biases = torch.nn.Parameter(torch.zeros(num_heads, len(attention_offsets))) self.register_buffer("attention_bias_idxs", torch.LongTensor(idxs).view(N, N), persistent=False) @torch.no_grad() def train(self, mode=True): """Sets the module in training mode and handles attribute 'ab' based on the mode.""" super().train(mode) if mode and hasattr(self, "ab"): del self.ab else: self.ab = self.attention_biases[:, self.attention_bias_idxs] def forward(self, x): # x """Performs forward pass over the input tensor 'x' by applying normalization and querying keys/values.""" B, N, _ = x.shape # B, N, C # Normalization x = self.norm(x) qkv = self.qkv(x) # (B, N, num_heads, d) q, k, v = qkv.view(B, N, self.num_heads, -1).split([self.key_dim, self.key_dim, self.d], dim=3) # (B, num_heads, N, d) q = q.permute(0, 2, 1, 3) k = k.permute(0, 2, 1, 3) v = v.permute(0, 2, 1, 3) self.ab = self.ab.to(self.attention_biases.device) attn = (q @ k.transpose(-2, -1)) * self.scale + ( self.attention_biases[:, self.attention_bias_idxs] if self.training else self.ab ) attn = attn.softmax(dim=-1) x = (attn @ v).transpose(1, 2).reshape(B, N, self.dh) return self.proj(x) class TinyViTBlock(nn.Module): """TinyViT Block that applies self-attention and a local convolution to the input.""" def __init__( self, dim, input_resolution, num_heads, window_size=7, mlp_ratio=4.0, drop=0.0, drop_path=0.0, local_conv_size=3, activation=nn.GELU, ): """ Initializes the TinyViTBlock. Args: dim (int): The dimensionality of the input and output. input_resolution (Tuple[int, int]): Spatial resolution of the input feature map. num_heads (int): Number of attention heads. window_size (int, optional): Window size for attention. Default is 7. mlp_ratio (float, optional): Ratio of mlp hidden dim to embedding dim. Default is 4. drop (float, optional): Dropout rate. Default is 0. drop_path (float, optional): Stochastic depth rate. Default is 0. local_conv_size (int, optional): The kernel size of the local convolution. Default is 3. activation (torch.nn, optional): Activation function for MLP. Default is nn.GELU. Raises: AssertionError: If `window_size` is not greater than 0. AssertionError: If `dim` is not divisible by `num_heads`. """ super().__init__() self.dim = dim self.input_resolution = input_resolution self.num_heads = num_heads assert window_size > 0, "window_size must be greater than 0" self.window_size = window_size self.mlp_ratio = mlp_ratio # NOTE: `DropPath` is needed only for training. # self.drop_path = DropPath(drop_path) if drop_path > 0. else nn.Identity() self.drop_path = nn.Identity() assert dim % num_heads == 0, "dim must be divisible by num_heads" head_dim = dim // num_heads window_resolution = (window_size, window_size) self.attn = Attention(dim, head_dim, num_heads, attn_ratio=1, resolution=window_resolution) mlp_hidden_dim = int(dim * mlp_ratio) mlp_activation = activation self.mlp = Mlp(in_features=dim, hidden_features=mlp_hidden_dim, act_layer=mlp_activation, drop=drop) pad = local_conv_size // 2 self.local_conv = Conv2d_BN(dim, dim, ks=local_conv_size, stride=1, pad=pad, groups=dim) def forward(self, x): """Applies attention-based transformation or padding to input 'x' before passing it through a local convolution. """ H, W = self.input_resolution B, L, C = x.shape assert L == H * W, "input feature has wrong size" res_x = x if H == self.window_size and W == self.window_size: x = self.attn(x) else: x = x.view(B, H, W, C) pad_b = (self.window_size - H % self.window_size) % self.window_size pad_r = (self.window_size - W % self.window_size) % self.window_size padding = pad_b > 0 or pad_r > 0 if padding: x = F.pad(x, (0, 0, 0, pad_r, 0, pad_b)) pH, pW = H + pad_b, W + pad_r nH = pH // self.window_size nW = pW // self.window_size # Window partition x = ( x.view(B, nH, self.window_size, nW, self.window_size, C) .transpose(2, 3) .reshape(B * nH * nW, self.window_size * self.window_size, C) ) x = self.attn(x) # Window reverse x = x.view(B, nH, nW, self.window_size, self.window_size, C).transpose(2, 3).reshape(B, pH, pW, C) if padding: x = x[:, :H, :W].contiguous() x = x.view(B, L, C) x = res_x + self.drop_path(x) x = x.transpose(1, 2).reshape(B, C, H, W) x = self.local_conv(x) x = x.view(B, C, L).transpose(1, 2) return x + self.drop_path(self.mlp(x)) def extra_repr(self) -> str: """Returns a formatted string representing the TinyViTBlock's parameters: dimension, input resolution, number of attentions heads, window size, and MLP ratio. """ return ( f"dim={self.dim}, input_resolution={self.input_resolution}, num_heads={self.num_heads}, " f"window_size={self.window_size}, mlp_ratio={self.mlp_ratio}" ) class BasicLayer(nn.Module): """A basic TinyViT layer for one stage in a TinyViT architecture.""" def __init__( self, dim, input_resolution, depth, num_heads, window_size, mlp_ratio=4.0, drop=0.0, drop_path=0.0, downsample=None, use_checkpoint=False, local_conv_size=3, activation=nn.GELU, out_dim=None, ): """ Initializes the BasicLayer. Args: dim (int): The dimensionality of the input and output. input_resolution (Tuple[int, int]): Spatial resolution of the input feature map. depth (int): Number of TinyViT blocks. num_heads (int): Number of attention heads. window_size (int): Local window size. mlp_ratio (float, optional): Ratio of mlp hidden dim to embedding dim. Default is 4. drop (float, optional): Dropout rate. Default is 0. drop_path (float | tuple[float], optional): Stochastic depth rate. Default is 0. downsample (nn.Module | None, optional): Downsample layer at the end of the layer. Default is None. use_checkpoint (bool, optional): Whether to use checkpointing to save memory. Default is False. local_conv_size (int, optional): Kernel size of the local convolution. Default is 3. activation (torch.nn, optional): Activation function for MLP. Default is nn.GELU. out_dim (int | None, optional): The output dimension of the layer. Default is None. Raises: ValueError: If `drop_path` is a list of float but its length doesn't match `depth`. """ super().__init__() self.dim = dim self.input_resolution = input_resolution self.depth = depth self.use_checkpoint = use_checkpoint # Build blocks self.blocks = nn.ModuleList( [ TinyViTBlock( dim=dim, input_resolution=input_resolution, num_heads=num_heads, window_size=window_size, mlp_ratio=mlp_ratio, drop=drop, drop_path=drop_path[i] if isinstance(drop_path, list) else drop_path, local_conv_size=local_conv_size, activation=activation, ) for i in range(depth) ] ) # Patch merging layer self.downsample = ( None if downsample is None else downsample(input_resolution, dim=dim, out_dim=out_dim, activation=activation) ) def forward(self, x): """Performs forward propagation on the input tensor and returns a normalized tensor.""" for blk in self.blocks: x = checkpoint.checkpoint(blk, x) if self.use_checkpoint else blk(x) return x if self.downsample is None else self.downsample(x) def extra_repr(self) -> str: """Returns a string representation of the extra_repr function with the layer's parameters.""" return f"dim={self.dim}, input_resolution={self.input_resolution}, depth={self.depth}" class LayerNorm2d(nn.Module): """A PyTorch implementation of Layer Normalization in 2D.""" def __init__(self, num_channels: int, eps: float = 1e-6) -> None: """Initialize LayerNorm2d with the number of channels and an optional epsilon.""" super().__init__() self.weight = nn.Parameter(torch.ones(num_channels)) self.bias = nn.Parameter(torch.zeros(num_channels)) self.eps = eps def forward(self, x: torch.Tensor) -> torch.Tensor: """Perform a forward pass, normalizing the input tensor.""" u = x.mean(1, keepdim=True) s = (x - u).pow(2).mean(1, keepdim=True) x = (x - u) / torch.sqrt(s + self.eps) return self.weight[:, None, None] * x + self.bias[:, None, None] class TinyViT(nn.Module): """ The TinyViT architecture for vision tasks. Attributes: img_size (int): Input image size. in_chans (int): Number of input channels. num_classes (int): Number of classification classes. embed_dims (List[int]): List of embedding dimensions for each layer. depths (List[int]): List of depths for each layer. num_heads (List[int]): List of number of attention heads for each layer. window_sizes (List[int]): List of window sizes for each layer. mlp_ratio (float): Ratio of MLP hidden dimension to embedding dimension. drop_rate (float): Dropout rate for drop layers. drop_path_rate (float): Drop path rate for stochastic depth. use_checkpoint (bool): Use checkpointing for efficient memory usage. mbconv_expand_ratio (float): Expansion ratio for MBConv layer. local_conv_size (int): Local convolution kernel size. layer_lr_decay (float): Layer-wise learning rate decay. Note: This implementation is generalized to accept a list of depths, attention heads, embedding dimensions and window sizes, which allows you to create a "stack" of TinyViT models of varying configurations. """ def __init__( self, img_size=224, in_chans=3, num_classes=1000, embed_dims=[96, 192, 384, 768], depths=[2, 2, 6, 2], num_heads=[3, 6, 12, 24], window_sizes=[7, 7, 14, 7], mlp_ratio=4.0, drop_rate=0.0, drop_path_rate=0.1, use_checkpoint=False, mbconv_expand_ratio=4.0, local_conv_size=3, layer_lr_decay=1.0, ): """ Initializes the TinyViT model. Args: img_size (int, optional): The input image size. Defaults to 224. in_chans (int, optional): Number of input channels. Defaults to 3. num_classes (int, optional): Number of classification classes. Defaults to 1000. embed_dims (List[int], optional): List of embedding dimensions for each layer. Defaults to [96, 192, 384, 768]. depths (List[int], optional): List of depths for each layer. Defaults to [2, 2, 6, 2]. num_heads (List[int], optional): List of number of attention heads for each layer. Defaults to [3, 6, 12, 24]. window_sizes (List[int], optional): List of window sizes for each layer. Defaults to [7, 7, 14, 7]. mlp_ratio (float, optional): Ratio of MLP hidden dimension to embedding dimension. Defaults to 4. drop_rate (float, optional): Dropout rate. Defaults to 0. drop_path_rate (float, optional): Drop path rate for stochastic depth. Defaults to 0.1. use_checkpoint (bool, optional): Whether to use checkpointing for efficient memory usage. Defaults to False. mbconv_expand_ratio (float, optional): Expansion ratio for MBConv layer. Defaults to 4.0. local_conv_size (int, optional): Local convolution kernel size. Defaults to 3. layer_lr_decay (float, optional): Layer-wise learning rate decay. Defaults to 1.0. """ super().__init__() self.img_size = img_size self.num_classes = num_classes self.depths = depths self.num_layers = len(depths) self.mlp_ratio = mlp_ratio activation = nn.GELU self.patch_embed = PatchEmbed( in_chans=in_chans, embed_dim=embed_dims[0], resolution=img_size, activation=activation ) patches_resolution = self.patch_embed.patches_resolution self.patches_resolution = patches_resolution # Stochastic depth dpr = [x.item() for x in torch.linspace(0, drop_path_rate, sum(depths))] # stochastic depth decay rule # Build layers self.layers = nn.ModuleList() for i_layer in range(self.num_layers): kwargs = dict( dim=embed_dims[i_layer], input_resolution=( patches_resolution[0] // (2 ** (i_layer - 1 if i_layer == 3 else i_layer)), patches_resolution[1] // (2 ** (i_layer - 1 if i_layer == 3 else i_layer)), ), # input_resolution=(patches_resolution[0] // (2 ** i_layer), # patches_resolution[1] // (2 ** i_layer)), depth=depths[i_layer], drop_path=dpr[sum(depths[:i_layer]) : sum(depths[: i_layer + 1])], downsample=PatchMerging if (i_layer < self.num_layers - 1) else None, use_checkpoint=use_checkpoint, out_dim=embed_dims[min(i_layer + 1, len(embed_dims) - 1)], activation=activation, ) if i_layer == 0: layer = ConvLayer(conv_expand_ratio=mbconv_expand_ratio, **kwargs) else: layer = BasicLayer( num_heads=num_heads[i_layer], window_size=window_sizes[i_layer], mlp_ratio=self.mlp_ratio, drop=drop_rate, local_conv_size=local_conv_size, **kwargs, ) self.layers.append(layer) # Classifier head self.norm_head = nn.LayerNorm(embed_dims[-1]) self.head = nn.Linear(embed_dims[-1], num_classes) if num_classes > 0 else torch.nn.Identity() # Init weights self.apply(self._init_weights) self.set_layer_lr_decay(layer_lr_decay) self.neck = nn.Sequential( nn.Conv2d( embed_dims[-1], 256, kernel_size=1, bias=False, ), LayerNorm2d(256), nn.Conv2d( 256, 256, kernel_size=3, padding=1, bias=False, ), LayerNorm2d(256), ) def set_layer_lr_decay(self, layer_lr_decay): """Sets the learning rate decay for each layer in the TinyViT model.""" decay_rate = layer_lr_decay # Layers -> blocks (depth) depth = sum(self.depths) lr_scales = [decay_rate ** (depth - i - 1) for i in range(depth)] def _set_lr_scale(m, scale): """Sets the learning rate scale for each layer in the model based on the layer's depth.""" for p in m.parameters(): p.lr_scale = scale self.patch_embed.apply(lambda x: _set_lr_scale(x, lr_scales[0])) i = 0 for layer in self.layers: for block in layer.blocks: block.apply(lambda x: _set_lr_scale(x, lr_scales[i])) i += 1 if layer.downsample is not None: layer.downsample.apply(lambda x: _set_lr_scale(x, lr_scales[i - 1])) assert i == depth for m in [self.norm_head, self.head]: m.apply(lambda x: _set_lr_scale(x, lr_scales[-1])) for k, p in self.named_parameters(): p.param_name = k def _check_lr_scale(m): """Checks if the learning rate scale attribute is present in module's parameters.""" for p in m.parameters(): assert hasattr(p, "lr_scale"), p.param_name self.apply(_check_lr_scale) def _init_weights(self, m): """Initializes weights for linear layers and layer normalization in the given module.""" if isinstance(m, nn.Linear): # NOTE: This initialization is needed only for training. # trunc_normal_(m.weight, std=.02) if m.bias is not None: nn.init.constant_(m.bias, 0) elif isinstance(m, nn.LayerNorm): nn.init.constant_(m.bias, 0) nn.init.constant_(m.weight, 1.0) @torch.jit.ignore def no_weight_decay_keywords(self): """Returns a dictionary of parameter names where weight decay should not be applied.""" return {"attention_biases"} def forward_features(self, x): """Runs the input through the model layers and returns the transformed output.""" x = self.patch_embed(x) # x input is (N, C, H, W) x = self.layers[0](x) start_i = 1 for i in range(start_i, len(self.layers)): layer = self.layers[i] x = layer(x) B, _, C = x.shape x = x.view(B, 64, 64, C) x = x.permute(0, 3, 1, 2) return self.neck(x) def forward(self, x): """Executes a forward pass on the input tensor through the constructed model layers.""" return self.forward_features(x)
2201_75373101/TargetSingleAndBinocularRanging
ultralytics/models/sam/modules/tiny_encoder.py
Python
unknown
29,135