finish:ImageAnalyse

This commit is contained in:
Bairly 2025-04-02 09:18:48 +08:00
parent 5887b83698
commit f399d06390
3 changed files with 1169 additions and 13 deletions

View File

@ -141,19 +141,32 @@ def batch_process(urls, workers=4):
# 使用示例
if __name__ == "__main__":
# 读取URL列表
input_csv = "data_all_first_ver.csv"
#输出路径
os.makedirs('./result', exist_ok=True)
output_csv = "result/analysis_results.csv"
# # 读取URL列表
# input_csv = "data_all_first_ver.csv"
# #输出路径
# os.makedirs('./result', exist_ok=True)
# output_csv = "result/analysis_results.csv"
#
# #完整运行
# df = pd.read_csv(input_csv)
# urls = df['视频封面URL'].tolist()
#
# # 执行分析
# result_df = batch_process(urls)
# result_df.to_csv(output_csv, index=False, encoding='utf-8-sig')
# print(f"成功处理 {len(result_df)}/{len(urls)} 张图片")
# print("分析完成!结果已保存至", output_csv)
#重新执行失败的url
urls_failed=[
'http://i1.hdslb.com/bfs/archive/5c42e0fa42ec945106d2e167253889e8a05541c9.jpg',
'http://i1.hdslb.com/bfs/archive/d2ca3e3f4c543245715937bf643e98b55badcc21.jpg',
'http://i0.hdslb.com/bfs/archive/2b1cf64d70bf2036793e33b2de3067344a7ff77d.jpg',
'http://i0.hdslb.com/bfs/archive/123ddc4cdf429968fa416f78f4049a728e8da3ab.jpg',
'http://i2.hdslb.com/bfs/archive/b07446d2176cec63d42f204504f4cda7a940b05b.jpg',
]
result_failed = batch_process(urls_failed)
result_failed.to_csv('result/reanalyze.csv', index=False, encoding='utf-8-sig')
#完整运行
df = pd.read_csv(input_csv)
urls = df['视频封面URL'].tolist()
# 执行分析
result_df = batch_process(urls)
result_df.to_csv(output_csv, index=False, encoding='utf-8-sig')
print(f"成功处理 {len(result_df)}/{len(urls)} 张图片")
print("分析完成!结果已保存至", output_csv)

1137
result/analysis_results.csv Normal file

File diff suppressed because it is too large Load Diff

6
result/reanalyze.csv Normal file
View File

@ -0,0 +1,6 @@
url,success,Portrait,WarmRatio,CoolRatio,NeutralRatio
http://i1.hdslb.com/bfs/archive/5c42e0fa42ec945106d2e167253889e8a05541c9.jpg,False,,,,
http://i1.hdslb.com/bfs/archive/d2ca3e3f4c543245715937bf643e98b55badcc21.jpg,False,,,,
http://i0.hdslb.com/bfs/archive/2b1cf64d70bf2036793e33b2de3067344a7ff77d.jpg,True,1.0,0.178,0.414,0.408
http://i0.hdslb.com/bfs/archive/123ddc4cdf429968fa416f78f4049a728e8da3ab.jpg,False,,,,
http://i2.hdslb.com/bfs/archive/b07446d2176cec63d42f204504f4cda7a940b05b.jpg,False,,,,
1 url success Portrait WarmRatio CoolRatio NeutralRatio
2 http://i1.hdslb.com/bfs/archive/5c42e0fa42ec945106d2e167253889e8a05541c9.jpg False
3 http://i1.hdslb.com/bfs/archive/d2ca3e3f4c543245715937bf643e98b55badcc21.jpg False
4 http://i0.hdslb.com/bfs/archive/2b1cf64d70bf2036793e33b2de3067344a7ff77d.jpg True 1.0 0.178 0.414 0.408
5 http://i0.hdslb.com/bfs/archive/123ddc4cdf429968fa416f78f4049a728e8da3ab.jpg False
6 http://i2.hdslb.com/bfs/archive/b07446d2176cec63d42f204504f4cda7a940b05b.jpg False