boxes

HDU 4611Balls Rearrangement(思维)

时光总嘲笑我的痴心妄想 提交于 2020-03-13 11:03:26
Balls Rearrangement Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1661 Accepted Submission(s): 627 Problem Description Bob has N balls and A boxes. He numbers the balls from 0 to N-1, and numbers the boxes from 0 to A-1. To find the balls easily, he puts the ball numbered x into the box numbered a if x = a mod A. Some day Bob buys B new boxes, and he wants to rearrange the balls from the old boxes to the new boxes. The new boxes are numbered from 0 to B-1. After the rearrangement, the ball numbered x should be in the box number b if x = b

rxjs6 拖拽接龙

蓝咒 提交于 2020-02-26 02:21:54
效果 参考其他博客, 使用rxjs6实现拖拽接龙 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="./rxjs.umd.js"></script> <style> .box { width: 50px; height: 50px; background: deepskyblue; position: absolute; left: 0; right: 0; border-radius: 50%; } </style> </head> <body> <div class="box move" style="background: deepskyblue;z-index: 10" id="box"></div> <div class="box move" style="background: red;z-index: 9" ></div> <div class="box move" style="background: orange;z-index: 8"></div> <div class="box move" style="background: yellow;z-index: 7"></div> <div class="box move

目标检测——基本数据增广(旋转、裁剪、缩放、填充、亮暗、对比度等)

余生颓废 提交于 2020-02-22 05:38:06
图像处理的主要函数文件: image_utils.py # -*- coding: utf-8 -*- import numpy as np import cv2 from PIL import Image , ImageEnhance import random from box_utils import multi_box_iou_xywh , box_crop # 随机改变亮暗、对比度和颜色等 def random_distort ( img ) : # 随机改变亮度 def random_brightness ( img , lower = 0.5 , upper = 1.5 ) : e = np . random . uniform ( lower , upper ) return ImageEnhance . Brightness ( img ) . enhance ( e ) # 随机改变对比度 def random_contrast ( img , lower = 0.5 , upper = 1.5 ) : e = np . random . uniform ( lower , upper ) return ImageEnhance . Contrast ( img ) . enhance ( e ) # 随机改变颜色 def random_color ( img

HDOJ4190 Distributing Ballot Boxes #贪心 二分#

↘锁芯ラ 提交于 2020-02-04 23:57:35
Distributing Ballot Boxes Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2571 Accepted Submission(s): 1340 Problem Description Today, besides SWERC'11, another important event is taking place in Spain which rivals it in importance: General Elections. Every single resident of the country aged 18 or over is asked to vote in order to choose representatives for the Congress of Deputies and the Senate. You do not need to worry that all judges will suddenly run away from their supervising duties, as voting is not compulsory. The administration

Codeforces Round #228 (Div. 1) A. Fox and Box Accumulation 贪心

感情迁移 提交于 2020-02-04 02:31:47
A. Fox and Box Accumulation 题目连接: http://codeforces.com/contest/388/problem/A Description Fox Ciel has n boxes in her room. They have the same size and weight, but they might have different strength. The i-th box can hold at most xi boxes on its top (we'll call xi the strength of the box). Since all the boxes have the same size, Ciel cannot put more than one box directly on the top of some box. For example, imagine Ciel has three boxes: the first has strength 2, the second has strength 1 and the third has strength 1. She cannot put the second and the third box simultaneously directly on the

tf.boolean_mask() 函数

回眸只為那壹抹淺笑 提交于 2020-02-02 15:26:56
boolean_mask(a,b) 将使a (m维)矩阵仅保留与b中“True”元素同下标的部分。使用tf.boolean_mask用来过滤概率值比较低的锚盒,这个函数的一个参数b为滤波器掩模,生成掩模要用到逻辑表达式(>或者<)生成布尔值,假设阈值threshold=C,并且当mask和tensor的维度相同时,输出1维矩阵 def yolo_filter_boxes ( box_confidence , boxes , box_class_probs , threshold = 0.6 ) : #第一步:计算锚框得分 box_scores = box_confidence * box_class_probs #找到最大锚框 box_classes = K . argmax ( box_scores , axis = - 1 ) box_class_scores = K . max ( box_scores , axis = - 1 ) #第三步:根据阈值创建掩码 filtering_mask = ( box_class_scores >= threshold ) #对scores, boxes 以及 classes使用掩码 scores = tf . boolean_mask ( box_class_scores , filtering_mask ) boxes = tf .

