问题描述
我正在使用GitHub上的这段代码,该代码可以识别图像中的颜色,但可以显示十六进制值而不是颜色名称...
这是负责输出的代码的一部分
if int(requested_colour[0]) > 0 and int(
requested_colour[1]) > 0 and int(
requested_colour[2]) > 0:
hexcod = rgb2hex(int(requested_colour[0]),\
int(requested_colour[1]),\
int(requested_colour[2]))
actualhexcod_csv.append(hexcod)
colors.append({'hex': hexcod,'percent': percent * 100})
我期望这样:
[{'prediction': {'Base': u'red','Shade': u'sangria'},'probability': 1}]
但是得到了:
[{'hex': '#DD6902','percent': 0.23500000000000001},{'hex': '#F27C0A','percent': 0.3575},{'hex': '#D25F01','percent': 0.1825},{'hex': '#E77306','percent': 0.2575}]
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)