【问题标题】:Unsupported operand type for /: 'str' and 'int'/ 不支持的操作数类型:“str”和“int”
【发布时间】:2022-07-27 16:08:15
【问题描述】:
height, width, channels = img.shape

scale = ROBOFLOW_SIZE / max(height, width)

img = cv2.resize(img, (round(scale * width), round(scale * height)))

我一直在尝试让 Roboflow 代码在我的 Picam 上运行,但似乎无法绕过此错误。我已将 ROBOFLOW_SIZE 定义为“416”。任何帮助将不胜感激。

【问题讨论】:

    标签: python roboflow


    【解决方案1】:

    您不能将str"416" 除以int
    这就像试图分割字符串,"four hundred and sixteen" / 10

    首先将其转换为intint(ROBOFLOW_SIZE) / max(height, width)

    【讨论】:

      猜你喜欢
      • 2016-04-15
      • 2012-11-29
      • 2012-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-15
      • 2021-11-16
      相关资源
      最近更新 更多