标签: object-detection

将 Base64 图像转换为张量

我将图像作为 base64 字符串发送到 Node Express 服务器,以使用张量流分析对象检测。如何使用 Node js 中的 cocossd 模型将 Base64 图像更改为张量以进行对象检测。

image-processing object-detection node.js tensorflow tensorflow.js

3
推荐指数
1
解决办法
4545
查看次数

如何在 Tensorflow 对象检测 API v2 中同时训练和评估

我想知道如何在 Tf2 对象检测 API 中的每个检查点训练和评估模型。在文档中,他们建议训练然后评估模型

火车

python object_detection/model_main_tf2.py \
    --pipeline_config_path=${PIPELINE_CONFIG_PATH} \
    --model_dir=${MODEL_DIR} \
    --alsologtostderr
Run Code Online (Sandbox Code Playgroud)

评价

python object_detection/model_main_tf2.py \
    --pipeline_config_path=${PIPELINE_CONFIG_PATH} \
    --model_dir=${MODEL_DIR} \
    --checkpoint_dir=${CHECKPOINT_DIR} \
    --alsologtostderr
Run Code Online (Sandbox Code Playgroud)

我想要的是进行训练,并在创建每个检查点(1000 个步骤)后进行评估。我知道在 TF-1 对象检测 API 中,每 1000 个步骤都会自动进行评估,并且我想在 TF-2 中复制

python object-detection tensorflow object-detection-api tensorflow2.0

3
推荐指数
1
解决办法
2609
查看次数

如何在 pytorch 中的包含负数据的数据集上训练 fast-rcnn

我正在尝试训练 torchvision Faster R-CNN 模型,以根据我的自定义数据进行对象检测。我使用了torchvision对象检测微调教程中的代码。但出现此错误:

Expected target boxes to be a tensor of shape [N, 4], got torch.Size([0])
Run Code Online (Sandbox Code Playgroud)

这与我的自定义数据集中的负数据(空训练图像/无边界框)有关。我们如何更改以下内容,Dataset class以便能够在包含负数据的数据集上训练 fast-rcnn?

