我正在使用Alturos.Yolo来检测对象。它会自动检测物体,但是我只想检测给定的物体,例如集体照片中的一张脸或图像中的物体列表中的一个目标物体。
这是我正在使用的代码
tensor = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
dataset = tf.data.Dataset.from_tensor_slices((
tensor,
[[0.0], [1.0], [1.0]] # Arbitrary targets.
))
print(dataset.element_spec)
>>> (TensorSpec(shape=(3, 1), dtype=tf.int32, name=None), TensorSpec(shape=(1,), dtype=tf.float32, name=None))
此代码自动检测图像中的对象,但是我没有找到仅检测图像中给定对象的方法。 谢谢