fast

力扣算法题—143ReorderList

北城余情 提交于 2019-12-03 02:51:35
Given a singly linked list L : L 0→ L 1→…→ L n -1→ L n, reorder it to: L 0→ L n → L 1→ L n -1→ L 2→ L n -2→… You may not modify the values in the list's nodes, only nodes itself may be changed. Example 1: Given 1->2->3->4, reorder it to 1->4->2->3. Example 2: Given 1->2->3->4->5, reorder it to 1->5->2->4->3.Solution:  使用快慢指针,得到后半部分的链表  使用栈存储后半部分的链表来替代翻转链表 1 class Solution { 2 public: 3 void reorderList(ListNode* head) { 4 if (head == nullptr || head->next == nullptr)return; 5 ListNode* slow = head, *fast = head; 6 while (fast && fast->next) 7 { 8 slow = slow->next; 9 fast = fast->next->next;

OpenCV FAST detector

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my main.cpp I have an excerpt: Ptr<FastFeatureDetector> fastDetector = FastFeatureDetector::create(80, true); while (true) { Mat image = // get grayscale image 1280x720 timer.start(); detector->detect(image, keypoints); myfile << "FAST\t" << timer.end() << endl; // timer.end() is how many seconds elapsed since last timer.start() keypoints.clear(); timer.start(); for (int i = 3; i < image.rows - 3; i++) { for (int j = 3; j < image.cols - 3; j++) { if (inspectPoint(image.data, image.cols, i, j)) { // this block is never entered KeyPoint

javascript, When right div is hidden left div has to be 100% width

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: FIXED fixed it by editing mplungjan's code to this: $(function() { $("#foo").on("click",function() { if ($(this).is(':checked')) $('#checked-a').show('fast',function() { $('#checked-b').css("width","60%"); $('#checked-a').css("width","40%"); }) ; else $('#checked-a').show('fast',function(){ $('#checked-b').css("width","100%").show(); $('#checked-a').css("width","0%").hide(); }); }); }); i would like to have the left div to be 100% (current 60%) when right div (40%) is hidden. screenshot with checked checkbox: screenshot with unchecked

What are fail-safe &amp; fail-fast Iterators in Java [closed]

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There are two types of iterators in Java: fail-safe and fail-fast. What does this mean, and is the difference between them? 回答1: What is the difference between them ... "Fail safe" means: it won't fail. Strictly speaking, there is no such thing in Java as a fail-safe iterator. The correct term is "weakly consistent". The javadoc says: "Most concurrent Collection implementations (including most Queues) also differ from the usual java.util conventions in that their Iterators and Spliterators provide weakly consistent rather than fast-fail

How to enable fast scrolling for a ListFragment?

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I use a fragment activity to hold a list fragment which renders a bunch of products: public class ProductsListActivity extends SherlockFragmentActivity { @Override public void onCreate ( Bundle savedInstanceState ) { setTheme ( R . style . Sherlock___Theme ); super . onCreate ( savedInstanceState ); setContentView ( R . layout . fragment_products_list ); // setFastScrollEnabled(true) ? } } ... <!-- fragment_products_list.xml --> <? xml version = "1.0" encoding = "utf-8" ?> <fragment xmlns:android = "http://schemas.android.com/apk

Faster R-CNN 安装并运行 demo + 训练和测试 VOC 格式数据集

匿名 (未验证) 提交于 2019-12-03 00:34:01
首先要安装 caffe 和 pycaffe,安装过程可参考我的 上一篇博文 在安装并运行 Faster R-CNN demo,训练和测试自己的 VOC 数据集中也出现了各种各样的问题,但大多数问题都是因为 Faster R-CNN 本身和其他各种依赖项之间的兼容问题,大概是因为我安装的 CUDA,cuDNN 等其他一些依赖项的版本比较高造成的。 Faster R-CNN 安装并运行 demo 其 Github 上也有比较详细的安装过程可供参考, 传送门 : 1. 下载 Faster R-CNN,编译 Cython 模块 git clone -- recursive https : // github.com/rbgirshick/py-faster-rcnn.git cd py - faster - rcnn / lib make 2. 创建 Makefile.config 文件,打开并修改,修改方式和 Caffe 中的修改方式一样,可参考我的 上一篇博文 cd py - faster - rcnn / caffe - fast - rcnn cp Makefile . config . example Makefile . config 替换 py-faster-rcnn/caffe-fast-rcnn/include/caffe/util 里的 cudnn.hpp 为最新版

Faster-rcnn详解

匿名 (未验证) 提交于 2019-12-03 00:27:02
Faster R-CNN算法是在Fast R-CNN算法的基础上,将RPN与Fast R-CNN结合到一个深度神经网络中Faster R-CNN由候选区域框网络(Region Proposal Network,简称 RPN )和Fast R-CNN网络两部分组成。整体网络框架如图3-1所示。 图 3-1 Faster R-CNN RPN是全卷积神经网络,用于提取候选框;Fast R-CNN用于对RPN中提取的候选区域进行检测并识别候选区域中的目标。Faster R-CNN算法大概可以分为:特征提取、生成候选区域框、分类回归三个步骤。 3.2.1 特征提取网络 基于卷积神经网络在图像特征提取中的优越性能,Faster R-CNN 算法的特征提取网络就采用卷积神经网络,这个特征提取网络是可替换的,可以根据实际要求选择适合深度Faster RCNN 原文中使用的是VGG16 网络 【】 VGG16 的特点是网络深度较深,从而可以提取更深层次的图像特征,取得更好的检测效果。 训练数据的数量是决定网络模型性能的关键因素,训练数据越多,训练出来的网络各方面性能就会越好;相反,如果训练数据的数量过少,即使是设计很好的网络,训练出来的模型性能也不一定好。因此在深度学习中,通常把在海量数据中已经训练好的模型应用到自己的网络中,然后利用目标数据对目标网络进行微调以提高网络的Image

caffe-fast-rcnn(Caffe、FSRCNN、FastRCNN)

匿名 (未验证) 提交于 2019-12-03 00:26:01
转载请注明: http://blog.csdn.net/forest_world 二、FSRCNN开发环境搭建: faster -rcnn : matlab版本ShaoqingRen/faster_rcnn: Faster R -CNN rbg提供的python版本rbgirshick/py -faster -rcnn 1 2 3 4 5 git clone https://github.com/LMDB/lmdb Cloning into 'lmdb' ... remote: Counting objects: 7201 , done. remote: Total 7201 (delta 0 ), reused 0 (delta 0 ), pack-reused 7201 Receiving objects: 100 % ( 7201 / 7201 ), 1.40 MiB | 7.00 KiB/s, done. Resolving deltas: 100 % ( 3097 / 3097 ), done. Checking connectivity... done. 1 2 3 4 5 6 7 sudo make install https://github.com/rbgirshick/fast-rcnn.git make make -j8 && make pycaffe

Fast R-CNN

匿名 (未验证) 提交于 2019-12-03 00:21:02
R-CNN is slow because it performs a ConvNet forward pass for each object proposal, without sharing computation. Spatial pyramid pooling networks (SPPnets) were proposed to speed up R-CNN by sharing computation. The SPPnet method computes a convolutional feature map for the entire input image and then classifies each object proposal using a feature vector extracted from the shared feature map. Features are extracted for a proposal by maxpooling the portion of the feature map inside the proposal into a fixed-size output (e.g., 6 x 6). Multiple output sizes are pooled and then concatenated as in

判断一链表是否有环,求环的第一个节点和环的长度

匿名 (未验证) 提交于 2019-12-03 00:13:02
第一种方法:直接遍历时,用hashset存放,判断是否存在环 第二种方法:使用快慢指针 public class CycleLinkedList { public static void main ( String [] args ) { Node head = new Node ( 1 ); Node node3 = new Node ( 3 ); head . next = node3 ; head . next . next = new Node ( 5 ); head . next . next . next = new Node ( 7 ); head . next . next . next . next = new Node ( 9 ); head . next . next . next . next . next = node3 ; System . out . println ( "是否有环:" + hasCycle ( head )); Node enterNode = getEnterNode ( head ); System . out . println ( "环的入口:" + enterNode . value ); System . out . println ( getCycleSize ( enterNode )); } // 环的长度