Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app_gradio/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
color: #fafafa;
opacity: 0.8;
">
Dingo: A Comprehensive Data Quality Evaluation Tool.<br>
Dingo: A Comprehensive AI Data Quality Evaluation Tool.<br>
</p>
<style>
.link-block {
Expand Down
20 changes: 14 additions & 6 deletions dingo/model/rule/rule_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,35 +265,43 @@ def eval(cls, input_data: Data) -> ModelRes:
"img_url": input_data.content,
"style": 1
},
timeout=30 # 设置超时时间
headers={
"Content-Type": "application/json",
"User-Agent": "dingo",
},
# timeout=30 # 设置超时时间
)
response_create_task_json = response_create_task.json()
# print(response_create_task_json)
task_id = response_create_task_json.get('data').get('id')

time.sleep(2)
time.sleep(5)
request_time = 0
while (request_time < 5):
while (True):
request_time += 1
response_get_status = requests.post(
cls.dynamic_config.refer_path[0] + 'api/v1/task/status',
json={
"id": task_id
},
timeout=30 # 设置超时时间
headers={
"Content-Type": "application/json",
"User-Agent": "dingo",
},
# timeout=30 # 设置超时时间
)
response_get_status_json = response_get_status.json()
# print(response_get_status_json)
status_data = response_get_status_json.get('data')
if status_data['phase'] == 'Succeeded':
break
time.sleep(2)
time.sleep(5)

