如何更改配置的优化器
例如以下是 ssd_coco_mobilenetv2 的 confgi
train_config: {
batch_size: 4
optimizer {
rms_prop_optimizer: {
learning_rate: {
exponential_decay_learning_rate {
initial_learning_rate: 0.0001 decay_steps: 800720 decay_factor: 0.95
}
}
momentum_optimizer_value: 0.9
decay: 0.9
epsilon: 1.0
}
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用 Microsoft 的CustomVision.ai构建自定义视觉应用程序。
我正在使用本教程。
在对象检测项目中标记图像时,需要使用标准化坐标指定每个标记对象的区域。
我有一个 XML 文件,其中包含有关图像的注释,例如名为sample_1.jpg:
<annotation>
<filename>sample_1.jpg</filename>
<size>
<width>410</width>
<height>400</height>
<depth>3</depth>
</size>
<object>
<bndbox>
<xmin>159</xmin>
<ymin>15</ymin>
<xmax>396</xmax>
<ymax>302</ymax>
</bndbox>
</object>
</annotation>
Run Code Online (Sandbox Code Playgroud)
我必须根据提供的教程将边界框坐标从 xmin,xmax,ymin,ymax 转换为标准化的 x,y,w,h 坐标。
谁能给我一个转换函数?
我想在 Darknet 中的 YOLOv3 中进行迁移学习,因此我想使用在 COCO 数据集上训练的 YOLOv3 预训练模型,然后在我自己的数据集上进一步训练它以检测其他对象。那么我应该采取哪些步骤呢?如何标记我的数据以便可以在暗网中使用?请帮助我,因为这是我第一次使用 Darknet 和 YOLO。
我正在使用对象检测 API 并调整 SSD 任务的参数。我的问题是指https://github.com/tensorflow/models/blob/master/research/object_detection/box_coders/faster_rcnn_box_coder.py上的框编码器。为什么将这些比例因子设置为 [10,10,5,5]?原论文没有对此进行解释。我怀疑它必须为位置误差的 4 个分量(tx、ty、tw、th)分配不同的权重,或者解决一些数值稳定性问题,但我想得到确认。谢谢
object-detection deep-learning conv-neural-network tensorflow
我正在学习使用 Detecron2。我已按照此链接创建自定义对象检测器。我的训练代码 -
# training Detectron2
from detectron2.engine import DefaultTrainer
from detectron2.config import get_cfg
import os
cfg = get_cfg()
cfg.merge_from_file("./detectron2_repo/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
cfg.DATASETS.TRAIN = ("pedestrian",)
cfg.DATASETS.TEST = () # no metrics implemented for this dataset
cfg.DATALOADER.NUM_WORKERS = 2
cfg.MODEL.WEIGHTS = "detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl" # initialize from model zoo
cfg.SOLVER.IMS_PER_BATCH = 2
cfg.SOLVER.BASE_LR = 0.02
cfg.SOLVER.MAX_ITER = 300 # 300 iterations seems good enough, but you can certainly train longer
cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 128 # faster, and good enough for this dataset
cfg.MODEL.ROI_HEADS.NUM_CLASSES = …Run Code Online (Sandbox Code Playgroud) 我想按如下方式转换我的可可 JSON 文件:
带有注释的 CSV 文件应每行包含一个注释。具有多个边界框的图像应为每个边界框使用一行。请注意,像素值的索引从 0 开始。每行的预期格式为:
path/to/image.jpg,x1,y1,x2,y2,class_name
Run Code Online (Sandbox Code Playgroud)
一个完整的例子:
*/data/imgs/img_001.jpg,837,346,981,456,cow
/data/imgs/img_002.jpg,215,312,279,391,cat
/data/imgs/img_002.jpg,22,5,89,84,bird
Run Code Online (Sandbox Code Playgroud)
这定义了一个包含 3 个图像的数据集:img_001.jpg包含一头牛,img_002.jpg包含一只猫和一只鸟,并且不img_003.jpg包含有趣的对象/动物。
我怎么能那样做?
我正在比较用于海上搜救 (SAR) 目的的物体检测模型。从我使用的模型中,我得到了改进版 YOLOv3 的最佳结果,用于小物体检测和 FASTER RCNN。
对于 YOLOv3,我得到了最好的 mAP@50,但是对于 FASTER RCNN,我得到了更好的所有其他指标(精度、召回率、F1 分数)。现在我想知道如何阅读它以及在这种情况下哪个模型真的更好?
我想补充一点,数据集中只有两个类:小对象和大对象。我们选择这个解决方案是因为对我们来说,对象在类别之间的区别不像检测任何人类来源的对象那么重要。
然而,小的物体并不意味着小的 GT 边界框。这些是实际面积很小的物体 - 小于 2 平方米(例如人、浮标)。大物体是面积较大的物体(小船、轮船、独木舟等)。
以下是每个类别的结果:
object-detection computer-vision conv-neural-network yolo faster-rcnn
我正在使用 tensorflow 对象检测 api 版本 2 训练最多 10 个检查点的对象检测模型。使用exporter_main_v2.py没有问题的作品导出最终检查点,但是我也想导出例如检查点 3、6 和 8 以比较它们的工作方式在实际设置中。这可能吗?
我试过删除后面的检查点然后运行,exporter_main_v2.py但这会导致错误,指出events.out.tfevents文件中的事件比我尝试导出的事件晚,因此无法继续。
过去 2 个月,我一直在尝试训练对象检测模型,最终按照本教程取得了成功。
这是我的colab,其中包含我所有的工作。
问题是,显示了训练损失,并且平均减少了,但验证损失没有。
在pipeline.config文件中,我确实输入了评估 TFRecord 文件(我假设它是验证数据输入),如下所示:
评估配置{
指标集:“coco_detection_metrics”
use_moving_averages: 假
}
eval_input_reader {
label_map_path: "注释/label_map.pbtxt"
洗牌:假
num_epochs: 1
tf_record_input_reader {
输入路径:“注释/test.record”
}
}
我通读了model_main_tf2.py,它在训练时似乎没有评估,但只在提到 checkpoint_dir 时评估。
因此,我只能监控训练集上的损失,而无法监控验证集上的损失。
因此,我不知道过拟合或欠拟合。
你们中有人成功地使用 model_main_tf2.py 来查看验证损失吗?
此外,很高兴看到经过训练的 mAP 分数。
我知道 keras 培训允许在张量板上看到所有这些东西,但 OD API 似乎要困难得多。
感谢您的时间,如果您仍然对某些事情感到困惑,请告诉我。
python object-detection tensorflow object-detection-api tensorflow2.0
首先这里是我的代码:
image = cv2.imread(filePath)
height, width, channels = image.shape
# USing blob function of opencv to preprocess image
blob = cv2.dnn.blobFromImage(image, 1 / 255.0, (416, 416),
swapRB=True, crop=False)
#Detecting objects
net.setInput(blob)
outs = net.forward(output_layers)
# Showing informations on the screen
class_ids = []
confidences = []
boxes = []
for out in outs:
for detection in out:
scores = detection[5:]
class_id = np.argmax(scores)
confidence = scores[class_id]
if confidence > 0.7:
# Object detected
center_x = int(detection[0] * width)
center_y = …Run Code Online (Sandbox Code Playgroud) object-detection ×10
python ×4
tensorflow ×4
yolo ×3
coco ×1
darknet ×1
faster-rcnn ×1
json ×1
opencv ×1
python-3.x ×1
tensorboard ×1