class MyCustomDataset(Dataset):

    def __init__(self, root, transforms):
        self.root = root
        self.transforms = transforms
        # load all image files, sorting them to
        # ensure that they are aligned
        self.imgs = list(sorted(os.listdir(os.path.join(root, "PNGImages"))))
        self.masks = list(sorted(os.listdir(os.path.join(root, "PedMasks"))))

    def __len__(self):
        return len(self.imgs)

    def __getitem__(self, idx):
        # load images ad masks
        img_path = os.path.join(self.root, "PNGImages", self.imgs[idx])
        mask_path = os.path.join(self.root, "PedMasks", …
Run Code Online (Sandbox Code Playgroud)

bounding-box object-detection computer-vision deep-learning pytorch

3
推荐指数
1
解决办法
2601
查看次数

即使所有标签都是唯一的,YOLOv5 也会引发重复标签错误

我正在尝试使用 YOLOv5x 构建一个对象检测系统。我通过 Roboflow 网站创建了我的数据集,并将该数据集下载到我的笔记本后,我运行以下命令来开始训练:

!curl -L "https://app.roboflow.com/ds/[DATASET-LINK]" > roboflow.zip; unzip roboflow.zip; rm roboflow.zip
Run Code Online (Sandbox Code Playgroud)

但我对每张图像都收到此错误:

train: WARNING: Ignoring corrupted image and/or label /content/yolov5/train/images/output_0446_png.rf.caced7dfbd9c68fe51180ceb8c2f04e8.jpg: duplicate labels
train: WARNING: Ignoring corrupted image and/or label /content/yolov5/train/images/output_0450_png.rf.808e3c83dd6b516900257848467d9a5b.jpg: duplicate labels
train: WARNING: Ignoring corrupted image and/or label /content/yolov5/train/images/output_0456_png.rf.898ad055d9c4cf67db7657c4901db2b7.jpg: duplicate labels
train: WARNING: Ignoring corrupted image and/or label /content/yolov5/train/images/output_0459_png.rf.8bc9567fac8542598a79c2bf11d4d8d5.jpg: duplicate labels
train: WARNING: Ignoring corrupted image and/or label /content/yolov5/train/images/output_0461_png.rf.62c902b73e1b6a92e1417b90c8dd3c9c.jpg: duplicate labels
train: WARNING: Ignoring corrupted image and/or label /content/yolov5/train/images/output_0462_png.rf.bf025028cd9eb5fe98d3cd80452a8d86.jpg: duplicate labels
train: WARNING: Ignoring corrupted image …
Run Code Online (Sandbox Code Playgroud)

python object-detection computer-vision yolov5 roboflow

3
推荐指数
1
解决办法
4041
查看次数

如何使用自定义模型从 YoloV5 推理中获取边界框坐标?

我目前正在尝试使用我自己的脚本而不是 detector.py 从我的图像中使用自定义模型获取边界框坐标。我想获取在图像上绘制边界框所需的坐标。有人可以帮我吗?


model = torch.hub.load('ultralytics/yolov5', 'custom', 'best.pt')
model = model.autoshape()

results = model(img, size=416)
Run Code Online (Sandbox Code Playgroud)

python object-detection yolo yolov5

3
推荐指数
1
解决办法
3367
查看次数

出现错误“资源耗尽:在使用形状 [1800,1024,28,28] 分配张量并在 /job:localhost/... 上键入 float 时出现 OOM”

在开始训练我的对象检测 Tensorflow 2.5 GPU 模型时,我收到资源耗尽错误。我使用 18 个训练图像和 3 个测试图像。我使用的预训练模型是 Tensorflow Zoo 2.2 中的 Faster R-CNN ResNet101 V1 640x640 模型。我使用具有 8 GB 专用内存的 Nvidia RTX 2070 来训练我的模型。

我感到困惑的是,当训练集如此之小时,为什么训练过程会占用 GPU 如此多的内存。这是我遇到的错误的 GPU 内存摘要:

Limit:                      6269894656
InUse:                      6103403264
MaxInUse:                   6154866944
NumAllocs:                        4276
MaxAllocSize:               5786902272
Reserved:                            0
PeakReserved:                        0
LargestFreeBlock:                    0
Run Code Online (Sandbox Code Playgroud)

我还将训练数据的批量大小减少到 6,将测试数据的批量大小减少到 1。

out-of-memory object-detection tensorflow object-detection-api tensorflow2.0

3
推荐指数
1
解决办法
8234
查看次数

如何在 Colab 中更改 yolov8 模型的训练模型位置

这是在colab中训练模型的命令

!yolo task=detect mode=train model=yolov8s.pt data=coco.yaml epochs=10 imgsz=640 
Run Code Online (Sandbox Code Playgroud)

我想将模型的保存位置从 /runs/exp 更改为 /content/drive/MyDrive/yolov8,我该怎么做

我尝试了 --weights 参数和其他一些参数,但没有成功

python machine-learning object-detection computer-vision yolo

3
推荐指数
1
解决办法
2745
查看次数

OpenCV:从黑白图像中检测简单的电子元件

我是OpenCV的新手,并试图找出从电路图等图纸中搜索元件的最佳方法.组件始终为黑色,背景为白色,但组件可以旋转和缩放.

带组件的简单图示例.图表总是比这更好的分辨率.

在此输入图像描述

我应该为每个组件进行Haar培训吗?还是模板匹配?

谢谢!

opencv object-detection

2
推荐指数
1
解决办法
1720
查看次数

TensorFlow对象检测API错误

我正在使用Tensorflow Object Detection API来训练我自己的物体探测器.准备所需的一切后:我把data/train.record, test.record,training/object-detection.pbtxt, faster_rcnn_inception_resnet_v2_atrous_pets.config到的文件夹object_detection.跑

python train.py --logtostderr --train_dir = training/ --pipeline_config_path = training/faster_rcnn_inception_resnet_v2_atrous_pets.config

我收到了错误:

`
username@host:~/Documents/tensorflowModels/object_detection$ python train.py --logtostderr --train_dir = training/ --pipeline_config_path = training/faster_rcnn_inception_resnet_v2_atrous_pets.config
Traceback (most recent call last):
  File "train.py", line 198, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "train.py", line 143, in main
    model_config, train_config, input_config = get_configs_from_pipeline_file()
  File "train.py", line 103, in get_configs_from_pipeline_file
    text_format.Merge(f.read(), pipeline_config)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 118, in read
    self._preread_check() …
Run Code Online (Sandbox Code Playgroud)

python object-detection python-2.7 tensorflow

2
推荐指数
1
解决办法
792
查看次数

Tensorflow对象检测,生成tfrecord时出错[TypeError:None的类型为NoneType,但应为以下类型之一:int,long]

在检查网上可用的不同解决方案时,大多数人(包括datitran)指出,它可能是火车csv文件中的类缺失或拼写错误。由于标签是使用labelImg完成的,因此无法弄清楚,它将这些类另存为xml,xml_to_csv.py将其转换为csv。不知道在什么情况下我本来有机会错过或误判任何班级。

这是正在处理的错误:

(OT) 
nisxxxxx@xxxxxxxx:~/Desktop/OD/models/research/object_detection$ 
python generate_tfrecord.py --csv_input=data/train_labels.csv  --
output_path=data/train.record
Traceback (most recent call last):
  File "generate_tfrecord.py", line 192, in <module>
    tf.app.run()
  File "/home/nisxxxxx/Desktop/test_OD/OT/lib/python2.7/site-
packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "generate_tfrecord.py", line 184, in main
tf_example = create_tf_example(group, path)
  File "generate_tfrecord.py", line 173, in create_tf_example
    'image/object/class/label': 
dataset_util.int64_list_feature(classes),
File"/home/nishanth/Desktop/test_OD/models/research/object_detection/utils/dat
aset_util.py", line 26, in int64_list_feature
    return 
tf.train.Feature(int64_list=tf.train.Int64List(value=value))
TypeError: None has type NoneType, but expected one of: int, long
Run Code Online (Sandbox Code Playgroud)

有人能解决这个问题吗?

object-detection tensorflow tfrecord

2
推荐指数
1
解决办法
2025
查看次数