Boxes Packing

社会主义新天地 提交于 2020-01-28 01:18:45
Boxes Packing Mishka has got n empty boxes. For every i (1 ≤ i ≤ n), i-th box is a cube with side length ai. Mishka can put a box i into another box j if the following conditions are met: i-th box is not put into another box; j-th box doesn’t contain any other boxes; box i is smaller than box j (ai < aj). Mishka can put boxes into each other an arbitrary number of times. He wants to minimize the number of visible boxes. A box is called visible iff it is not put into some another box. Help Mishka to determine the minimum possible number of visible boxes! Input The first line contains one

mask-rcnn解读(二):clip_boxes_graph()

旧时模样 提交于 2019-12-06 05:08:06
此函数是利用deltas对box修正,我并没有详细说明,若有问题,欢迎留言交流: def clip_boxes_graph(boxes, window): """ boxes: [N, (y1, x1, y2, x2)] window: [4] in the form y1, x1, y2, x2 """ # Split wy1, wx1, wy2, wx2 = tf.split(window, 4) y1, x1, y2, x2 = tf.split(boxes, 4, axis=1) # Clip y1 = tf.maximum(tf.minimum(y1, wy2), wy1) x1 = tf.maximum(tf.minimum(x1, wx2), wx1) y2 = tf.maximum(tf.minimum(y2, wy2), wy1) x2 = tf.maximum(tf.minimum(x2, wx2), wx1) clipped = tf.concat([y1, x1, y2, x2], axis=1, name="clipped_boxes") clipped.set_shape((clipped.shape[0], 4)) return clipped 来源: https://www.cnblogs.com/tangjunjun/p/11963442.html

学习 BFC (Block Formatting Context)

亡梦爱人 提交于 2019-12-03 10:12:53
本文转载于: 猿2048 网站➥ https://www.mk2048.com/blog/blog.php?id=i00bciibaa 什么是BFC BFC全称是Block Formatting Context,即块格式化上下文。它是CSS2.1规范定义的,关于CSS渲染定位的一个概念。要明白BFC到底是什么,首先来看看什么是视觉格式化模型。 视觉格式化模型 视觉格式化模型(visual formatting model)是用来处理文档并将它显示在视觉媒体上的机制,它也是CSS中的一个概念。 视觉格式化模型定义了盒(Box)的生成,盒主要包括了块盒、行内盒、匿名盒(没有名字不能被选择器选中的盒)以及一些实验性的盒(未来可能添加到规范中)。盒的类型由 display 属性决定。 块盒(block box) 块盒有以下特性: 当元素的CSS属性 display 为 block , list-item 或 table 时,它是块级元素 block-level; 视觉上呈现为块,竖直排列; 块级盒参与(块格式化上下文); 每个块级元素至少生成一个块级盒,称为主要块级盒(principal block-level box)。一些元素,比如 <li> ,生成额外的盒来放置项目符号,不过多数元素只生成一个主要块级盒。 行内盒(inline box) 当元素的CSS属性 display 的计算值为

Turn callback into promise

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm working with the google maps api and this piece of code is returning a list of places asynchronously. How can I call this function and have it trigger something when all the data is collected? This has been what i've tried so far - $.search = function(boxes) { function findNextPlaces(place_results, searchIndex) { var dfd = $.Deferred(); if (searchIndex < boxes.length) { service.radarSearch({ bounds: boxes[searchIndex], types: ["food"] }, function (results, status) { if (status != google.maps.places.PlacesServiceStatus.OK) { return dfd