我正在设置新的Tensorflow Object Detection API,以便在大面积的卫星图像中查找小物体.它工作得很好 - 它找到我想要的所有10个对象,但我也得到50-100个误报[看起来有点像目标对象的东西,但不是].
我使用的样本配置从"宠物"的教程,以微调的faster_rcnn_resnet101_coco,它们的价格模型.我从小开始,只有100个我的对象训练样例(只有1个类).我的验证集中有50个示例.每个示例都是200x200像素的图像,中心带有标记对象(~40x40).我训练直到我的精确度和损失曲线高原.
我对使用深度学习进行物体检测相对较新.提高精度的最佳策略是什么?例如硬阴性采矿?增加我的训练数据集大小?我还没有尝试他们提供的最准确的模型,faster_rcnn_inception_resnet_v2_atrous_coco因为我想保持一定的速度,但如果需要的话也会这样做.
硬负采矿似乎是合乎逻辑的一步.如果您同意,如何为我的训练数据集设置tfrecord文件?假设我为50-100个误报中的每一个制作200x200图像:
machine-learning object-detection computer-vision deep-learning tensorflow
我正在尝试将Pusher插入到已经很晚的Rails应用程序中.客户端工作正常 - 使用Pusher Event Creator触发所需的javascript.但服务器端无法正常工作:
在我的通知控制器中使用以下代码创建要测试的操作:
Pusher.trigger('private-4','new_message', {:from => "christian", :subject => "hello"})
Run Code Online (Sandbox Code Playgroud)
给出了这个错误:
Pusher::AuthenticationError (Unknown auth_key):
app/controllers/notifications_controller.rb:57:in `block in create'
app/controllers/notifications_controller.rb:38:in `create'
Run Code Online (Sandbox Code Playgroud)
(调试控制台中没有任何新内容)
我在开发环境中运行它.我已经在我的系统上测试了"推送器/通知"示例应用程序,并且工作正常,包括客户端和服务器.
在development.rb中:
# Pusher
require 'pusher'
Pusher.app_id = '{redacted}'
Pusher.key = '{redacted}'
Pusher.secret = '{redacted}'
Pusher.logger = Rails.logger
Run Code Online (Sandbox Code Playgroud)
更新 - 完整日志输出:
Unknown auth_key (Pusher::AuthenticationError)
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/pusher-0.11.3/lib/pusher/request.rb:99:in `handle_response'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/pusher-0.11.3/lib/pusher/request.rb:52:in `send_sync'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/pusher-0.11.3/lib/pusher/resource.rb:18:in `post'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/pusher-0.11.3/lib/pusher/client.rb:134:in `post'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/pusher-0.11.3/lib/pusher/client.rb:216:in `trigger'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/pusher-0.11.3/lib/pusher/channel.rb:59:in `trigger!'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/pusher-0.11.3/lib/pusher/channel.rb:71:in `trigger'
/Users/christian/Sites/casenexus/app/controllers/notifications_controller.rb:60:in `block in create'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:270:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:270:in `retrieve_collector_from_mimes'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:194:in `respond_to'
/Users/christian/Sites/casenexus/app/controllers/notifications_controller.rb:40:in `create'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
/usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action' …Run Code Online (Sandbox Code Playgroud) 我希望能够说user1 is 4 hours ahead of user2,根据用户在其帐户中指定的时区计算.
使用以下代码:
time1 = Time.zone.now.in_time_zone(user1.time_zone)
time2 = Time.zone.now.in_time_zone(user2.time_zone)
distance_of_time_in_words time1,time2
Run Code Online (Sandbox Code Playgroud)
...给出了差异less than a minute- 同样减去两次给出的差异0.Rails显然仍然认为这两次是相同的.
知道如何计算两个时区之间的差异吗?
我有一个在Heroku上运行的基本Node.js和Socket.io聊天应用程序,我想要集成到我的主rails网站.我知道这样做的方法是有两个独立的Heroku应用程序 - 一个用于rails,一个用于Node.js.
它似乎并不像将客户端html从节点应用程序移动到rails应用程序那样简单(在'io.connect();'中为其提供其他应用程序的URL).
聊天应用服务器似乎自动调用客户端index.html自己的应用程序,并且不允许外部源连接到它.删除执行此操作的代码(在下面标记)不会使其工作.
我是Node.js和Socket.io的新手,我希望这对于专业人士来说可能是一个相对简单的修复.
我相信我在这里的功能适用于Liam Kaufman的优秀rails/node.js/socket.io示例 - 他的node.js服务器代码在这里:https://github.com/liamks/Chatty-Node-Server/斑点/主/聊天server.js
我试过嘲笑我的应用程序的代码就像他的,但还没有能够使它工作.他似乎使用'http'服务器,而我使用'快速'服务器 - 我想知道这是否相关.
任何帮助将不胜感激.
更新:好的,所以一个奇怪的事件转发,由于redhotvengeance的回复下面我有这个工作 - 服务器是在heroku和我的客户端HTML和JavaScript连接到它.太棒了 - 下面的代码.但问题是,客户端html文件仅在Rails应用程序之外才连接!即在我的桌面上!! 我把它放在rails应用程序的公共/文件夹或我本地主机的视图中的那一刻,我什么都没得到!这毫无意义.我检查它不是因为我的资产管道中的任何其他随机错误的javascript冲突只是创建一个新的rails应用程序并删除公共/文件夹中的html文件 - 再没有 - 只是一个无法连接的死html页面.有谁知道这里会发生什么?Rails是否有一些安全功能可以阻止与外部服务器或其他东西的连接?
更新2:我被告知这与"同源政策"有关,我遇到了麻烦.它有什么办法吗?似乎利亚姆没有这个问题.
客户:
<script src="http://calm-sands-3826.herokuapp.com/socket.io/socket.io.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
var socket = io.connect('http://calm-sands-3826.herokuapp.com');
// on connection to server, ask for user's name with an anonymous callback
socket.on('connect', function(){
// call the server-side function 'adduser' and send one parameter (value of prompt)
socket.emit('adduser', prompt("What's your name?"));
});
// listener, whenever the server emits …Run Code Online (Sandbox Code Playgroud) 我正在尝试在背景图像上叠加CSS渐变.我已经在Firefox中工作,但在safari和chrome中我只获得背景图像,没有渐变.
(我使用http://www.colorzilla.com/gradient-editor/生成了渐变代码,然后在每行的末尾添加了url())
更新:似乎我的问题可能是webkit显示图像背后的渐变,而不是像我需要的那样,而firefox确实如此.
background: -moz-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(99, 130, 169, 0.7) 100%), url(app/bg.jpg) no-repeat center center fixed; /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0, 0, 0, 0)), color-stop(100%, rgba(99, 130, 169, 0.7))), url(app/bg.jpg) no-repeat center center fixed; /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%,rgba(0,0,0,0.16) 100%), url(app/bg.jpg) no-repeat center center fixed; /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(0, 0, 0, 0) 0%,rgba(99, 130, 169, 0.7) 100%), url(app/bg.jpg) no-repeat center center …Run Code Online (Sandbox Code Playgroud)