return ModelRes(
error_status=True if status_data['score_overall'] < cls.dynamic_config.threshold else False,
type="Artimuse_Succeeded",
name="BadImage" if status_data['score_overall'] < cls.dynamic_config.threshold else "GoodImage",
reason=[json.dumps(status_data['aspects'], ensure_ascii=False)],
reason=[json.dumps(status_data, ensure_ascii=False)],
)
except Exception as e:
return ModelRes(
Expand Down
50 changes: 50 additions & 0 deletions test/data/artimuse/test_artimuse_AVA.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{"id": 1, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/6671.jpg"}
{"id": 2, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/2626.jpg"}
{"id": 3, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/3504.jpg"}
{"id": 4, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/7112.jpg"}
{"id": 5, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/540.jpg"}
{"id": 6, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/4012.jpg"}
{"id": 7, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/5613.jpg"}
{"id": 8, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/3261.jpg"}
{"id": 9, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/6015.jpg"}
{"id": 10, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/5960.jpg"}
{"id": 11, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/9436.jpg"}
{"id": 12, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/1006.jpg"}
{"id": 13, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/8921.jpg"}
{"id": 14, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/576.jpg"}
{"id": 15, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/2595.jpg"}
{"id": 16, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/595.jpg"}
{"id": 17, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/9316.jpg"}
{"id": 18, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/4164.jpg"}
{"id": 19, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/4121.jpg"}
{"id": 20, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/9450.jpg"}
{"id": 21, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/9014.jpg"}
{"id": 22, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/4394.jpg"}
{"id": 23, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/2920.jpg"}
{"id": 24, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/6222.jpg"}
{"id": 25, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/2802.jpg"}
{"id": 26, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/8960.jpg"}
{"id": 27, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/3478.jpg"}
{"id": 28, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/6324.jpg"}
{"id": 29, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/1930.jpg"}
{"id": 30, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/1330.jpg"}
{"id": 31, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/1779.jpg"}
{"id": 32, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/1124.jpg"}
{"id": 33, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/4726.jpg"}
{"id": 34, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/2166.jpg"}
{"id": 35, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/5143.jpg"}
{"id": 36, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/1620.jpg"}
{"id": 37, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/493.jpg"}
{"id": 38, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/8728.jpg"}
{"id": 39, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/6220.jpg"}
{"id": 40, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/7462.jpg"}
{"id": 41, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/8614.jpg"}
{"id": 42, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/5494.jpg"}
{"id": 43, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/6746.jpg"}
{"id": 44, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/4423.jpg"}
{"id": 45, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/2766.jpg"}
{"id": 46, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/1350.jpg"}
{"id": 47, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/5461.jpg"}
{"id": 48, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/4447.jpg"}
{"id": 49, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/6111.jpg"}
{"id": 50, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/AVA/8118.jpg"}
50 changes: 50 additions & 0 deletions test/data/artimuse/test_artimuse_FLICKR-AES.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{"id": 1, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_28_96361281_9e25609502.jpg"}
{"id": 2, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_21_25510686_15f1252c7b.jpg"}
{"id": 3, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_32_38983235_417aac284b.jpg"}
{"id": 4, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_26_35447596_0e0ba48994.jpg"}
{"id": 5, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_30_37459196_4b8abed526.jpg"}
{"id": 6, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_26_36622947_db1d9f54cc.jpg"}
{"id": 7, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_19_104070337_3d2aa31581.jpg"}
{"id": 8, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_23_24430354_ac070f17da.jpg"}
{"id": 9, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_29_185787128_b65ee93493.jpg"}
{"id": 10, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_25_63894659_b767e9770d.jpg"}
{"id": 11, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_22_28615451_199be1a41f.jpg"}
{"id": 12, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_22_28371402_22798a2c1c.jpg"}
{"id": 13, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_29_39367401_58ac7e8673.jpg"}
{"id": 14, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_26_50265084_b0402e2905.jpg"}
{"id": 15, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_28_36630945_423b489109.jpg"}
{"id": 16, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_22_32745878_597d48b925.jpg"}
{"id": 17, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_27_37463701_145e66b0d4.jpg"}
{"id": 18, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_23_37459407_c8f51820e8.jpg"}
{"id": 19, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_15_20253408_1830fdd950.jpg"}
{"id": 20, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_25_101449868_884b67dccc.jpg"}
{"id": 21, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_25_64166574_62b97c156c.jpg"}
{"id": 22, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_26_101450188_65461f9215.jpg"}
{"id": 23, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_12_96360708_218d984efc.jpg"}
{"id": 24, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_25_99974609_038c34106d.jpg"}
{"id": 25, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_30_64350633_f9b9453c70.jpg"}
{"id": 26, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_14_16048066_b41ac0c958.jpg"}
{"id": 27, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_24_67810325_f0dcf6aa8c.jpg"}
{"id": 28, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_24_103574927_27b08027c7.jpg"}
{"id": 29, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_26_44238181_0ccd95313e.jpg"}
{"id": 30, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_14_17520932_c9ce6672ca_b.jpg"}
{"id": 31, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_12_16048172_9c692d3087.jpg"}
{"id": 32, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_27_37459731_492d9783d9.jpg"}
{"id": 33, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_1_130867541_03b04a27fe.jpg"}
{"id": 34, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_4_5743333_902ed3e712.jpg"}
{"id": 35, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_16_20254524_a09872a744.jpg"}
{"id": 36, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_17_20753480_5b133ee19d_b.jpg"}
{"id": 37, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_21_27295405_f8336f3f6d.jpg"}
{"id": 38, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_28_36622182_82e35b0deb.jpg"}
{"id": 39, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_31_57107529_ac3a231035.jpg"}
{"id": 40, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_2_3572895_42ea649de2.jpg"}
{"id": 41, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_30_50264099_adc1a4688f.jpg"}
{"id": 42, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_21_28618876_df54f1ae03.jpg"}
{"id": 43, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_32_60095651_a9df332acc.jpg"}
{"id": 44, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_23_25417051_3505f3057b.jpg"}
{"id": 45, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_1_3071074_111064200d.jpg"}
{"id": 46, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_21_32746061_507ed56842.jpg"}
{"id": 47, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_23_26402563_b869e151a2.jpg"}
{"id": 48, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_20_72491345_63392d2949.jpg"}
{"id": 49, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_27_41962359_ae98085a8b.jpg"}
{"id": 50, "content": "https://openxlab.oss-cn-shanghai.aliyuncs.com/artimuse/dingo/image_dataset_100/FLICKR-AES/farm1_10_16048330_d335b9e7ef.jpg"}
Loading