diff --git a/Shapegrid/ShapeGrid_count.tsv b/Shapegrid/ShapeGrid_count.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1271e3ac8f908e7b3727c8034c670e5646f81e73 --- /dev/null +++ b/Shapegrid/ShapeGrid_count.tsv @@ -0,0 +1,1001 @@ +index image_path question answer category +1 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_1.png How many parallelograms are in the image? 3 count +2 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_2.png How many diamonds are in the image? 2 count +3 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_3.png How many squares are in the image? 2 count +4 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_4.png How many pentagons are in the image? 1 count +5 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_5.png How many circles are in the image? 2 count +6 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_6.png How many hexagons are in the image? 1 count +7 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_7.png How many parallelograms are in the image? 1 count +8 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_8.png How many trapezoids are in the image? 1 count +9 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_9.png How many pentagons are in the image? 1 count +10 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_10.png How many triangles are in the image? 2 count +11 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_11.png How many hexagons are in the image? 1 count +12 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_12.png How many pentagons are in the image? 5 count +13 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_13.png How many circles are in the image? 1 count +14 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_14.png How many diamonds are in the image? 2 count +15 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_15.png How many squares are in the image? 1 count +16 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_16.png How many hexagons are in the image? 2 count +17 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_17.png How many triangles are in the image? 3 count +18 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_18.png How many parallelograms are in the image? 2 count +19 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_19.png How many hexagons are in the image? 6 count +20 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_20.png How many triangles are in the image? 4 count +21 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_21.png How many squares are in the image? 1 count +22 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_22.png How many squares are in the image? 2 count +23 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_23.png How many diamonds are in the image? 4 count +24 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_24.png How many parallelograms are in the image? 3 count +25 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_25.png How many triangles are in the image? 1 count +26 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_26.png How many circles are in the image? 4 count +27 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_27.png How many squares are in the image? 2 count +28 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_28.png How many diamonds are in the image? 2 count +29 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_29.png How many pentagons are in the image? 4 count +30 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_30.png How many trapezoids are in the image? 2 count +31 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_31.png How many hexagons are in the image? 1 count +32 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_32.png How many squares are in the image? 2 count +33 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_33.png How many diamonds are in the image? 1 count +34 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_34.png How many trapezoids are in the image? 2 count +35 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_35.png How many trapezoids are in the image? 1 count +36 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_36.png How many parallelograms are in the image? 5 count +37 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_37.png How many triangles are in the image? 2 count +38 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_38.png How many hexagons are in the image? 1 count +39 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_39.png How many hexagons are in the image? 1 count +40 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_40.png How many triangles are in the image? 2 count +41 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_41.png How many parallelograms are in the image? 1 count +42 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_42.png How many circles are in the image? 2 count +43 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_43.png How many parallelograms are in the image? 2 count +44 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_44.png How many squares are in the image? 4 count +45 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_45.png How many triangles are in the image? 1 count +46 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_46.png How many hexagons are in the image? 2 count +47 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_47.png How many pentagons are in the image? 3 count +48 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_48.png How many squares are in the image? 2 count +49 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_49.png How many trapezoids are in the image? 2 count +50 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_50.png How many parallelograms are in the image? 3 count +51 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_51.png How many squares are in the image? 2 count +52 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_52.png How many hexagons are in the image? 6 count +53 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_53.png How many circles are in the image? 1 count +54 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_54.png How many hexagons are in the image? 2 count +55 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_55.png How many pentagons are in the image? 2 count +56 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_56.png How many parallelograms are in the image? 3 count +57 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_57.png How many parallelograms are in the image? 2 count +58 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_58.png How many diamonds are in the image? 2 count +59 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_59.png How many trapezoids are in the image? 4 count +60 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_60.png How many parallelograms are in the image? 1 count +61 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_61.png How many triangles are in the image? 2 count +62 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_62.png How many squares are in the image? 2 count +63 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_63.png How many trapezoids are in the image? 2 count +64 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_64.png How many diamonds are in the image? 1 count +65 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_65.png How many trapezoids are in the image? 2 count +66 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_66.png How many diamonds are in the image? 1 count +67 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_67.png How many trapezoids are in the image? 2 count +68 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_68.png How many triangles are in the image? 2 count +69 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_69.png How many triangles are in the image? 2 count +70 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_70.png How many pentagons are in the image? 1 count +71 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_71.png How many circles are in the image? 2 count +72 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_72.png How many hexagons are in the image? 4 count +73 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_73.png How many triangles are in the image? 2 count +74 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_74.png How many hexagons are in the image? 2 count +75 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_75.png How many triangles are in the image? 2 count +76 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_76.png How many circles are in the image? 2 count +77 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_77.png How many diamonds are in the image? 2 count +78 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_78.png How many pentagons are in the image? 1 count +79 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_79.png How many diamonds are in the image? 2 count +80 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_80.png How many hexagons are in the image? 4 count +81 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_81.png How many diamonds are in the image? 2 count +82 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_82.png How many trapezoids are in the image? 2 count +83 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_83.png How many diamonds are in the image? 5 count +84 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_84.png How many squares are in the image? 1 count +85 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_85.png How many diamonds are in the image? 1 count +86 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_86.png How many squares are in the image? 1 count +87 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_87.png How many circles are in the image? 2 count +88 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_88.png How many trapezoids are in the image? 1 count +89 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_89.png How many pentagons are in the image? 1 count +90 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_90.png How many circles are in the image? 2 count +91 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_91.png How many pentagons are in the image? 2 count +92 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_92.png How many parallelograms are in the image? 1 count +93 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_93.png How many parallelograms are in the image? 4 count +94 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_94.png How many circles are in the image? 3 count +95 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_95.png How many squares are in the image? 1 count +96 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_96.png How many trapezoids are in the image? 2 count +97 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_97.png How many pentagons are in the image? 1 count +98 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_98.png How many trapezoids are in the image? 1 count +99 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_99.png How many hexagons are in the image? 1 count +100 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_100.png How many circles are in the image? 1 count +101 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_101.png How many parallelograms are in the image? 2 count +102 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_102.png How many pentagons are in the image? 2 count +103 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_103.png How many diamonds are in the image? 2 count +104 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_104.png How many parallelograms are in the image? 2 count +105 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_105.png How many diamonds are in the image? 5 count +106 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_106.png How many diamonds are in the image? 2 count +107 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_107.png How many squares are in the image? 1 count +108 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_108.png How many parallelograms are in the image? 1 count +109 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_109.png How many hexagons are in the image? 2 count +110 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_110.png How many circles are in the image? 2 count +111 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_111.png How many triangles are in the image? 1 count +112 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_112.png How many triangles are in the image? 2 count +113 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_113.png How many pentagons are in the image? 1 count +114 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_114.png How many trapezoids are in the image? 1 count +115 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_115.png How many squares are in the image? 1 count +116 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_116.png How many parallelograms are in the image? 6 count +117 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_117.png How many circles are in the image? 6 count +118 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_118.png How many squares are in the image? 1 count +119 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_119.png How many trapezoids are in the image? 1 count +120 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_120.png How many diamonds are in the image? 1 count +121 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_121.png How many trapezoids are in the image? 2 count +122 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_122.png How many pentagons are in the image? 3 count +123 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_123.png How many pentagons are in the image? 1 count +124 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_124.png How many hexagons are in the image? 1 count +125 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_125.png How many squares are in the image? 6 count +126 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_126.png How many squares are in the image? 2 count +127 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_127.png How many trapezoids are in the image? 2 count +128 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_128.png How many pentagons are in the image? 2 count +129 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_129.png How many pentagons are in the image? 1 count +130 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_130.png How many trapezoids are in the image? 3 count +131 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_131.png How many squares are in the image? 2 count +132 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_132.png How many parallelograms are in the image? 2 count +133 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_133.png How many hexagons are in the image? 3 count +134 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_134.png How many pentagons are in the image? 1 count +135 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_135.png How many diamonds are in the image? 3 count +136 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_136.png How many squares are in the image? 2 count +137 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_137.png How many triangles are in the image? 1 count +138 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_138.png How many triangles are in the image? 2 count +139 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_139.png How many trapezoids are in the image? 3 count +140 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_140.png How many trapezoids are in the image? 2 count +141 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_141.png How many squares are in the image? 1 count +142 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_142.png How many circles are in the image? 1 count +143 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_143.png How many parallelograms are in the image? 1 count +144 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_144.png How many hexagons are in the image? 1 count +145 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_145.png How many diamonds are in the image? 2 count +146 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_146.png How many hexagons are in the image? 1 count +147 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_147.png How many hexagons are in the image? 2 count +148 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_148.png How many hexagons are in the image? 1 count +149 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_149.png How many circles are in the image? 3 count +150 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_150.png How many triangles are in the image? 4 count +151 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_151.png How many pentagons are in the image? 1 count +152 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_152.png How many pentagons are in the image? 2 count +153 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_153.png How many diamonds are in the image? 2 count +154 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_154.png How many trapezoids are in the image? 6 count +155 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_155.png How many squares are in the image? 3 count +156 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_156.png How many hexagons are in the image? 4 count +157 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_157.png How many hexagons are in the image? 2 count +158 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_158.png How many hexagons are in the image? 1 count +159 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_159.png How many diamonds are in the image? 2 count +160 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_160.png How many circles are in the image? 2 count +161 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_161.png How many parallelograms are in the image? 2 count +162 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_162.png How many hexagons are in the image? 2 count +163 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_163.png How many squares are in the image? 2 count +164 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_164.png How many circles are in the image? 1 count +165 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_165.png How many hexagons are in the image? 4 count +166 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_166.png How many parallelograms are in the image? 1 count +167 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_167.png How many hexagons are in the image? 2 count +168 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_168.png How many diamonds are in the image? 1 count +169 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_169.png How many diamonds are in the image? 1 count +170 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_170.png How many circles are in the image? 2 count +171 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_171.png How many diamonds are in the image? 2 count +172 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_172.png How many diamonds are in the image? 2 count +173 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_173.png How many circles are in the image? 2 count +174 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_174.png How many parallelograms are in the image? 1 count +175 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_175.png How many triangles are in the image? 3 count +176 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_176.png How many trapezoids are in the image? 3 count +177 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_177.png How many trapezoids are in the image? 1 count +178 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_178.png How many parallelograms are in the image? 2 count +179 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_179.png How many diamonds are in the image? 2 count +180 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_180.png How many circles are in the image? 2 count +181 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_181.png How many trapezoids are in the image? 2 count +182 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_182.png How many trapezoids are in the image? 1 count +183 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_183.png How many squares are in the image? 1 count +184 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_184.png How many parallelograms are in the image? 2 count +185 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_185.png How many circles are in the image? 3 count +186 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_186.png How many diamonds are in the image? 2 count +187 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_187.png How many circles are in the image? 3 count +188 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_188.png How many hexagons are in the image? 2 count +189 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_189.png How many circles are in the image? 1 count +190 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_190.png How many pentagons are in the image? 1 count +191 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_191.png How many diamonds are in the image? 2 count +192 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_192.png How many diamonds are in the image? 3 count +193 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_193.png How many squares are in the image? 1 count +194 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_194.png How many circles are in the image? 2 count +195 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_195.png How many diamonds are in the image? 2 count +196 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_196.png How many triangles are in the image? 1 count +197 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_197.png How many circles are in the image? 2 count +198 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_198.png How many trapezoids are in the image? 3 count +199 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_199.png How many circles are in the image? 1 count +200 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_200.png How many diamonds are in the image? 1 count +201 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_201.png How many squares are in the image? 1 count +202 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_202.png How many hexagons are in the image? 4 count +203 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_203.png How many pentagons are in the image? 2 count +204 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_204.png How many hexagons are in the image? 5 count +205 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_205.png How many hexagons are in the image? 1 count +206 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_206.png How many squares are in the image? 2 count +207 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_207.png How many parallelograms are in the image? 1 count +208 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_208.png How many triangles are in the image? 3 count +209 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_209.png How many squares are in the image? 1 count +210 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_210.png How many pentagons are in the image? 1 count +211 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_211.png How many squares are in the image? 1 count +212 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_212.png How many hexagons are in the image? 2 count +213 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_213.png How many pentagons are in the image? 5 count +214 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_214.png How many triangles are in the image? 2 count +215 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_215.png How many circles are in the image? 1 count +216 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_216.png How many pentagons are in the image? 2 count +217 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_217.png How many parallelograms are in the image? 4 count +218 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_218.png How many squares are in the image? 2 count +219 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_219.png How many circles are in the image? 2 count +220 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_220.png How many parallelograms are in the image? 2 count +221 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_221.png How many diamonds are in the image? 2 count +222 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_222.png How many trapezoids are in the image? 2 count +223 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_223.png How many triangles are in the image? 2 count +224 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_224.png How many squares are in the image? 1 count +225 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_225.png How many parallelograms are in the image? 2 count +226 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_226.png How many parallelograms are in the image? 1 count +227 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_227.png How many parallelograms are in the image? 2 count +228 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_228.png How many hexagons are in the image? 6 count +229 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_229.png How many pentagons are in the image? 2 count +230 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_230.png How many circles are in the image? 2 count +231 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_231.png How many diamonds are in the image? 2 count +232 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_232.png How many diamonds are in the image? 2 count +233 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_233.png How many squares are in the image? 1 count +234 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_234.png How many pentagons are in the image? 1 count +235 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_235.png How many hexagons are in the image? 4 count +236 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_236.png How many parallelograms are in the image? 1 count +237 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_237.png How many hexagons are in the image? 1 count +238 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_238.png How many diamonds are in the image? 2 count +239 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_239.png How many squares are in the image? 2 count +240 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_240.png How many circles are in the image? 2 count +241 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_241.png How many diamonds are in the image? 3 count +242 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_242.png How many triangles are in the image? 2 count +243 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_243.png How many trapezoids are in the image? 1 count +244 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_244.png How many trapezoids are in the image? 2 count +245 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_245.png How many circles are in the image? 2 count +246 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_246.png How many squares are in the image? 2 count +247 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_247.png How many triangles are in the image? 1 count +248 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_248.png How many circles are in the image? 4 count +249 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_249.png How many hexagons are in the image? 1 count +250 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_250.png How many circles are in the image? 4 count +251 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_251.png How many trapezoids are in the image? 5 count +252 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_252.png How many hexagons are in the image? 2 count +253 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_253.png How many triangles are in the image? 2 count +254 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_254.png How many squares are in the image? 1 count +255 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_255.png How many parallelograms are in the image? 2 count +256 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_256.png How many triangles are in the image? 1 count +257 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_257.png How many diamonds are in the image? 2 count +258 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_258.png How many parallelograms are in the image? 1 count +259 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_259.png How many diamonds are in the image? 3 count +260 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_260.png How many diamonds are in the image? 2 count +261 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_261.png How many pentagons are in the image? 1 count +262 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_262.png How many squares are in the image? 2 count +263 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_263.png How many triangles are in the image? 2 count +264 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_264.png How many pentagons are in the image? 1 count +265 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_265.png How many trapezoids are in the image? 2 count +266 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_266.png How many hexagons are in the image? 5 count +267 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_267.png How many trapezoids are in the image? 1 count +268 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_268.png How many parallelograms are in the image? 6 count +269 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_269.png How many pentagons are in the image? 2 count +270 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_270.png How many triangles are in the image? 2 count +271 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_271.png How many diamonds are in the image? 2 count +272 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_272.png How many squares are in the image? 1 count +273 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_273.png How many squares are in the image? 2 count +274 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_274.png How many hexagons are in the image? 2 count +275 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_275.png How many circles are in the image? 1 count +276 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_276.png How many circles are in the image? 2 count +277 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_277.png How many pentagons are in the image? 3 count +278 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_278.png How many pentagons are in the image? 1 count +279 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_279.png How many pentagons are in the image? 2 count +280 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_280.png How many circles are in the image? 1 count +281 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_281.png How many parallelograms are in the image? 1 count +282 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_282.png How many pentagons are in the image? 3 count +283 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_283.png How many pentagons are in the image? 1 count +284 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_284.png How many circles are in the image? 2 count +285 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_285.png How many pentagons are in the image? 2 count +286 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_286.png How many circles are in the image? 1 count +287 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_287.png How many circles are in the image? 1 count +288 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_288.png How many parallelograms are in the image? 4 count +289 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_289.png How many hexagons are in the image? 2 count +290 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_290.png How many triangles are in the image? 1 count +291 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_291.png How many triangles are in the image? 2 count +292 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_292.png How many squares are in the image? 1 count +293 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_293.png How many parallelograms are in the image? 2 count +294 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_294.png How many hexagons are in the image? 2 count +295 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_295.png How many squares are in the image? 1 count +296 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_296.png How many circles are in the image? 2 count +297 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_297.png How many triangles are in the image? 1 count +298 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_298.png How many diamonds are in the image? 6 count +299 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_299.png How many circles are in the image? 5 count +300 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_300.png How many squares are in the image? 1 count +301 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_301.png How many parallelograms are in the image? 2 count +302 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_302.png How many diamonds are in the image? 2 count +303 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_303.png How many circles are in the image? 1 count +304 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_304.png How many triangles are in the image? 2 count +305 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_305.png How many parallelograms are in the image? 1 count +306 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_306.png How many triangles are in the image? 2 count +307 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_307.png How many trapezoids are in the image? 2 count +308 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_308.png How many hexagons are in the image? 4 count +309 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_309.png How many circles are in the image? 4 count +310 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_310.png How many pentagons are in the image? 1 count +311 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_311.png How many circles are in the image? 4 count +312 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_312.png How many parallelograms are in the image? 1 count +313 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_313.png How many parallelograms are in the image? 1 count +314 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_314.png How many diamonds are in the image? 2 count +315 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_315.png How many triangles are in the image? 1 count +316 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_316.png How many triangles are in the image? 2 count +317 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_317.png How many hexagons are in the image? 2 count +318 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_318.png How many circles are in the image? 2 count +319 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_319.png How many squares are in the image? 2 count +320 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_320.png How many circles are in the image? 1 count +321 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_321.png How many diamonds are in the image? 1 count +322 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_322.png How many hexagons are in the image? 3 count +323 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_323.png How many squares are in the image? 1 count +324 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_324.png How many squares are in the image? 1 count +325 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_325.png How many pentagons are in the image? 1 count +326 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_326.png How many squares are in the image? 2 count +327 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_327.png How many diamonds are in the image? 1 count +328 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_328.png How many diamonds are in the image? 3 count +329 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_329.png How many squares are in the image? 1 count +330 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_330.png How many circles are in the image? 2 count +331 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_331.png How many squares are in the image? 1 count +332 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_332.png How many trapezoids are in the image? 2 count +333 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_333.png How many parallelograms are in the image? 3 count +334 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_334.png How many circles are in the image? 1 count +335 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_335.png How many pentagons are in the image? 1 count +336 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_336.png How many squares are in the image? 2 count +337 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_337.png How many hexagons are in the image? 2 count +338 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_338.png How many pentagons are in the image? 1 count +339 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_339.png How many circles are in the image? 2 count +340 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_340.png How many squares are in the image? 1 count +341 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_341.png How many parallelograms are in the image? 2 count +342 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_342.png How many diamonds are in the image? 1 count +343 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_343.png How many parallelograms are in the image? 2 count +344 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_344.png How many triangles are in the image? 2 count +345 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_345.png How many pentagons are in the image? 2 count +346 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_346.png How many triangles are in the image? 2 count +347 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_347.png How many diamonds are in the image? 3 count +348 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_348.png How many parallelograms are in the image? 1 count +349 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_349.png How many trapezoids are in the image? 1 count +350 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_350.png How many pentagons are in the image? 1 count +351 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_351.png How many circles are in the image? 4 count +352 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_352.png How many pentagons are in the image? 2 count +353 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_353.png How many pentagons are in the image? 1 count +354 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_354.png How many parallelograms are in the image? 3 count +355 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_355.png How many circles are in the image? 2 count +356 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_356.png How many hexagons are in the image? 3 count +357 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_357.png How many hexagons are in the image? 4 count +358 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_358.png How many hexagons are in the image? 2 count +359 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_359.png How many trapezoids are in the image? 2 count +360 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_360.png How many triangles are in the image? 2 count +361 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_361.png How many hexagons are in the image? 2 count +362 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_362.png How many trapezoids are in the image? 2 count +363 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_363.png How many triangles are in the image? 4 count +364 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_364.png How many trapezoids are in the image? 1 count +365 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_365.png How many circles are in the image? 5 count +366 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_366.png How many circles are in the image? 1 count +367 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_367.png How many diamonds are in the image? 2 count +368 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_368.png How many parallelograms are in the image? 1 count +369 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_369.png How many trapezoids are in the image? 2 count +370 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_370.png How many hexagons are in the image? 2 count +371 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_371.png How many circles are in the image? 2 count +372 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_372.png How many hexagons are in the image? 2 count +373 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_373.png How many diamonds are in the image? 2 count +374 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_374.png How many circles are in the image? 1 count +375 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_375.png How many parallelograms are in the image? 1 count +376 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_376.png How many pentagons are in the image? 2 count +377 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_377.png How many parallelograms are in the image? 2 count +378 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_378.png How many diamonds are in the image? 2 count +379 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_379.png How many diamonds are in the image? 3 count +380 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_380.png How many triangles are in the image? 3 count +381 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_381.png How many trapezoids are in the image? 2 count +382 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_382.png How many pentagons are in the image? 2 count +383 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_383.png How many triangles are in the image? 2 count +384 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_384.png How many trapezoids are in the image? 3 count +385 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_385.png How many parallelograms are in the image? 1 count +386 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_386.png How many diamonds are in the image? 3 count +387 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_387.png How many trapezoids are in the image? 1 count +388 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_388.png How many squares are in the image? 1 count +389 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_389.png How many diamonds are in the image? 1 count +390 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_390.png How many squares are in the image? 1 count +391 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_391.png How many trapezoids are in the image? 2 count +392 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_392.png How many pentagons are in the image? 2 count +393 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_393.png How many squares are in the image? 1 count +394 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_394.png How many circles are in the image? 2 count +395 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_395.png How many pentagons are in the image? 2 count +396 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_396.png How many circles are in the image? 4 count +397 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_397.png How many trapezoids are in the image? 2 count +398 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_398.png How many parallelograms are in the image? 1 count +399 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_399.png How many diamonds are in the image? 2 count +400 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_400.png How many pentagons are in the image? 2 count +401 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_401.png How many triangles are in the image? 1 count +402 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_402.png How many hexagons are in the image? 2 count +403 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_403.png How many triangles are in the image? 1 count +404 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_404.png How many hexagons are in the image? 4 count +405 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_405.png How many hexagons are in the image? 2 count +406 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_406.png How many trapezoids are in the image? 1 count +407 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_407.png How many parallelograms are in the image? 1 count +408 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_408.png How many trapezoids are in the image? 2 count +409 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_409.png How many hexagons are in the image? 1 count +410 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_410.png How many hexagons are in the image? 4 count +411 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_411.png How many squares are in the image? 1 count +412 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_412.png How many parallelograms are in the image? 2 count +413 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_413.png How many pentagons are in the image? 6 count +414 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_414.png How many pentagons are in the image? 3 count +415 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_415.png How many hexagons are in the image? 2 count +416 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_416.png How many circles are in the image? 1 count +417 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_417.png How many triangles are in the image? 1 count +418 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_418.png How many squares are in the image? 2 count +419 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_419.png How many parallelograms are in the image? 2 count +420 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_420.png How many circles are in the image? 2 count +421 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_421.png How many diamonds are in the image? 1 count +422 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_422.png How many pentagons are in the image? 1 count +423 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_423.png How many trapezoids are in the image? 1 count +424 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_424.png How many triangles are in the image? 2 count +425 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_425.png How many squares are in the image? 6 count +426 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_426.png How many diamonds are in the image? 2 count +427 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_427.png How many diamonds are in the image? 2 count +428 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_428.png How many trapezoids are in the image? 1 count +429 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_429.png How many parallelograms are in the image? 2 count +430 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_430.png How many parallelograms are in the image? 2 count +431 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_431.png How many triangles are in the image? 2 count +432 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_432.png How many squares are in the image? 2 count +433 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_433.png How many trapezoids are in the image? 2 count +434 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_434.png How many parallelograms are in the image? 1 count +435 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_435.png How many pentagons are in the image? 1 count +436 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_436.png How many squares are in the image? 1 count +437 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_437.png How many circles are in the image? 2 count +438 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_438.png How many circles are in the image? 2 count +439 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_439.png How many triangles are in the image? 4 count +440 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_440.png How many triangles are in the image? 2 count +441 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_441.png How many circles are in the image? 6 count +442 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_442.png How many hexagons are in the image? 1 count +443 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_443.png How many circles are in the image? 1 count +444 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_444.png How many circles are in the image? 2 count +445 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_445.png How many pentagons are in the image? 2 count +446 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_446.png How many pentagons are in the image? 1 count +447 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_447.png How many circles are in the image? 3 count +448 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_448.png How many triangles are in the image? 3 count +449 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_449.png How many diamonds are in the image? 1 count +450 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_450.png How many diamonds are in the image? 2 count +451 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_451.png How many squares are in the image? 2 count +452 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_452.png How many triangles are in the image? 1 count +453 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_453.png How many pentagons are in the image? 3 count +454 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_454.png How many triangles are in the image? 3 count +455 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_455.png How many trapezoids are in the image? 3 count +456 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_456.png How many circles are in the image? 2 count +457 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_457.png How many parallelograms are in the image? 2 count +458 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_458.png How many squares are in the image? 1 count +459 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_459.png How many circles are in the image? 3 count +460 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_460.png How many diamonds are in the image? 5 count +461 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_461.png How many parallelograms are in the image? 2 count +462 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_462.png How many hexagons are in the image? 2 count +463 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_463.png How many parallelograms are in the image? 2 count +464 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_464.png How many triangles are in the image? 1 count +465 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_465.png How many triangles are in the image? 1 count +466 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_466.png How many diamonds are in the image? 2 count +467 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_467.png How many triangles are in the image? 2 count +468 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_468.png How many parallelograms are in the image? 2 count +469 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_469.png How many squares are in the image? 2 count +470 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_470.png How many hexagons are in the image? 2 count +471 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_471.png How many trapezoids are in the image? 1 count +472 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_472.png How many hexagons are in the image? 4 count +473 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_473.png How many circles are in the image? 2 count +474 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_474.png How many diamonds are in the image? 3 count +475 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_475.png How many triangles are in the image? 2 count +476 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_476.png How many diamonds are in the image? 2 count +477 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_477.png How many squares are in the image? 2 count +478 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_478.png How many squares are in the image? 6 count +479 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_479.png How many triangles are in the image? 2 count +480 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_480.png How many circles are in the image? 1 count +481 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_481.png How many diamonds are in the image? 2 count +482 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_482.png How many squares are in the image? 2 count +483 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_483.png How many hexagons are in the image? 2 count +484 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_484.png How many diamonds are in the image? 1 count +485 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_485.png How many pentagons are in the image? 2 count +486 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_486.png How many circles are in the image? 2 count +487 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_487.png How many hexagons are in the image? 4 count +488 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_488.png How many triangles are in the image? 2 count +489 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_489.png How many pentagons are in the image? 1 count +490 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_490.png How many circles are in the image? 1 count +491 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_491.png How many diamonds are in the image? 3 count +492 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_492.png How many squares are in the image? 2 count +493 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_493.png How many squares are in the image? 2 count +494 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_494.png How many squares are in the image? 1 count +495 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_495.png How many squares are in the image? 2 count +496 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_496.png How many diamonds are in the image? 2 count +497 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_497.png How many triangles are in the image? 3 count +498 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_498.png How many squares are in the image? 2 count +499 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_499.png How many trapezoids are in the image? 3 count +500 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_500.png How many squares are in the image? 1 count +501 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_501.png How many parallelograms are in the image? 4 count +502 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_502.png How many parallelograms are in the image? 1 count +503 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_503.png How many parallelograms are in the image? 1 count +504 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_504.png How many trapezoids are in the image? 2 count +505 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_505.png How many parallelograms are in the image? 2 count +506 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_506.png How many pentagons are in the image? 2 count +507 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_507.png How many diamonds are in the image? 2 count +508 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_508.png How many parallelograms are in the image? 1 count +509 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_509.png How many squares are in the image? 3 count +510 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_510.png How many diamonds are in the image? 2 count +511 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_511.png How many pentagons are in the image? 3 count +512 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_512.png How many squares are in the image? 5 count +513 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_513.png How many hexagons are in the image? 2 count +514 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_514.png How many circles are in the image? 1 count +515 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_515.png How many circles are in the image? 4 count +516 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_516.png How many hexagons are in the image? 3 count +517 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_517.png How many circles are in the image? 2 count +518 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_518.png How many pentagons are in the image? 3 count +519 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_519.png How many pentagons are in the image? 4 count +520 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_520.png How many squares are in the image? 3 count +521 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_521.png How many circles are in the image? 3 count +522 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_522.png How many trapezoids are in the image? 1 count +523 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_523.png How many triangles are in the image? 2 count +524 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_524.png How many pentagons are in the image? 1 count +525 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_525.png How many squares are in the image? 2 count +526 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_526.png How many parallelograms are in the image? 1 count +527 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_527.png How many pentagons are in the image? 2 count +528 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_528.png How many squares are in the image? 2 count +529 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_529.png How many triangles are in the image? 2 count +530 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_530.png How many diamonds are in the image? 1 count +531 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_531.png How many diamonds are in the image? 2 count +532 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_532.png How many parallelograms are in the image? 4 count +533 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_533.png How many circles are in the image? 1 count +534 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_534.png How many trapezoids are in the image? 2 count +535 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_535.png How many triangles are in the image? 1 count +536 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_536.png How many squares are in the image? 5 count +537 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_537.png How many circles are in the image? 4 count +538 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_538.png How many parallelograms are in the image? 2 count +539 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_539.png How many squares are in the image? 2 count +540 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_540.png How many parallelograms are in the image? 2 count +541 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_541.png How many hexagons are in the image? 1 count +542 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_542.png How many parallelograms are in the image? 1 count +543 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_543.png How many pentagons are in the image? 4 count +544 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_544.png How many trapezoids are in the image? 1 count +545 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_545.png How many parallelograms are in the image? 3 count +546 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_546.png How many parallelograms are in the image? 2 count +547 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_547.png How many triangles are in the image? 3 count +548 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_548.png How many trapezoids are in the image? 2 count +549 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_549.png How many pentagons are in the image? 4 count +550 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_550.png How many squares are in the image? 2 count +551 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_551.png How many pentagons are in the image? 2 count +552 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_552.png How many diamonds are in the image? 2 count +553 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_553.png How many trapezoids are in the image? 2 count +554 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_554.png How many trapezoids are in the image? 2 count +555 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_555.png How many circles are in the image? 2 count +556 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_556.png How many diamonds are in the image? 3 count +557 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_557.png How many squares are in the image? 3 count +558 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_558.png How many hexagons are in the image? 1 count +559 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_559.png How many diamonds are in the image? 1 count +560 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_560.png How many pentagons are in the image? 4 count +561 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_561.png How many hexagons are in the image? 6 count +562 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_562.png How many hexagons are in the image? 1 count +563 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_563.png How many triangles are in the image? 3 count +564 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_564.png How many pentagons are in the image? 4 count +565 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_565.png How many hexagons are in the image? 2 count +566 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_566.png How many hexagons are in the image? 4 count +567 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_567.png How many circles are in the image? 1 count +568 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_568.png How many trapezoids are in the image? 4 count +569 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_569.png How many circles are in the image? 4 count +570 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_570.png How many pentagons are in the image? 1 count +571 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_571.png How many squares are in the image? 1 count +572 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_572.png How many trapezoids are in the image? 1 count +573 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_573.png How many triangles are in the image? 2 count +574 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_574.png How many pentagons are in the image? 1 count +575 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_575.png How many triangles are in the image? 1 count +576 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_576.png How many circles are in the image? 1 count +577 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_577.png How many parallelograms are in the image? 1 count +578 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_578.png How many triangles are in the image? 5 count +579 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_579.png How many triangles are in the image? 2 count +580 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_580.png How many triangles are in the image? 2 count +581 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_581.png How many diamonds are in the image? 2 count +582 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_582.png How many triangles are in the image? 2 count +583 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_583.png How many squares are in the image? 1 count +584 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_584.png How many hexagons are in the image? 3 count +585 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_585.png How many trapezoids are in the image? 2 count +586 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_586.png How many pentagons are in the image? 1 count +587 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_587.png How many parallelograms are in the image? 1 count +588 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_588.png How many diamonds are in the image? 2 count +589 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_589.png How many pentagons are in the image? 1 count +590 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_590.png How many hexagons are in the image? 4 count +591 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_591.png How many hexagons are in the image? 2 count +592 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_592.png How many hexagons are in the image? 3 count +593 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_593.png How many hexagons are in the image? 2 count +594 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_594.png How many triangles are in the image? 1 count +595 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_595.png How many pentagons are in the image? 2 count +596 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_596.png How many trapezoids are in the image? 4 count +597 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_597.png How many trapezoids are in the image? 2 count +598 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_598.png How many diamonds are in the image? 2 count +599 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_599.png How many diamonds are in the image? 3 count +600 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_600.png How many pentagons are in the image? 2 count +601 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_601.png How many triangles are in the image? 2 count +602 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_602.png How many pentagons are in the image? 1 count +603 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_603.png How many squares are in the image? 1 count +604 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_604.png How many squares are in the image? 2 count +605 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_605.png How many diamonds are in the image? 1 count +606 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_606.png How many squares are in the image? 1 count +607 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_607.png How many squares are in the image? 4 count +608 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_608.png How many circles are in the image? 2 count +609 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_609.png How many parallelograms are in the image? 1 count +610 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_610.png How many triangles are in the image? 1 count +611 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_611.png How many circles are in the image? 1 count +612 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_612.png How many circles are in the image? 1 count +613 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_613.png How many hexagons are in the image? 1 count +614 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_614.png How many circles are in the image? 1 count +615 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_615.png How many pentagons are in the image? 1 count +616 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_616.png How many parallelograms are in the image? 1 count +617 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_617.png How many squares are in the image? 1 count +618 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_618.png How many parallelograms are in the image? 2 count +619 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_619.png How many parallelograms are in the image? 1 count +620 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_620.png How many parallelograms are in the image? 2 count +621 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_621.png How many circles are in the image? 1 count +622 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_622.png How many parallelograms are in the image? 2 count +623 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_623.png How many parallelograms are in the image? 3 count +624 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_624.png How many parallelograms are in the image? 3 count +625 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_625.png How many triangles are in the image? 2 count +626 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_626.png How many parallelograms are in the image? 1 count +627 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_627.png How many diamonds are in the image? 2 count +628 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_628.png How many trapezoids are in the image? 1 count +629 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_629.png How many parallelograms are in the image? 2 count +630 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_630.png How many triangles are in the image? 2 count +631 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_631.png How many trapezoids are in the image? 2 count +632 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_632.png How many diamonds are in the image? 4 count +633 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_633.png How many triangles are in the image? 5 count +634 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_634.png How many squares are in the image? 2 count +635 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_635.png How many squares are in the image? 2 count +636 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_636.png How many trapezoids are in the image? 1 count +637 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_637.png How many triangles are in the image? 1 count +638 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_638.png How many trapezoids are in the image? 1 count +639 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_639.png How many triangles are in the image? 1 count +640 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_640.png How many trapezoids are in the image? 2 count +641 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_641.png How many squares are in the image? 2 count +642 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_642.png How many parallelograms are in the image? 2 count +643 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_643.png How many circles are in the image? 2 count +644 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_644.png How many diamonds are in the image? 4 count +645 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_645.png How many triangles are in the image? 2 count +646 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_646.png How many pentagons are in the image? 2 count +647 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_647.png How many pentagons are in the image? 1 count +648 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_648.png How many diamonds are in the image? 1 count +649 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_649.png How many parallelograms are in the image? 4 count +650 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_650.png How many pentagons are in the image? 1 count +651 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_651.png How many triangles are in the image? 2 count +652 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_652.png How many squares are in the image? 2 count +653 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_653.png How many diamonds are in the image? 1 count +654 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_654.png How many diamonds are in the image? 6 count +655 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_655.png How many squares are in the image? 1 count +656 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_656.png How many parallelograms are in the image? 2 count +657 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_657.png How many pentagons are in the image? 1 count +658 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_658.png How many trapezoids are in the image? 1 count +659 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_659.png How many triangles are in the image? 5 count +660 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_660.png How many circles are in the image? 2 count +661 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_661.png How many circles are in the image? 3 count +662 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_662.png How many triangles are in the image? 3 count +663 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_663.png How many triangles are in the image? 1 count +664 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_664.png How many pentagons are in the image? 4 count +665 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_665.png How many hexagons are in the image? 6 count +666 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_666.png How many trapezoids are in the image? 1 count +667 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_667.png How many hexagons are in the image? 1 count +668 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_668.png How many triangles are in the image? 1 count +669 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_669.png How many hexagons are in the image? 2 count +670 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_670.png How many squares are in the image? 2 count +671 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_671.png How many hexagons are in the image? 3 count +672 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_672.png How many pentagons are in the image? 2 count +673 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_673.png How many pentagons are in the image? 2 count +674 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_674.png How many circles are in the image? 1 count +675 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_675.png How many trapezoids are in the image? 5 count +676 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_676.png How many pentagons are in the image? 1 count +677 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_677.png How many circles are in the image? 2 count +678 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_678.png How many parallelograms are in the image? 1 count +679 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_679.png How many diamonds are in the image? 4 count +680 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_680.png How many diamonds are in the image? 2 count +681 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_681.png How many parallelograms are in the image? 2 count +682 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_682.png How many triangles are in the image? 1 count +683 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_683.png How many diamonds are in the image? 4 count +684 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_684.png How many triangles are in the image? 3 count +685 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_685.png How many parallelograms are in the image? 1 count +686 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_686.png How many triangles are in the image? 1 count +687 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_687.png How many parallelograms are in the image? 1 count +688 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_688.png How many trapezoids are in the image? 5 count +689 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_689.png How many squares are in the image? 2 count +690 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_690.png How many pentagons are in the image? 2 count +691 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_691.png How many hexagons are in the image? 1 count +692 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_692.png How many pentagons are in the image? 2 count +693 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_693.png How many hexagons are in the image? 1 count +694 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_694.png How many parallelograms are in the image? 4 count +695 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_695.png How many parallelograms are in the image? 2 count +696 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_696.png How many squares are in the image? 2 count +697 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_697.png How many diamonds are in the image? 1 count +698 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_698.png How many squares are in the image? 4 count +699 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_699.png How many hexagons are in the image? 6 count +700 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_700.png How many squares are in the image? 2 count +701 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_701.png How many hexagons are in the image? 2 count +702 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_702.png How many diamonds are in the image? 1 count +703 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_703.png How many triangles are in the image? 2 count +704 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_704.png How many trapezoids are in the image? 2 count +705 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_705.png How many hexagons are in the image? 2 count +706 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_706.png How many parallelograms are in the image? 1 count +707 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_707.png How many circles are in the image? 3 count +708 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_708.png How many trapezoids are in the image? 2 count +709 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_709.png How many parallelograms are in the image? 2 count +710 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_710.png How many squares are in the image? 1 count +711 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_711.png How many diamonds are in the image? 3 count +712 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_712.png How many trapezoids are in the image? 6 count +713 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_713.png How many squares are in the image? 2 count +714 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_714.png How many hexagons are in the image? 2 count +715 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_715.png How many pentagons are in the image? 4 count +716 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_716.png How many hexagons are in the image? 4 count +717 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_717.png How many hexagons are in the image? 1 count +718 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_718.png How many squares are in the image? 1 count +719 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_719.png How many parallelograms are in the image? 1 count +720 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_720.png How many triangles are in the image? 1 count +721 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_721.png How many squares are in the image? 1 count +722 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_722.png How many squares are in the image? 2 count +723 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_723.png How many triangles are in the image? 2 count +724 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_724.png How many triangles are in the image? 4 count +725 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_725.png How many circles are in the image? 1 count +726 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_726.png How many circles are in the image? 2 count +727 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_727.png How many squares are in the image? 4 count +728 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_728.png How many parallelograms are in the image? 2 count +729 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_729.png How many hexagons are in the image? 2 count +730 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_730.png How many parallelograms are in the image? 2 count +731 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_731.png How many triangles are in the image? 1 count +732 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_732.png How many squares are in the image? 2 count +733 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_733.png How many squares are in the image? 1 count +734 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_734.png How many circles are in the image? 1 count +735 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_735.png How many squares are in the image? 1 count +736 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_736.png How many hexagons are in the image? 2 count +737 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_737.png How many hexagons are in the image? 2 count +738 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_738.png How many trapezoids are in the image? 1 count +739 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_739.png How many parallelograms are in the image? 4 count +740 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_740.png How many squares are in the image? 2 count +741 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_741.png How many trapezoids are in the image? 2 count +742 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_742.png How many parallelograms are in the image? 2 count +743 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_743.png How many hexagons are in the image? 2 count +744 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_744.png How many pentagons are in the image? 1 count +745 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_745.png How many diamonds are in the image? 3 count +746 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_746.png How many pentagons are in the image? 1 count +747 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_747.png How many circles are in the image? 1 count +748 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_748.png How many diamonds are in the image? 2 count +749 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_749.png How many parallelograms are in the image? 1 count +750 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_750.png How many pentagons are in the image? 2 count +751 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_751.png How many diamonds are in the image? 2 count +752 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_752.png How many hexagons are in the image? 2 count +753 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_753.png How many squares are in the image? 2 count +754 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_754.png How many squares are in the image? 2 count +755 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_755.png How many circles are in the image? 1 count +756 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_756.png How many parallelograms are in the image? 2 count +757 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_757.png How many pentagons are in the image? 1 count +758 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_758.png How many triangles are in the image? 3 count +759 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_759.png How many hexagons are in the image? 2 count +760 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_760.png How many trapezoids are in the image? 5 count +761 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_761.png How many triangles are in the image? 2 count +762 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_762.png How many triangles are in the image? 3 count +763 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_763.png How many pentagons are in the image? 1 count +764 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_764.png How many diamonds are in the image? 2 count +765 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_765.png How many hexagons are in the image? 3 count +766 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_766.png How many trapezoids are in the image? 2 count +767 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_767.png How many hexagons are in the image? 2 count +768 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_768.png How many triangles are in the image? 1 count +769 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_769.png How many parallelograms are in the image? 6 count +770 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_770.png How many parallelograms are in the image? 1 count +771 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_771.png How many squares are in the image? 2 count +772 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_772.png How many pentagons are in the image? 1 count +773 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_773.png How many trapezoids are in the image? 4 count +774 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_774.png How many squares are in the image? 3 count +775 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_775.png How many parallelograms are in the image? 2 count +776 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_776.png How many parallelograms are in the image? 2 count +777 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_777.png How many hexagons are in the image? 3 count +778 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_778.png How many diamonds are in the image? 2 count +779 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_779.png How many hexagons are in the image? 2 count +780 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_780.png How many parallelograms are in the image? 1 count +781 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_781.png How many parallelograms are in the image? 4 count +782 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_782.png How many parallelograms are in the image? 2 count +783 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_783.png How many parallelograms are in the image? 2 count +784 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_784.png How many parallelograms are in the image? 2 count +785 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_785.png How many pentagons are in the image? 2 count +786 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_786.png How many parallelograms are in the image? 1 count +787 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_787.png How many circles are in the image? 1 count +788 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_788.png How many triangles are in the image? 4 count +789 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_789.png How many triangles are in the image? 1 count +790 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_790.png How many trapezoids are in the image? 2 count +791 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_791.png How many parallelograms are in the image? 2 count +792 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_792.png How many diamonds are in the image? 4 count +793 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_793.png How many squares are in the image? 2 count +794 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_794.png How many circles are in the image? 3 count +795 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_795.png How many squares are in the image? 6 count +796 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_796.png How many triangles are in the image? 2 count +797 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_797.png How many squares are in the image? 2 count +798 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_798.png How many squares are in the image? 2 count +799 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_799.png How many hexagons are in the image? 2 count +800 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_800.png How many diamonds are in the image? 1 count +801 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_801.png How many diamonds are in the image? 2 count +802 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_802.png How many hexagons are in the image? 1 count +803 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_803.png How many squares are in the image? 1 count +804 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_804.png How many trapezoids are in the image? 2 count +805 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_805.png How many triangles are in the image? 2 count +806 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_806.png How many parallelograms are in the image? 1 count +807 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_807.png How many trapezoids are in the image? 2 count +808 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_808.png How many trapezoids are in the image? 1 count +809 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_809.png How many circles are in the image? 1 count +810 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_810.png How many triangles are in the image? 1 count +811 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_811.png How many trapezoids are in the image? 2 count +812 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_812.png How many pentagons are in the image? 1 count +813 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_813.png How many hexagons are in the image? 1 count +814 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_814.png How many squares are in the image? 2 count +815 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_815.png How many squares are in the image? 2 count +816 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_816.png How many parallelograms are in the image? 2 count +817 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_817.png How many squares are in the image? 4 count +818 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_818.png How many hexagons are in the image? 2 count +819 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_819.png How many squares are in the image? 1 count +820 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_820.png How many hexagons are in the image? 1 count +821 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_821.png How many squares are in the image? 1 count +822 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_822.png How many parallelograms are in the image? 2 count +823 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_823.png How many circles are in the image? 2 count +824 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_824.png How many triangles are in the image? 5 count +825 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_825.png How many diamonds are in the image? 3 count +826 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_826.png How many diamonds are in the image? 1 count +827 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_827.png How many trapezoids are in the image? 5 count +828 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_828.png How many hexagons are in the image? 1 count +829 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_829.png How many triangles are in the image? 2 count +830 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_830.png How many squares are in the image? 1 count +831 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_831.png How many trapezoids are in the image? 4 count +832 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_832.png How many triangles are in the image? 2 count +833 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_833.png How many trapezoids are in the image? 1 count +834 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_834.png How many squares are in the image? 2 count +835 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_835.png How many parallelograms are in the image? 1 count +836 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_836.png How many circles are in the image? 2 count +837 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_837.png How many parallelograms are in the image? 2 count +838 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_838.png How many pentagons are in the image? 2 count +839 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_839.png How many triangles are in the image? 1 count +840 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_840.png How many pentagons are in the image? 1 count +841 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_841.png How many hexagons are in the image? 2 count +842 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_842.png How many pentagons are in the image? 1 count +843 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_843.png How many diamonds are in the image? 1 count +844 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_844.png How many squares are in the image? 2 count +845 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_845.png How many diamonds are in the image? 2 count +846 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_846.png How many pentagons are in the image? 1 count +847 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_847.png How many diamonds are in the image? 2 count +848 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_848.png How many hexagons are in the image? 1 count +849 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_849.png How many triangles are in the image? 2 count +850 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_850.png How many hexagons are in the image? 1 count +851 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_851.png How many circles are in the image? 1 count +852 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_852.png How many pentagons are in the image? 2 count +853 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_853.png How many hexagons are in the image? 2 count +854 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_854.png How many parallelograms are in the image? 2 count +855 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_855.png How many triangles are in the image? 1 count +856 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_856.png How many trapezoids are in the image? 2 count +857 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_857.png How many trapezoids are in the image? 3 count +858 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_858.png How many trapezoids are in the image? 1 count +859 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_859.png How many trapezoids are in the image? 5 count +860 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_860.png How many parallelograms are in the image? 1 count +861 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_861.png How many pentagons are in the image? 1 count +862 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_862.png How many hexagons are in the image? 3 count +863 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_863.png How many circles are in the image? 3 count +864 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_864.png How many pentagons are in the image? 1 count +865 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_865.png How many triangles are in the image? 3 count +866 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_866.png How many triangles are in the image? 4 count +867 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_867.png How many squares are in the image? 1 count +868 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_868.png How many triangles are in the image? 3 count +869 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_869.png How many pentagons are in the image? 4 count +870 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_870.png How many triangles are in the image? 2 count +871 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_871.png How many squares are in the image? 2 count +872 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_872.png How many trapezoids are in the image? 1 count +873 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_873.png How many pentagons are in the image? 1 count +874 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_874.png How many trapezoids are in the image? 1 count +875 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_875.png How many triangles are in the image? 2 count +876 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_876.png How many circles are in the image? 2 count +877 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_877.png How many pentagons are in the image? 1 count +878 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_878.png How many squares are in the image? 1 count +879 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_879.png How many parallelograms are in the image? 2 count +880 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_880.png How many pentagons are in the image? 2 count +881 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_881.png How many circles are in the image? 1 count +882 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_882.png How many squares are in the image? 1 count +883 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_883.png How many hexagons are in the image? 2 count +884 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_884.png How many hexagons are in the image? 2 count +885 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_885.png How many triangles are in the image? 6 count +886 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_886.png How many pentagons are in the image? 1 count +887 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_887.png How many triangles are in the image? 3 count +888 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_888.png How many hexagons are in the image? 1 count +889 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_889.png How many hexagons are in the image? 1 count +890 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_890.png How many parallelograms are in the image? 1 count +891 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_891.png How many squares are in the image? 3 count +892 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_892.png How many squares are in the image? 2 count +893 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_893.png How many pentagons are in the image? 2 count +894 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_894.png How many circles are in the image? 2 count +895 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_895.png How many pentagons are in the image? 4 count +896 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_896.png How many pentagons are in the image? 1 count +897 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_897.png How many trapezoids are in the image? 2 count +898 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_898.png How many squares are in the image? 1 count +899 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_899.png How many squares are in the image? 2 count +900 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_900.png How many trapezoids are in the image? 1 count +901 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_901.png How many hexagons are in the image? 2 count +902 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_902.png How many pentagons are in the image? 1 count +903 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_903.png How many pentagons are in the image? 2 count +904 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_904.png How many triangles are in the image? 1 count +905 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_905.png How many circles are in the image? 2 count +906 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_906.png How many hexagons are in the image? 6 count +907 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_907.png How many triangles are in the image? 2 count +908 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_908.png How many parallelograms are in the image? 2 count +909 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_909.png How many pentagons are in the image? 6 count +910 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_910.png How many trapezoids are in the image? 2 count +911 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_911.png How many parallelograms are in the image? 3 count +912 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_912.png How many pentagons are in the image? 1 count +913 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_913.png How many triangles are in the image? 2 count +914 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_914.png How many trapezoids are in the image? 1 count +915 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_915.png How many pentagons are in the image? 6 count +916 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_916.png How many triangles are in the image? 2 count +917 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_917.png How many trapezoids are in the image? 2 count +918 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_918.png How many diamonds are in the image? 2 count +919 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_919.png How many triangles are in the image? 2 count +920 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_920.png How many diamonds are in the image? 3 count +921 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_921.png How many pentagons are in the image? 2 count +922 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_922.png How many hexagons are in the image? 1 count +923 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_923.png How many parallelograms are in the image? 6 count +924 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_924.png How many parallelograms are in the image? 2 count +925 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_925.png How many squares are in the image? 2 count +926 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_926.png How many pentagons are in the image? 1 count +927 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_927.png How many pentagons are in the image? 2 count +928 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_928.png How many parallelograms are in the image? 5 count +929 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_929.png How many trapezoids are in the image? 2 count +930 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_930.png How many triangles are in the image? 1 count +931 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_931.png How many triangles are in the image? 2 count +932 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_932.png How many squares are in the image? 2 count +933 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_933.png How many squares are in the image? 5 count +934 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_934.png How many triangles are in the image? 2 count +935 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_935.png How many circles are in the image? 1 count +936 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_936.png How many hexagons are in the image? 2 count +937 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_937.png How many squares are in the image? 3 count +938 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_938.png How many triangles are in the image? 2 count +939 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_939.png How many squares are in the image? 2 count +940 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_940.png How many hexagons are in the image? 2 count +941 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_941.png How many parallelograms are in the image? 1 count +942 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_942.png How many parallelograms are in the image? 2 count +943 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_943.png How many pentagons are in the image? 1 count +944 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_944.png How many trapezoids are in the image? 2 count +945 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_945.png How many trapezoids are in the image? 3 count +946 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_946.png How many hexagons are in the image? 1 count +947 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_947.png How many hexagons are in the image? 2 count +948 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_948.png How many parallelograms are in the image? 1 count +949 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_949.png How many parallelograms are in the image? 2 count +950 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_950.png How many diamonds are in the image? 3 count +951 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_951.png How many pentagons are in the image? 2 count +952 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_952.png How many triangles are in the image? 2 count +953 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_953.png How many hexagons are in the image? 2 count +954 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_954.png How many circles are in the image? 1 count +955 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_955.png How many diamonds are in the image? 1 count +956 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_956.png How many diamonds are in the image? 1 count +957 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_957.png How many circles are in the image? 1 count +958 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_958.png How many hexagons are in the image? 3 count +959 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_959.png How many triangles are in the image? 2 count +960 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_960.png How many circles are in the image? 2 count +961 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_961.png How many parallelograms are in the image? 6 count +962 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_962.png How many circles are in the image? 3 count +963 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_963.png How many hexagons are in the image? 2 count +964 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_964.png How many parallelograms are in the image? 6 count +965 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_965.png How many pentagons are in the image? 1 count +966 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_966.png How many pentagons are in the image? 2 count +967 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_967.png How many trapezoids are in the image? 3 count +968 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_968.png How many hexagons are in the image? 2 count +969 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_969.png How many diamonds are in the image? 2 count +970 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_970.png How many parallelograms are in the image? 2 count +971 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_971.png How many circles are in the image? 2 count +972 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_972.png How many parallelograms are in the image? 3 count +973 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_973.png How many diamonds are in the image? 2 count +974 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_974.png How many trapezoids are in the image? 2 count +975 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_975.png How many hexagons are in the image? 2 count +976 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_976.png How many squares are in the image? 3 count +977 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_977.png How many pentagons are in the image? 2 count +978 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_978.png How many hexagons are in the image? 2 count +979 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_979.png How many trapezoids are in the image? 2 count +980 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_980.png How many parallelograms are in the image? 1 count +981 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_981.png How many trapezoids are in the image? 2 count +982 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_982.png How many diamonds are in the image? 1 count +983 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_983.png How many parallelograms are in the image? 3 count +984 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_984.png How many circles are in the image? 1 count +985 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_985.png How many parallelograms are in the image? 2 count +986 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_986.png How many diamonds are in the image? 2 count +987 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_987.png How many hexagons are in the image? 1 count +988 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_988.png How many hexagons are in the image? 1 count +989 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_989.png How many diamonds are in the image? 1 count +990 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_990.png How many triangles are in the image? 3 count +991 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_991.png How many diamonds are in the image? 2 count +992 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_992.png How many parallelograms are in the image? 5 count +993 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_993.png How many circles are in the image? 2 count +994 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_994.png How many squares are in the image? 1 count +995 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_995.png How many pentagons are in the image? 1 count +996 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_996.png How many trapezoids are in the image? 2 count +997 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_997.png How many diamonds are in the image? 2 count +998 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_998.png How many parallelograms are in the image? 2 count +999 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_999.png How many triangles are in the image? 2 count +1000 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_count/merged_1000.png How many parallelograms are in the image? 2 count diff --git a/Shapegrid/ShapeGrid_dis.tsv b/Shapegrid/ShapeGrid_dis.tsv new file mode 100644 index 0000000000000000000000000000000000000000..79756adc59e7dc0fb9125e57fd2910a625e7f50b --- /dev/null +++ b/Shapegrid/ShapeGrid_dis.tsv @@ -0,0 +1,1001 @@ +index image_path question answer category +1 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_1.png The diamond is closer to the hexagon than the pentagon No spat +2 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_2.png The circle is closer to the square than the pentagon No spat +3 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_3.png The trapezoid is closer to the triangle than the circle No spat +4 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_4.png The pentagon is closer to the hexagon than the triangle No spat +5 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_5.png The parallelogram is closer to the diamond than the triangle No spat +6 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_6.png The hexagon is closer to the pentagon than the square No spat +7 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_7.png The trapezoid is closer to the square than the parallelogram Yes spat +8 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_8.png The diamond is closer to the triangle than the square Yes spat +9 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_9.png The parallelogram is closer to the trapezoid than the circle Yes spat +10 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_10.png The circle is closer to the parallelogram than the pentagon Yes spat +11 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_11.png The trapezoid is closer to the parallelogram than the square Yes spat +12 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_12.png The square is closer to the pentagon than the triangle No spat +13 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_13.png The triangle is closer to the trapezoid than the pentagon No spat +14 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_14.png The hexagon is closer to the triangle than the pentagon Yes spat +15 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_15.png The square is closer to the trapezoid than the pentagon Yes spat +16 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_16.png The hexagon is closer to the trapezoid than the circle Yes spat +17 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_17.png The triangle is closer to the parallelogram than the hexagon No spat +18 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_18.png The parallelogram is closer to the square than the trapezoid Yes spat +19 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_19.png The square is closer to the pentagon than the hexagon No spat +20 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_20.png The diamond is closer to the square than the pentagon Yes spat +21 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_21.png The parallelogram is closer to the trapezoid than the triangle No spat +22 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_22.png The pentagon is closer to the trapezoid than the triangle Yes spat +23 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_23.png The triangle is closer to the trapezoid than the hexagon Yes spat +24 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_24.png The pentagon is closer to the triangle than the trapezoid No spat +25 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_25.png The trapezoid is closer to the pentagon than the circle Yes spat +26 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_26.png The pentagon is closer to the diamond than the circle Yes spat +27 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_27.png The trapezoid is closer to the square than the diamond No spat +28 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_28.png The pentagon is closer to the triangle than the hexagon Yes spat +29 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_29.png The parallelogram is closer to the diamond than the hexagon Yes spat +30 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_30.png The parallelogram is closer to the trapezoid than the triangle Yes spat +31 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_31.png The circle is closer to the pentagon than the trapezoid Yes spat +32 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_32.png The diamond is closer to the circle than the triangle No spat +33 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_33.png The circle is closer to the parallelogram than the triangle Yes spat +34 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_34.png The hexagon is closer to the triangle than the square Yes spat +35 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_35.png The circle is closer to the hexagon than the trapezoid No spat +36 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_36.png The trapezoid is closer to the circle than the diamond No spat +37 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_37.png The diamond is closer to the trapezoid than the hexagon Yes spat +38 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_38.png The triangle is closer to the pentagon than the trapezoid No spat +39 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_39.png The square is closer to the triangle than the circle No spat +40 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_40.png The hexagon is closer to the circle than the parallelogram No spat +41 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_41.png The trapezoid is closer to the triangle than the parallelogram No spat +42 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_42.png The square is closer to the trapezoid than the triangle No spat +43 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_43.png The parallelogram is closer to the diamond than the pentagon Yes spat +44 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_44.png The parallelogram is closer to the circle than the square No spat +45 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_45.png The parallelogram is closer to the hexagon than the circle No spat +46 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_46.png The trapezoid is closer to the hexagon than the parallelogram No spat +47 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_47.png The pentagon is closer to the circle than the parallelogram No spat +48 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_48.png The diamond is closer to the hexagon than the parallelogram Yes spat +49 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_49.png The hexagon is closer to the circle than the diamond Yes spat +50 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_50.png The hexagon is closer to the diamond than the triangle No spat +51 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_51.png The square is closer to the hexagon than the diamond Yes spat +52 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_52.png The circle is closer to the hexagon than the parallelogram Yes spat +53 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_53.png The diamond is closer to the hexagon than the triangle No spat +54 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_54.png The square is closer to the circle than the pentagon No spat +55 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_55.png The diamond is closer to the trapezoid than the hexagon Yes spat +56 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_56.png The pentagon is closer to the square than the triangle Yes spat +57 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_57.png The circle is closer to the pentagon than the triangle No spat +58 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_58.png The circle is closer to the parallelogram than the pentagon No spat +59 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_59.png The diamond is closer to the trapezoid than the square No spat +60 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_60.png The circle is closer to the triangle than the diamond No spat +61 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_61.png The triangle is closer to the square than the circle No spat +62 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_62.png The triangle is closer to the pentagon than the parallelogram Yes spat +63 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_63.png The diamond is closer to the hexagon than the parallelogram No spat +64 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_64.png The hexagon is closer to the trapezoid than the diamond Yes spat +65 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_65.png The trapezoid is closer to the parallelogram than the hexagon Yes spat +66 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_66.png The trapezoid is closer to the circle than the diamond No spat +67 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_67.png The triangle is closer to the diamond than the parallelogram No spat +68 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_68.png The square is closer to the hexagon than the diamond Yes spat +69 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_69.png The square is closer to the parallelogram than the triangle No spat +70 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_70.png The triangle is closer to the square than the parallelogram Yes spat +71 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_71.png The square is closer to the hexagon than the diamond Yes spat +72 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_72.png The parallelogram is closer to the square than the diamond Yes spat +73 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_73.png The parallelogram is closer to the diamond than the pentagon No spat +74 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_74.png The diamond is closer to the hexagon than the circle No spat +75 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_75.png The hexagon is closer to the parallelogram than the trapezoid No spat +76 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_76.png The circle is closer to the triangle than the square Yes spat +77 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_77.png The triangle is closer to the circle than the hexagon Yes spat +78 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_78.png The pentagon is closer to the trapezoid than the square No spat +79 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_79.png The triangle is closer to the circle than the hexagon No spat +80 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_80.png The pentagon is closer to the hexagon than the parallelogram Yes spat +81 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_81.png The pentagon is closer to the trapezoid than the diamond Yes spat +82 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_82.png The trapezoid is closer to the triangle than the circle No spat +83 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_83.png The circle is closer to the hexagon than the diamond Yes spat +84 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_84.png The circle is closer to the hexagon than the triangle Yes spat +85 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_85.png The trapezoid is closer to the hexagon than the square Yes spat +86 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_86.png The circle is closer to the pentagon than the hexagon No spat +87 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_87.png The circle is closer to the pentagon than the square No spat +88 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_88.png The square is closer to the diamond than the triangle No spat +89 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_89.png The trapezoid is closer to the diamond than the triangle Yes spat +90 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_90.png The square is closer to the trapezoid than the hexagon Yes spat +91 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_91.png The square is closer to the parallelogram than the trapezoid Yes spat +92 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_92.png The square is closer to the pentagon than the circle Yes spat +93 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_93.png The square is closer to the circle than the trapezoid No spat +94 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_94.png The parallelogram is closer to the pentagon than the diamond No spat +95 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_95.png The trapezoid is closer to the parallelogram than the square No spat +96 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_96.png The triangle is closer to the diamond than the circle No spat +97 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_97.png The trapezoid is closer to the circle than the pentagon Yes spat +98 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_98.png The trapezoid is closer to the parallelogram than the square No spat +99 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_99.png The diamond is closer to the triangle than the pentagon No spat +100 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_100.png The square is closer to the pentagon than the trapezoid Yes spat +101 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_101.png The circle is closer to the square than the trapezoid No spat +102 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_102.png The diamond is closer to the pentagon than the hexagon No spat +103 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_103.png The pentagon is closer to the parallelogram than the trapezoid Yes spat +104 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_104.png The diamond is closer to the hexagon than the parallelogram No spat +105 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_105.png The pentagon is closer to the diamond than the parallelogram No spat +106 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_106.png The pentagon is closer to the square than the diamond No spat +107 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_107.png The trapezoid is closer to the pentagon than the circle No spat +108 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_108.png The square is closer to the hexagon than the circle No spat +109 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_109.png The hexagon is closer to the trapezoid than the pentagon No spat +110 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_110.png The square is closer to the pentagon than the circle No spat +111 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_111.png The triangle is closer to the diamond than the circle Yes spat +112 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_112.png The circle is closer to the triangle than the trapezoid Yes spat +113 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_113.png The diamond is closer to the square than the hexagon No spat +114 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_114.png The hexagon is closer to the trapezoid than the parallelogram Yes spat +115 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_115.png The triangle is closer to the diamond than the circle No spat +116 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_116.png The square is closer to the hexagon than the trapezoid No spat +117 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_117.png The circle is closer to the trapezoid than the triangle Yes spat +118 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_118.png The square is closer to the circle than the pentagon No spat +119 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_119.png The square is closer to the trapezoid than the hexagon No spat +120 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_120.png The triangle is closer to the parallelogram than the pentagon No spat +121 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_121.png The square is closer to the pentagon than the diamond No spat +122 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_122.png The triangle is closer to the hexagon than the square Yes spat +123 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_123.png The hexagon is closer to the square than the parallelogram No spat +124 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_124.png The triangle is closer to the diamond than the trapezoid Yes spat +125 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_125.png The hexagon is closer to the triangle than the square No spat +126 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_126.png The pentagon is closer to the square than the diamond Yes spat +127 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_127.png The trapezoid is closer to the parallelogram than the diamond No spat +128 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_128.png The circle is closer to the diamond than the pentagon No spat +129 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_129.png The circle is closer to the diamond than the parallelogram No spat +130 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_130.png The pentagon is closer to the triangle than the square Yes spat +131 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_131.png The circle is closer to the pentagon than the trapezoid Yes spat +132 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_132.png The pentagon is closer to the circle than the trapezoid Yes spat +133 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_133.png The triangle is closer to the pentagon than the diamond No spat +134 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_134.png The hexagon is closer to the parallelogram than the square No spat +135 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_135.png The trapezoid is closer to the hexagon than the circle Yes spat +136 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_136.png The parallelogram is closer to the circle than the diamond Yes spat +137 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_137.png The hexagon is closer to the circle than the square Yes spat +138 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_138.png The pentagon is closer to the parallelogram than the trapezoid Yes spat +139 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_139.png The parallelogram is closer to the pentagon than the trapezoid No spat +140 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_140.png The hexagon is closer to the trapezoid than the triangle No spat +141 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_141.png The hexagon is closer to the trapezoid than the square No spat +142 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_142.png The circle is closer to the triangle than the parallelogram Yes spat +143 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_143.png The parallelogram is closer to the square than the diamond Yes spat +144 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_144.png The square is closer to the parallelogram than the pentagon Yes spat +145 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_145.png The triangle is closer to the square than the circle Yes spat +146 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_146.png The parallelogram is closer to the diamond than the trapezoid No spat +147 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_147.png The diamond is closer to the hexagon than the pentagon No spat +148 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_148.png The diamond is closer to the triangle than the square Yes spat +149 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_149.png The diamond is closer to the trapezoid than the pentagon No spat +150 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_150.png The circle is closer to the hexagon than the parallelogram No spat +151 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_151.png The square is closer to the diamond than the trapezoid Yes spat +152 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_152.png The circle is closer to the trapezoid than the triangle No spat +153 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_153.png The circle is closer to the square than the hexagon No spat +154 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_154.png The square is closer to the diamond than the circle No spat +155 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_155.png The triangle is closer to the diamond than the trapezoid No spat +156 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_156.png The trapezoid is closer to the pentagon than the hexagon Yes spat +157 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_157.png The circle is closer to the square than the hexagon Yes spat +158 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_158.png The hexagon is closer to the diamond than the triangle No spat +159 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_159.png The hexagon is closer to the triangle than the square No spat +160 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_160.png The diamond is closer to the circle than the hexagon No spat +161 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_161.png The triangle is closer to the trapezoid than the square Yes spat +162 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_162.png The diamond is closer to the parallelogram than the hexagon No spat +163 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_163.png The trapezoid is closer to the triangle than the square No spat +164 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_164.png The square is closer to the hexagon than the parallelogram No spat +165 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_165.png The circle is closer to the diamond than the hexagon No spat +166 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_166.png The square is closer to the trapezoid than the diamond Yes spat +167 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_167.png The diamond is closer to the parallelogram than the circle Yes spat +168 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_168.png The circle is closer to the parallelogram than the hexagon Yes spat +169 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_169.png The diamond is closer to the hexagon than the triangle No spat +170 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_170.png The trapezoid is closer to the hexagon than the diamond No spat +171 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_171.png The circle is closer to the pentagon than the square Yes spat +172 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_172.png The square is closer to the pentagon than the hexagon No spat +173 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_173.png The hexagon is closer to the diamond than the triangle No spat +174 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_174.png The trapezoid is closer to the pentagon than the hexagon No spat +175 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_175.png The circle is closer to the pentagon than the trapezoid Yes spat +176 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_176.png The diamond is closer to the triangle than the parallelogram No spat +177 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_177.png The square is closer to the triangle than the diamond Yes spat +178 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_178.png The square is closer to the hexagon than the circle Yes spat +179 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_179.png The trapezoid is closer to the pentagon than the hexagon No spat +180 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_180.png The parallelogram is closer to the triangle than the hexagon Yes spat +181 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_181.png The triangle is closer to the hexagon than the square Yes spat +182 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_182.png The square is closer to the pentagon than the triangle Yes spat +183 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_183.png The diamond is closer to the circle than the trapezoid Yes spat +184 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_184.png The hexagon is closer to the square than the pentagon Yes spat +185 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_185.png The pentagon is closer to the square than the parallelogram No spat +186 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_186.png The diamond is closer to the square than the triangle No spat +187 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_187.png The diamond is closer to the square than the trapezoid No spat +188 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_188.png The pentagon is closer to the triangle than the square Yes spat +189 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_189.png The triangle is closer to the parallelogram than the circle No spat +190 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_190.png The parallelogram is closer to the triangle than the pentagon No spat +191 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_191.png The pentagon is closer to the hexagon than the diamond No spat +192 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_192.png The hexagon is closer to the diamond than the pentagon No spat +193 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_193.png The diamond is closer to the circle than the triangle Yes spat +194 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_194.png The circle is closer to the hexagon than the pentagon Yes spat +195 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_195.png The trapezoid is closer to the parallelogram than the hexagon Yes spat +196 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_196.png The triangle is closer to the hexagon than the trapezoid No spat +197 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_197.png The hexagon is closer to the triangle than the circle No spat +198 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_198.png The pentagon is closer to the trapezoid than the hexagon No spat +199 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_199.png The triangle is closer to the parallelogram than the diamond Yes spat +200 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_200.png The diamond is closer to the trapezoid than the parallelogram Yes spat +201 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_201.png The trapezoid is closer to the square than the parallelogram Yes spat +202 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_202.png The triangle is closer to the parallelogram than the square No spat +203 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_203.png The pentagon is closer to the circle than the square Yes spat +204 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_204.png The square is closer to the trapezoid than the triangle No spat +205 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_205.png The pentagon is closer to the diamond than the circle Yes spat +206 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_206.png The pentagon is closer to the parallelogram than the diamond No spat +207 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_207.png The hexagon is closer to the diamond than the parallelogram Yes spat +208 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_208.png The trapezoid is closer to the square than the hexagon No spat +209 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_209.png The square is closer to the triangle than the parallelogram Yes spat +210 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_210.png The diamond is closer to the pentagon than the triangle Yes spat +211 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_211.png The triangle is closer to the parallelogram than the diamond Yes spat +212 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_212.png The pentagon is closer to the hexagon than the circle No spat +213 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_213.png The hexagon is closer to the pentagon than the square Yes spat +214 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_214.png The trapezoid is closer to the parallelogram than the pentagon Yes spat +215 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_215.png The trapezoid is closer to the triangle than the circle No spat +216 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_216.png The parallelogram is closer to the triangle than the hexagon Yes spat +217 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_217.png The circle is closer to the hexagon than the diamond No spat +218 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_218.png The triangle is closer to the square than the trapezoid No spat +219 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_219.png The diamond is closer to the parallelogram than the circle Yes spat +220 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_220.png The trapezoid is closer to the parallelogram than the diamond Yes spat +221 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_221.png The triangle is closer to the diamond than the hexagon No spat +222 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_222.png The diamond is closer to the circle than the triangle No spat +223 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_223.png The trapezoid is closer to the hexagon than the square No spat +224 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_224.png The diamond is closer to the square than the parallelogram Yes spat +225 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_225.png The triangle is closer to the hexagon than the trapezoid No spat +226 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_226.png The pentagon is closer to the square than the circle No spat +227 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_227.png The square is closer to the hexagon than the triangle Yes spat +228 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_228.png The circle is closer to the diamond than the square No spat +229 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_229.png The trapezoid is closer to the parallelogram than the circle Yes spat +230 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_230.png The trapezoid is closer to the diamond than the circle No spat +231 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_231.png The diamond is closer to the square than the pentagon Yes spat +232 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_232.png The square is closer to the trapezoid than the circle No spat +233 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_233.png The hexagon is closer to the trapezoid than the pentagon Yes spat +234 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_234.png The pentagon is closer to the diamond than the square Yes spat +235 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_235.png The circle is closer to the triangle than the trapezoid Yes spat +236 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_236.png The trapezoid is closer to the diamond than the square No spat +237 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_237.png The circle is closer to the hexagon than the triangle No spat +238 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_238.png The pentagon is closer to the hexagon than the parallelogram Yes spat +239 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_239.png The trapezoid is closer to the parallelogram than the diamond No spat +240 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_240.png The hexagon is closer to the square than the parallelogram Yes spat +241 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_241.png The square is closer to the triangle than the pentagon Yes spat +242 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_242.png The triangle is closer to the hexagon than the circle Yes spat +243 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_243.png The parallelogram is closer to the pentagon than the circle Yes spat +244 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_244.png The triangle is closer to the pentagon than the trapezoid No spat +245 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_245.png The hexagon is closer to the diamond than the triangle Yes spat +246 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_246.png The diamond is closer to the pentagon than the parallelogram Yes spat +247 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_247.png The square is closer to the diamond than the trapezoid No spat +248 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_248.png The circle is closer to the square than the trapezoid No spat +249 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_249.png The diamond is closer to the parallelogram than the trapezoid Yes spat +250 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_250.png The pentagon is closer to the square than the circle Yes spat +251 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_251.png The hexagon is closer to the triangle than the diamond Yes spat +252 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_252.png The diamond is closer to the hexagon than the parallelogram Yes spat +253 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_253.png The trapezoid is closer to the circle than the square Yes spat +254 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_254.png The trapezoid is closer to the parallelogram than the circle No spat +255 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_255.png The parallelogram is closer to the triangle than the hexagon Yes spat +256 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_256.png The triangle is closer to the parallelogram than the square No spat +257 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_257.png The hexagon is closer to the triangle than the square Yes spat +258 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_258.png The pentagon is closer to the circle than the parallelogram No spat +259 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_259.png The circle is closer to the parallelogram than the pentagon Yes spat +260 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_260.png The triangle is closer to the circle than the parallelogram No spat +261 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_261.png The hexagon is closer to the diamond than the triangle Yes spat +262 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_262.png The square is closer to the triangle than the diamond Yes spat +263 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_263.png The triangle is closer to the circle than the diamond No spat +264 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_264.png The pentagon is closer to the square than the parallelogram No spat +265 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_265.png The trapezoid is closer to the circle than the parallelogram Yes spat +266 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_266.png The diamond is closer to the circle than the hexagon No spat +267 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_267.png The parallelogram is closer to the pentagon than the square Yes spat +268 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_268.png The circle is closer to the triangle than the square No spat +269 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_269.png The hexagon is closer to the circle than the square No spat +270 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_270.png The triangle is closer to the diamond than the circle Yes spat +271 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_271.png The diamond is closer to the parallelogram than the hexagon Yes spat +272 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_272.png The circle is closer to the trapezoid than the pentagon No spat +273 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_273.png The circle is closer to the square than the hexagon No spat +274 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_274.png The pentagon is closer to the circle than the hexagon Yes spat +275 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_275.png The pentagon is closer to the triangle than the hexagon Yes spat +276 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_276.png The diamond is closer to the square than the circle No spat +277 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_277.png The triangle is closer to the circle than the pentagon Yes spat +278 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_278.png The trapezoid is closer to the triangle than the parallelogram No spat +279 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_279.png The circle is closer to the parallelogram than the square Yes spat +280 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_280.png The parallelogram is closer to the square than the pentagon Yes spat +281 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_281.png The diamond is closer to the triangle than the trapezoid No spat +282 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_282.png The triangle is closer to the parallelogram than the circle No spat +283 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_283.png The trapezoid is closer to the hexagon than the parallelogram No spat +284 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_284.png The trapezoid is closer to the hexagon than the circle Yes spat +285 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_285.png The pentagon is closer to the parallelogram than the hexagon Yes spat +286 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_286.png The parallelogram is closer to the pentagon than the diamond No spat +287 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_287.png The circle is closer to the square than the triangle No spat +288 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_288.png The pentagon is closer to the square than the parallelogram No spat +289 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_289.png The diamond is closer to the triangle than the hexagon Yes spat +290 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_290.png The diamond is closer to the trapezoid than the square No spat +291 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_291.png The trapezoid is closer to the triangle than the parallelogram Yes spat +292 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_292.png The diamond is closer to the hexagon than the triangle Yes spat +293 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_293.png The hexagon is closer to the pentagon than the diamond Yes spat +294 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_294.png The parallelogram is closer to the pentagon than the square Yes spat +295 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_295.png The pentagon is closer to the diamond than the circle Yes spat +296 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_296.png The circle is closer to the pentagon than the parallelogram Yes spat +297 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_297.png The parallelogram is closer to the diamond than the triangle No spat +298 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_298.png The trapezoid is closer to the parallelogram than the triangle No spat +299 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_299.png The trapezoid is closer to the pentagon than the diamond No spat +300 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_300.png The circle is closer to the parallelogram than the pentagon Yes spat +301 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_301.png The trapezoid is closer to the diamond than the circle Yes spat +302 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_302.png The trapezoid is closer to the hexagon than the circle No spat +303 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_303.png The trapezoid is closer to the hexagon than the square No spat +304 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_304.png The trapezoid is closer to the diamond than the triangle No spat +305 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_305.png The parallelogram is closer to the circle than the diamond Yes spat +306 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_306.png The trapezoid is closer to the square than the parallelogram No spat +307 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_307.png The circle is closer to the parallelogram than the triangle No spat +308 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_308.png The circle is closer to the trapezoid than the pentagon Yes spat +309 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_309.png The hexagon is closer to the diamond than the triangle No spat +310 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_310.png The trapezoid is closer to the triangle than the hexagon Yes spat +311 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_311.png The diamond is closer to the square than the hexagon Yes spat +312 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_312.png The hexagon is closer to the square than the pentagon Yes spat +313 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_313.png The parallelogram is closer to the triangle than the circle Yes spat +314 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_314.png The circle is closer to the square than the parallelogram No spat +315 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_315.png The square is closer to the circle than the hexagon No spat +316 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_316.png The circle is closer to the hexagon than the pentagon Yes spat +317 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_317.png The triangle is closer to the circle than the pentagon Yes spat +318 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_318.png The diamond is closer to the parallelogram than the triangle No spat +319 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_319.png The hexagon is closer to the square than the parallelogram Yes spat +320 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_320.png The circle is closer to the square than the triangle Yes spat +321 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_321.png The hexagon is closer to the pentagon than the circle No spat +322 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_322.png The triangle is closer to the pentagon than the circle No spat +323 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_323.png The circle is closer to the trapezoid than the square No spat +324 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_324.png The trapezoid is closer to the circle than the triangle Yes spat +325 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_325.png The circle is closer to the pentagon than the parallelogram No spat +326 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_326.png The triangle is closer to the parallelogram than the square Yes spat +327 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_327.png The hexagon is closer to the diamond than the trapezoid No spat +328 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_328.png The circle is closer to the diamond than the hexagon Yes spat +329 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_329.png The square is closer to the parallelogram than the diamond No spat +330 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_330.png The hexagon is closer to the pentagon than the trapezoid Yes spat +331 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_331.png The trapezoid is closer to the circle than the pentagon No spat +332 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_332.png The hexagon is closer to the parallelogram than the pentagon No spat +333 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_333.png The square is closer to the hexagon than the pentagon Yes spat +334 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_334.png The parallelogram is closer to the trapezoid than the pentagon No spat +335 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_335.png The parallelogram is closer to the square than the trapezoid No spat +336 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_336.png The square is closer to the circle than the pentagon No spat +337 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_337.png The circle is closer to the trapezoid than the diamond Yes spat +338 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_338.png The pentagon is closer to the diamond than the circle Yes spat +339 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_339.png The trapezoid is closer to the pentagon than the square Yes spat +340 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_340.png The parallelogram is closer to the circle than the triangle No spat +341 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_341.png The pentagon is closer to the square than the circle No spat +342 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_342.png The hexagon is closer to the square than the trapezoid Yes spat +343 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_343.png The hexagon is closer to the circle than the trapezoid Yes spat +344 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_344.png The diamond is closer to the square than the circle Yes spat +345 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_345.png The square is closer to the hexagon than the circle No spat +346 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_346.png The pentagon is closer to the hexagon than the triangle No spat +347 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_347.png The square is closer to the trapezoid than the hexagon No spat +348 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_348.png The trapezoid is closer to the triangle than the hexagon No spat +349 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_349.png The diamond is closer to the hexagon than the trapezoid No spat +350 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_350.png The square is closer to the parallelogram than the diamond Yes spat +351 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_351.png The diamond is closer to the circle than the parallelogram No spat +352 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_352.png The triangle is closer to the square than the pentagon No spat +353 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_353.png The parallelogram is closer to the square than the diamond Yes spat +354 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_354.png The trapezoid is closer to the circle than the hexagon No spat +355 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_355.png The pentagon is closer to the square than the diamond Yes spat +356 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_356.png The pentagon is closer to the hexagon than the parallelogram Yes spat +357 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_357.png The circle is closer to the parallelogram than the diamond No spat +358 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_358.png The triangle is closer to the hexagon than the square Yes spat +359 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_359.png The pentagon is closer to the parallelogram than the square No spat +360 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_360.png The square is closer to the triangle than the circle No spat +361 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_361.png The diamond is closer to the triangle than the hexagon Yes spat +362 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_362.png The diamond is closer to the pentagon than the triangle Yes spat +363 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_363.png The square is closer to the hexagon than the triangle No spat +364 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_364.png The trapezoid is closer to the triangle than the circle No spat +365 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_365.png The trapezoid is closer to the diamond than the square No spat +366 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_366.png The square is closer to the diamond than the parallelogram No spat +367 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_367.png The parallelogram is closer to the hexagon than the pentagon No spat +368 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_368.png The square is closer to the parallelogram than the circle No spat +369 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_369.png The circle is closer to the pentagon than the parallelogram Yes spat +370 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_370.png The square is closer to the diamond than the circle No spat +371 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_371.png The pentagon is closer to the trapezoid than the diamond Yes spat +372 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_372.png The pentagon is closer to the diamond than the hexagon Yes spat +373 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_373.png The parallelogram is closer to the square than the circle No spat +374 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_374.png The parallelogram is closer to the trapezoid than the circle No spat +375 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_375.png The pentagon is closer to the trapezoid than the square No spat +376 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_376.png The triangle is closer to the square than the trapezoid Yes spat +377 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_377.png The trapezoid is closer to the square than the circle No spat +378 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_378.png The pentagon is closer to the square than the circle No spat +379 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_379.png The circle is closer to the hexagon than the pentagon Yes spat +380 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_380.png The diamond is closer to the parallelogram than the circle Yes spat +381 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_381.png The square is closer to the triangle than the diamond No spat +382 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_382.png The pentagon is closer to the diamond than the trapezoid No spat +383 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_383.png The trapezoid is closer to the pentagon than the parallelogram Yes spat +384 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_384.png The hexagon is closer to the circle than the square No spat +385 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_385.png The triangle is closer to the square than the diamond No spat +386 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_386.png The pentagon is closer to the parallelogram than the square No spat +387 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_387.png The triangle is closer to the pentagon than the trapezoid No spat +388 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_388.png The triangle is closer to the trapezoid than the parallelogram Yes spat +389 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_389.png The hexagon is closer to the square than the trapezoid Yes spat +390 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_390.png The diamond is closer to the parallelogram than the square Yes spat +391 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_391.png The hexagon is closer to the pentagon than the circle Yes spat +392 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_392.png The parallelogram is closer to the hexagon than the circle Yes spat +393 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_393.png The square is closer to the triangle than the hexagon Yes spat +394 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_394.png The triangle is closer to the diamond than the parallelogram Yes spat +395 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_395.png The circle is closer to the pentagon than the parallelogram No spat +396 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_396.png The circle is closer to the pentagon than the square Yes spat +397 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_397.png The hexagon is closer to the diamond than the trapezoid Yes spat +398 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_398.png The trapezoid is closer to the parallelogram than the pentagon Yes spat +399 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_399.png The pentagon is closer to the diamond than the triangle Yes spat +400 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_400.png The circle is closer to the hexagon than the pentagon No spat +401 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_401.png The parallelogram is closer to the circle than the trapezoid No spat +402 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_402.png The pentagon is closer to the circle than the triangle Yes spat +403 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_403.png The diamond is closer to the hexagon than the trapezoid No spat +404 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_404.png The hexagon is closer to the diamond than the trapezoid Yes spat +405 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_405.png The circle is closer to the hexagon than the pentagon No spat +406 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_406.png The hexagon is closer to the circle than the parallelogram Yes spat +407 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_407.png The hexagon is closer to the trapezoid than the circle No spat +408 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_408.png The trapezoid is closer to the square than the parallelogram No spat +409 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_409.png The circle is closer to the trapezoid than the diamond Yes spat +410 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_410.png The diamond is closer to the triangle than the hexagon No spat +411 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_411.png The circle is closer to the parallelogram than the pentagon Yes spat +412 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_412.png The trapezoid is closer to the hexagon than the parallelogram No spat +413 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_413.png The square is closer to the diamond than the pentagon Yes spat +414 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_414.png The pentagon is closer to the square than the circle Yes spat +415 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_415.png The trapezoid is closer to the diamond than the parallelogram Yes spat +416 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_416.png The hexagon is closer to the triangle than the circle Yes spat +417 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_417.png The triangle is closer to the circle than the trapezoid Yes spat +418 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_418.png The diamond is closer to the pentagon than the triangle Yes spat +419 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_419.png The trapezoid is closer to the diamond than the pentagon Yes spat +420 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_420.png The diamond is closer to the parallelogram than the square Yes spat +421 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_421.png The square is closer to the trapezoid than the parallelogram No spat +422 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_422.png The circle is closer to the parallelogram than the trapezoid No spat +423 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_423.png The trapezoid is closer to the hexagon than the circle No spat +424 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_424.png The trapezoid is closer to the hexagon than the triangle Yes spat +425 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_425.png The square is closer to the trapezoid than the parallelogram Yes spat +426 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_426.png The trapezoid is closer to the diamond than the parallelogram No spat +427 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_427.png The triangle is closer to the parallelogram than the diamond No spat +428 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_428.png The hexagon is closer to the pentagon than the square No spat +429 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_429.png The trapezoid is closer to the circle than the parallelogram No spat +430 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_430.png The triangle is closer to the trapezoid than the diamond Yes spat +431 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_431.png The trapezoid is closer to the hexagon than the parallelogram No spat +432 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_432.png The circle is closer to the pentagon than the parallelogram Yes spat +433 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_433.png The trapezoid is closer to the circle than the parallelogram No spat +434 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_434.png The diamond is closer to the hexagon than the triangle No spat +435 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_435.png The pentagon is closer to the trapezoid than the parallelogram Yes spat +436 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_436.png The diamond is closer to the parallelogram than the pentagon No spat +437 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_437.png The pentagon is closer to the diamond than the hexagon No spat +438 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_438.png The trapezoid is closer to the hexagon than the square No spat +439 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_439.png The parallelogram is closer to the pentagon than the hexagon Yes spat +440 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_440.png The square is closer to the diamond than the hexagon Yes spat +441 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_441.png The hexagon is closer to the pentagon than the parallelogram Yes spat +442 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_442.png The hexagon is closer to the parallelogram than the pentagon Yes spat +443 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_443.png The parallelogram is closer to the hexagon than the trapezoid No spat +444 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_444.png The trapezoid is closer to the diamond than the square No spat +445 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_445.png The hexagon is closer to the parallelogram than the trapezoid Yes spat +446 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_446.png The trapezoid is closer to the square than the circle Yes spat +447 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_447.png The diamond is closer to the square than the circle No spat +448 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_448.png The triangle is closer to the square than the trapezoid Yes spat +449 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_449.png The pentagon is closer to the hexagon than the circle Yes spat +450 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_450.png The trapezoid is closer to the pentagon than the parallelogram Yes spat +451 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_451.png The diamond is closer to the parallelogram than the circle Yes spat +452 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_452.png The triangle is closer to the trapezoid than the diamond Yes spat +453 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_453.png The pentagon is closer to the parallelogram than the trapezoid No spat +454 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_454.png The circle is closer to the trapezoid than the diamond Yes spat +455 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_455.png The trapezoid is closer to the parallelogram than the circle No spat +456 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_456.png The parallelogram is closer to the trapezoid than the triangle No spat +457 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_457.png The square is closer to the circle than the parallelogram Yes spat +458 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_458.png The hexagon is closer to the trapezoid than the circle No spat +459 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_459.png The diamond is closer to the parallelogram than the square No spat +460 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_460.png The hexagon is closer to the parallelogram than the trapezoid No spat +461 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_461.png The pentagon is closer to the square than the diamond No spat +462 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_462.png The diamond is closer to the triangle than the hexagon No spat +463 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_463.png The diamond is closer to the triangle than the circle No spat +464 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_464.png The square is closer to the parallelogram than the hexagon Yes spat +465 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_465.png The square is closer to the diamond than the triangle No spat +466 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_466.png The diamond is closer to the pentagon than the trapezoid No spat +467 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_467.png The trapezoid is closer to the square than the triangle Yes spat +468 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_468.png The square is closer to the circle than the trapezoid No spat +469 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_469.png The hexagon is closer to the diamond than the pentagon Yes spat +470 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_470.png The square is closer to the triangle than the parallelogram Yes spat +471 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_471.png The pentagon is closer to the square than the diamond No spat +472 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_472.png The diamond is closer to the pentagon than the hexagon Yes spat +473 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_473.png The square is closer to the pentagon than the parallelogram Yes spat +474 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_474.png The diamond is closer to the parallelogram than the triangle Yes spat +475 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_475.png The pentagon is closer to the hexagon than the parallelogram No spat +476 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_476.png The circle is closer to the parallelogram than the pentagon Yes spat +477 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_477.png The pentagon is closer to the square than the parallelogram No spat +478 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_478.png The diamond is closer to the hexagon than the triangle No spat +479 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_479.png The diamond is closer to the trapezoid than the circle No spat +480 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_480.png The parallelogram is closer to the pentagon than the triangle No spat +481 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_481.png The diamond is closer to the pentagon than the square Yes spat +482 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_482.png The diamond is closer to the square than the trapezoid No spat +483 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_483.png The diamond is closer to the hexagon than the square No spat +484 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_484.png The trapezoid is closer to the circle than the triangle Yes spat +485 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_485.png The square is closer to the parallelogram than the circle Yes spat +486 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_486.png The diamond is closer to the square than the hexagon Yes spat +487 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_487.png The triangle is closer to the diamond than the parallelogram No spat +488 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_488.png The pentagon is closer to the diamond than the trapezoid Yes spat +489 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_489.png The diamond is closer to the circle than the hexagon Yes spat +490 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_490.png The square is closer to the pentagon than the diamond Yes spat +491 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_491.png The triangle is closer to the square than the hexagon Yes spat +492 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_492.png The hexagon is closer to the pentagon than the parallelogram Yes spat +493 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_493.png The circle is closer to the diamond than the pentagon Yes spat +494 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_494.png The parallelogram is closer to the trapezoid than the pentagon Yes spat +495 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_495.png The hexagon is closer to the square than the parallelogram Yes spat +496 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_496.png The diamond is closer to the parallelogram than the square No spat +497 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_497.png The circle is closer to the pentagon than the parallelogram No spat +498 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_498.png The square is closer to the pentagon than the hexagon Yes spat +499 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_499.png The circle is closer to the triangle than the trapezoid No spat +500 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_500.png The square is closer to the parallelogram than the triangle Yes spat +501 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_501.png The diamond is closer to the pentagon than the trapezoid Yes spat +502 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_502.png The diamond is closer to the hexagon than the triangle No spat +503 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_503.png The pentagon is closer to the hexagon than the diamond Yes spat +504 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_504.png The diamond is closer to the square than the circle Yes spat +505 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_505.png The square is closer to the pentagon than the triangle Yes spat +506 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_506.png The pentagon is closer to the circle than the diamond Yes spat +507 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_507.png The circle is closer to the square than the parallelogram No spat +508 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_508.png The square is closer to the circle than the hexagon Yes spat +509 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_509.png The circle is closer to the pentagon than the parallelogram No spat +510 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_510.png The square is closer to the triangle than the diamond Yes spat +511 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_511.png The hexagon is closer to the triangle than the square Yes spat +512 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_512.png The parallelogram is closer to the diamond than the circle No spat +513 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_513.png The triangle is closer to the square than the trapezoid Yes spat +514 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_514.png The circle is closer to the diamond than the triangle No spat +515 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_515.png The diamond is closer to the trapezoid than the square Yes spat +516 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_516.png The trapezoid is closer to the parallelogram than the triangle No spat +517 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_517.png The parallelogram is closer to the hexagon than the diamond No spat +518 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_518.png The pentagon is closer to the diamond than the square Yes spat +519 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_519.png The pentagon is closer to the circle than the diamond No spat +520 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_520.png The pentagon is closer to the diamond than the trapezoid Yes spat +521 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_521.png The parallelogram is closer to the square than the pentagon Yes spat +522 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_522.png The triangle is closer to the parallelogram than the trapezoid Yes spat +523 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_523.png The square is closer to the diamond than the triangle No spat +524 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_524.png The hexagon is closer to the parallelogram than the diamond No spat +525 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_525.png The circle is closer to the pentagon than the parallelogram No spat +526 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_526.png The square is closer to the triangle than the trapezoid No spat +527 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_527.png The square is closer to the hexagon than the parallelogram Yes spat +528 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_528.png The hexagon is closer to the trapezoid than the square Yes spat +529 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_529.png The diamond is closer to the square than the triangle No spat +530 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_530.png The circle is closer to the triangle than the hexagon Yes spat +531 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_531.png The diamond is closer to the square than the circle Yes spat +532 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_532.png The trapezoid is closer to the diamond than the pentagon No spat +533 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_533.png The hexagon is closer to the pentagon than the trapezoid No spat +534 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_534.png The hexagon is closer to the trapezoid than the triangle Yes spat +535 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_535.png The parallelogram is closer to the diamond than the circle Yes spat +536 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_536.png The parallelogram is closer to the circle than the square No spat +537 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_537.png The diamond is closer to the pentagon than the parallelogram Yes spat +538 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_538.png The parallelogram is closer to the triangle than the square Yes spat +539 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_539.png The parallelogram is closer to the pentagon than the triangle Yes spat +540 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_540.png The circle is closer to the hexagon than the diamond Yes spat +541 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_541.png The parallelogram is closer to the diamond than the circle Yes spat +542 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_542.png The square is closer to the hexagon than the circle Yes spat +543 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_543.png The triangle is closer to the hexagon than the parallelogram No spat +544 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_544.png The trapezoid is closer to the square than the hexagon No spat +545 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_545.png The circle is closer to the trapezoid than the diamond Yes spat +546 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_546.png The circle is closer to the trapezoid than the triangle No spat +547 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_547.png The square is closer to the triangle than the diamond No spat +548 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_548.png The square is closer to the diamond than the hexagon No spat +549 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_549.png The diamond is closer to the square than the trapezoid Yes spat +550 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_550.png The parallelogram is closer to the hexagon than the square No spat +551 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_551.png The trapezoid is closer to the triangle than the parallelogram Yes spat +552 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_552.png The parallelogram is closer to the square than the hexagon Yes spat +553 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_553.png The square is closer to the circle than the diamond Yes spat +554 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_554.png The trapezoid is closer to the hexagon than the circle No spat +555 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_555.png The triangle is closer to the trapezoid than the pentagon No spat +556 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_556.png The pentagon is closer to the trapezoid than the parallelogram No spat +557 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_557.png The parallelogram is closer to the square than the hexagon No spat +558 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_558.png The triangle is closer to the hexagon than the circle Yes spat +559 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_559.png The hexagon is closer to the square than the triangle Yes spat +560 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_560.png The hexagon is closer to the parallelogram than the pentagon No spat +561 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_561.png The parallelogram is closer to the hexagon than the circle Yes spat +562 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_562.png The parallelogram is closer to the diamond than the square No spat +563 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_563.png The diamond is closer to the hexagon than the square No spat +564 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_564.png The circle is closer to the square than the triangle Yes spat +565 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_565.png The pentagon is closer to the parallelogram than the triangle No spat +566 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_566.png The diamond is closer to the pentagon than the square Yes spat +567 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_567.png The square is closer to the diamond than the triangle Yes spat +568 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_568.png The square is closer to the hexagon than the diamond Yes spat +569 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_569.png The circle is closer to the trapezoid than the parallelogram Yes spat +570 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_570.png The square is closer to the diamond than the parallelogram Yes spat +571 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_571.png The pentagon is closer to the diamond than the trapezoid Yes spat +572 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_572.png The triangle is closer to the circle than the hexagon No spat +573 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_573.png The parallelogram is closer to the triangle than the pentagon Yes spat +574 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_574.png The hexagon is closer to the circle than the triangle No spat +575 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_575.png The circle is closer to the trapezoid than the diamond No spat +576 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_576.png The circle is closer to the diamond than the trapezoid No spat +577 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_577.png The square is closer to the circle than the pentagon Yes spat +578 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_578.png The hexagon is closer to the trapezoid than the square No spat +579 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_579.png The triangle is closer to the trapezoid than the circle Yes spat +580 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_580.png The circle is closer to the diamond than the trapezoid No spat +581 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_581.png The pentagon is closer to the circle than the parallelogram Yes spat +582 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_582.png The hexagon is closer to the trapezoid than the square No spat +583 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_583.png The pentagon is closer to the triangle than the parallelogram No spat +584 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_584.png The trapezoid is closer to the triangle than the parallelogram No spat +585 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_585.png The diamond is closer to the trapezoid than the hexagon No spat +586 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_586.png The diamond is closer to the hexagon than the pentagon No spat +587 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_587.png The pentagon is closer to the circle than the square Yes spat +588 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_588.png The hexagon is closer to the pentagon than the parallelogram Yes spat +589 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_589.png The triangle is closer to the circle than the square No spat +590 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_590.png The hexagon is closer to the pentagon than the parallelogram No spat +591 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_591.png The circle is closer to the square than the pentagon No spat +592 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_592.png The parallelogram is closer to the square than the circle Yes spat +593 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_593.png The parallelogram is closer to the square than the hexagon No spat +594 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_594.png The pentagon is closer to the circle than the hexagon Yes spat +595 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_595.png The pentagon is closer to the parallelogram than the hexagon No spat +596 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_596.png The square is closer to the trapezoid than the circle Yes spat +597 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_597.png The pentagon is closer to the parallelogram than the trapezoid Yes spat +598 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_598.png The trapezoid is closer to the square than the parallelogram Yes spat +599 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_599.png The trapezoid is closer to the hexagon than the circle No spat +600 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_600.png The trapezoid is closer to the diamond than the pentagon Yes spat +601 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_601.png The trapezoid is closer to the hexagon than the parallelogram No spat +602 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_602.png The triangle is closer to the hexagon than the circle No spat +603 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_603.png The parallelogram is closer to the diamond than the hexagon No spat +604 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_604.png The pentagon is closer to the triangle than the trapezoid Yes spat +605 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_605.png The triangle is closer to the hexagon than the parallelogram Yes spat +606 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_606.png The trapezoid is closer to the hexagon than the circle Yes spat +607 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_607.png The pentagon is closer to the circle than the trapezoid No spat +608 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_608.png The trapezoid is closer to the diamond than the circle No spat +609 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_609.png The circle is closer to the triangle than the diamond Yes spat +610 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_610.png The parallelogram is closer to the trapezoid than the pentagon No spat +611 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_611.png The diamond is closer to the triangle than the trapezoid Yes spat +612 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_612.png The pentagon is closer to the triangle than the diamond Yes spat +613 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_613.png The triangle is closer to the pentagon than the trapezoid Yes spat +614 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_614.png The square is closer to the circle than the trapezoid No spat +615 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_615.png The parallelogram is closer to the hexagon than the pentagon No spat +616 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_616.png The hexagon is closer to the parallelogram than the diamond No spat +617 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_617.png The parallelogram is closer to the trapezoid than the pentagon No spat +618 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_618.png The diamond is closer to the parallelogram than the pentagon No spat +619 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_619.png The hexagon is closer to the triangle than the diamond Yes spat +620 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_620.png The pentagon is closer to the parallelogram than the square Yes spat +621 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_621.png The parallelogram is closer to the diamond than the triangle No spat +622 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_622.png The trapezoid is closer to the triangle than the parallelogram Yes spat +623 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_623.png The trapezoid is closer to the square than the pentagon Yes spat +624 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_624.png The square is closer to the diamond than the circle No spat +625 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_625.png The hexagon is closer to the parallelogram than the pentagon Yes spat +626 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_626.png The triangle is closer to the circle than the pentagon Yes spat +627 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_627.png The triangle is closer to the diamond than the parallelogram No spat +628 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_628.png The triangle is closer to the trapezoid than the parallelogram Yes spat +629 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_629.png The hexagon is closer to the trapezoid than the circle Yes spat +630 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_630.png The trapezoid is closer to the triangle than the circle No spat +631 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_631.png The triangle is closer to the hexagon than the parallelogram Yes spat +632 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_632.png The parallelogram is closer to the triangle than the square Yes spat +633 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_633.png The diamond is closer to the hexagon than the parallelogram Yes spat +634 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_634.png The parallelogram is closer to the hexagon than the circle Yes spat +635 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_635.png The square is closer to the pentagon than the diamond Yes spat +636 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_636.png The pentagon is closer to the circle than the hexagon Yes spat +637 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_637.png The parallelogram is closer to the trapezoid than the pentagon No spat +638 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_638.png The circle is closer to the parallelogram than the trapezoid No spat +639 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_639.png The circle is closer to the pentagon than the triangle No spat +640 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_640.png The hexagon is closer to the diamond than the parallelogram No spat +641 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_641.png The circle is closer to the pentagon than the diamond No spat +642 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_642.png The hexagon is closer to the pentagon than the trapezoid Yes spat +643 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_643.png The square is closer to the parallelogram than the triangle No spat +644 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_644.png The trapezoid is closer to the diamond than the parallelogram Yes spat +645 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_645.png The triangle is closer to the hexagon than the square Yes spat +646 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_646.png The circle is closer to the trapezoid than the hexagon No spat +647 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_647.png The triangle is closer to the circle than the square No spat +648 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_648.png The pentagon is closer to the triangle than the diamond Yes spat +649 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_649.png The trapezoid is closer to the pentagon than the triangle No spat +650 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_650.png The circle is closer to the diamond than the pentagon No spat +651 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_651.png The trapezoid is closer to the parallelogram than the diamond Yes spat +652 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_652.png The diamond is closer to the hexagon than the circle Yes spat +653 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_653.png The square is closer to the parallelogram than the hexagon Yes spat +654 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_654.png The parallelogram is closer to the diamond than the hexagon Yes spat +655 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_655.png The triangle is closer to the circle than the parallelogram No spat +656 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_656.png The triangle is closer to the trapezoid than the parallelogram No spat +657 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_657.png The parallelogram is closer to the hexagon than the circle Yes spat +658 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_658.png The square is closer to the diamond than the triangle No spat +659 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_659.png The square is closer to the trapezoid than the circle No spat +660 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_660.png The diamond is closer to the trapezoid than the pentagon Yes spat +661 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_661.png The parallelogram is closer to the hexagon than the circle Yes spat +662 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_662.png The square is closer to the triangle than the circle Yes spat +663 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_663.png The square is closer to the parallelogram than the hexagon Yes spat +664 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_664.png The triangle is closer to the diamond than the hexagon Yes spat +665 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_665.png The circle is closer to the hexagon than the square Yes spat +666 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_666.png The triangle is closer to the square than the hexagon No spat +667 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_667.png The hexagon is closer to the triangle than the diamond Yes spat +668 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_668.png The circle is closer to the triangle than the diamond Yes spat +669 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_669.png The triangle is closer to the trapezoid than the parallelogram No spat +670 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_670.png The diamond is closer to the pentagon than the hexagon No spat +671 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_671.png The trapezoid is closer to the square than the diamond Yes spat +672 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_672.png The pentagon is closer to the circle than the triangle Yes spat +673 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_673.png The parallelogram is closer to the pentagon than the triangle Yes spat +674 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_674.png The triangle is closer to the parallelogram than the hexagon Yes spat +675 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_675.png The circle is closer to the diamond than the parallelogram No spat +676 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_676.png The triangle is closer to the square than the parallelogram No spat +677 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_677.png The square is closer to the hexagon than the circle Yes spat +678 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_678.png The trapezoid is closer to the diamond than the triangle Yes spat +679 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_679.png The pentagon is closer to the square than the diamond No spat +680 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_680.png The pentagon is closer to the circle than the parallelogram Yes spat +681 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_681.png The triangle is closer to the circle than the square Yes spat +682 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_682.png The diamond is closer to the pentagon than the square No spat +683 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_683.png The triangle is closer to the diamond than the parallelogram No spat +684 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_684.png The trapezoid is closer to the parallelogram than the hexagon Yes spat +685 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_685.png The hexagon is closer to the parallelogram than the triangle No spat +686 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_686.png The parallelogram is closer to the circle than the square No spat +687 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_687.png The circle is closer to the hexagon than the pentagon No spat +688 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_688.png The circle is closer to the parallelogram than the square Yes spat +689 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_689.png The diamond is closer to the hexagon than the triangle Yes spat +690 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_690.png The square is closer to the trapezoid than the triangle No spat +691 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_691.png The circle is closer to the parallelogram than the pentagon No spat +692 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_692.png The diamond is closer to the circle than the pentagon Yes spat +693 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_693.png The parallelogram is closer to the triangle than the diamond Yes spat +694 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_694.png The hexagon is closer to the triangle than the square No spat +695 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_695.png The circle is closer to the hexagon than the parallelogram Yes spat +696 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_696.png The diamond is closer to the parallelogram than the triangle No spat +697 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_697.png The hexagon is closer to the square than the parallelogram No spat +698 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_698.png The hexagon is closer to the circle than the parallelogram Yes spat +699 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_699.png The hexagon is closer to the square than the parallelogram No spat +700 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_700.png The circle is closer to the hexagon than the parallelogram Yes spat +701 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_701.png The triangle is closer to the diamond than the hexagon No spat +702 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_702.png The pentagon is closer to the trapezoid than the triangle Yes spat +703 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_703.png The square is closer to the diamond than the trapezoid Yes spat +704 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_704.png The trapezoid is closer to the parallelogram than the diamond Yes spat +705 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_705.png The trapezoid is closer to the parallelogram than the diamond Yes spat +706 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_706.png The pentagon is closer to the diamond than the trapezoid No spat +707 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_707.png The square is closer to the pentagon than the parallelogram Yes spat +708 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_708.png The trapezoid is closer to the square than the triangle No spat +709 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_709.png The square is closer to the circle than the hexagon No spat +710 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_710.png The parallelogram is closer to the hexagon than the square No spat +711 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_711.png The hexagon is closer to the pentagon than the square No spat +712 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_712.png The diamond is closer to the circle than the parallelogram Yes spat +713 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_713.png The triangle is closer to the trapezoid than the pentagon Yes spat +714 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_714.png The hexagon is closer to the parallelogram than the square Yes spat +715 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_715.png The square is closer to the hexagon than the diamond No spat +716 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_716.png The triangle is closer to the square than the circle Yes spat +717 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_717.png The parallelogram is closer to the hexagon than the trapezoid Yes spat +718 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_718.png The diamond is closer to the square than the hexagon No spat +719 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_719.png The circle is closer to the square than the trapezoid Yes spat +720 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_720.png The hexagon is closer to the circle than the square Yes spat +721 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_721.png The triangle is closer to the hexagon than the circle No spat +722 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_722.png The trapezoid is closer to the square than the circle No spat +723 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_723.png The hexagon is closer to the circle than the square No spat +724 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_724.png The hexagon is closer to the trapezoid than the diamond No spat +725 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_725.png The diamond is closer to the triangle than the trapezoid No spat +726 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_726.png The trapezoid is closer to the hexagon than the parallelogram No spat +727 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_727.png The parallelogram is closer to the diamond than the square Yes spat +728 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_728.png The square is closer to the triangle than the pentagon Yes spat +729 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_729.png The trapezoid is closer to the parallelogram than the square No spat +730 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_730.png The pentagon is closer to the hexagon than the square No spat +731 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_731.png The triangle is closer to the trapezoid than the square No spat +732 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_732.png The triangle is closer to the trapezoid than the circle No spat +733 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_733.png The trapezoid is closer to the triangle than the pentagon Yes spat +734 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_734.png The triangle is closer to the pentagon than the square No spat +735 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_735.png The parallelogram is closer to the square than the circle Yes spat +736 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_736.png The trapezoid is closer to the pentagon than the diamond No spat +737 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_737.png The parallelogram is closer to the hexagon than the square No spat +738 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_738.png The square is closer to the parallelogram than the triangle Yes spat +739 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_739.png The diamond is closer to the trapezoid than the circle No spat +740 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_740.png The pentagon is closer to the circle than the triangle Yes spat +741 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_741.png The trapezoid is closer to the hexagon than the pentagon No spat +742 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_742.png The triangle is closer to the circle than the trapezoid No spat +743 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_743.png The pentagon is closer to the hexagon than the trapezoid Yes spat +744 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_744.png The diamond is closer to the square than the triangle No spat +745 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_745.png The trapezoid is closer to the circle than the triangle Yes spat +746 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_746.png The parallelogram is closer to the triangle than the diamond No spat +747 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_747.png The diamond is closer to the trapezoid than the parallelogram Yes spat +748 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_748.png The circle is closer to the parallelogram than the pentagon No spat +749 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_749.png The triangle is closer to the trapezoid than the diamond No spat +750 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_750.png The hexagon is closer to the parallelogram than the pentagon Yes spat +751 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_751.png The circle is closer to the trapezoid than the hexagon No spat +752 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_752.png The hexagon is closer to the square than the circle Yes spat +753 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_753.png The pentagon is closer to the square than the trapezoid No spat +754 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_754.png The parallelogram is closer to the pentagon than the circle No spat +755 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_755.png The diamond is closer to the parallelogram than the triangle No spat +756 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_756.png The pentagon is closer to the triangle than the trapezoid Yes spat +757 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_757.png The hexagon is closer to the pentagon than the square No spat +758 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_758.png The square is closer to the pentagon than the parallelogram Yes spat +759 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_759.png The parallelogram is closer to the circle than the diamond Yes spat +760 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_760.png The diamond is closer to the square than the pentagon Yes spat +761 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_761.png The pentagon is closer to the parallelogram than the diamond No spat +762 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_762.png The parallelogram is closer to the square than the pentagon Yes spat +763 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_763.png The triangle is closer to the square than the hexagon Yes spat +764 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_764.png The diamond is closer to the hexagon than the triangle No spat +765 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_765.png The trapezoid is closer to the diamond than the pentagon Yes spat +766 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_766.png The parallelogram is closer to the triangle than the square Yes spat +767 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_767.png The pentagon is closer to the circle than the trapezoid Yes spat +768 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_768.png The parallelogram is closer to the diamond than the pentagon Yes spat +769 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_769.png The trapezoid is closer to the triangle than the hexagon No spat +770 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_770.png The square is closer to the pentagon than the circle No spat +771 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_771.png The parallelogram is closer to the hexagon than the square Yes spat +772 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_772.png The trapezoid is closer to the square than the diamond No spat +773 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_773.png The diamond is closer to the circle than the trapezoid No spat +774 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_774.png The square is closer to the trapezoid than the diamond Yes spat +775 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_775.png The diamond is closer to the triangle than the trapezoid No spat +776 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_776.png The square is closer to the pentagon than the parallelogram Yes spat +777 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_777.png The hexagon is closer to the parallelogram than the triangle Yes spat +778 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_778.png The square is closer to the circle than the parallelogram No spat +779 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_779.png The parallelogram is closer to the square than the circle Yes spat +780 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_780.png The pentagon is closer to the triangle than the parallelogram No spat +781 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_781.png The parallelogram is closer to the trapezoid than the hexagon Yes spat +782 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_782.png The pentagon is closer to the triangle than the diamond No spat +783 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_783.png The square is closer to the hexagon than the circle Yes spat +784 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_784.png The diamond is closer to the parallelogram than the triangle Yes spat +785 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_785.png The trapezoid is closer to the pentagon than the diamond Yes spat +786 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_786.png The triangle is closer to the parallelogram than the pentagon Yes spat +787 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_787.png The circle is closer to the square than the trapezoid No spat +788 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_788.png The hexagon is closer to the diamond than the pentagon Yes spat +789 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_789.png The circle is closer to the trapezoid than the pentagon Yes spat +790 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_790.png The square is closer to the triangle than the hexagon Yes spat +791 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_791.png The circle is closer to the trapezoid than the parallelogram No spat +792 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_792.png The circle is closer to the triangle than the square Yes spat +793 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_793.png The triangle is closer to the diamond than the circle No spat +794 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_794.png The parallelogram is closer to the trapezoid than the square No spat +795 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_795.png The triangle is closer to the diamond than the pentagon Yes spat +796 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_796.png The hexagon is closer to the trapezoid than the square No spat +797 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_797.png The square is closer to the diamond than the trapezoid Yes spat +798 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_798.png The triangle is closer to the hexagon than the trapezoid Yes spat +799 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_799.png The trapezoid is closer to the pentagon than the parallelogram Yes spat +800 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_800.png The square is closer to the triangle than the hexagon Yes spat +801 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_801.png The parallelogram is closer to the square than the trapezoid Yes spat +802 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_802.png The hexagon is closer to the trapezoid than the pentagon No spat +803 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_803.png The trapezoid is closer to the circle than the diamond Yes spat +804 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_804.png The pentagon is closer to the diamond than the triangle Yes spat +805 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_805.png The hexagon is closer to the circle than the trapezoid Yes spat +806 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_806.png The pentagon is closer to the diamond than the hexagon Yes spat +807 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_807.png The diamond is closer to the circle than the hexagon No spat +808 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_808.png The parallelogram is closer to the trapezoid than the pentagon No spat +809 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_809.png The trapezoid is closer to the parallelogram than the triangle No spat +810 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_810.png The circle is closer to the diamond than the hexagon Yes spat +811 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_811.png The pentagon is closer to the diamond than the parallelogram Yes spat +812 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_812.png The pentagon is closer to the triangle than the square No spat +813 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_813.png The triangle is closer to the parallelogram than the hexagon No spat +814 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_814.png The circle is closer to the triangle than the diamond Yes spat +815 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_815.png The diamond is closer to the trapezoid than the square No spat +816 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_816.png The parallelogram is closer to the trapezoid than the triangle No spat +817 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_817.png The diamond is closer to the triangle than the hexagon No spat +818 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_818.png The trapezoid is closer to the circle than the hexagon Yes spat +819 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_819.png The diamond is closer to the parallelogram than the triangle No spat +820 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_820.png The trapezoid is closer to the circle than the diamond No spat +821 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_821.png The hexagon is closer to the triangle than the parallelogram No spat +822 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_822.png The diamond is closer to the square than the triangle Yes spat +823 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_823.png The trapezoid is closer to the parallelogram than the hexagon Yes spat +824 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_824.png The diamond is closer to the trapezoid than the parallelogram Yes spat +825 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_825.png The circle is closer to the parallelogram than the square No spat +826 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_826.png The triangle is closer to the trapezoid than the hexagon Yes spat +827 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_827.png The trapezoid is closer to the circle than the diamond No spat +828 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_828.png The triangle is closer to the trapezoid than the square No spat +829 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_829.png The diamond is closer to the circle than the square Yes spat +830 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_830.png The trapezoid is closer to the parallelogram than the hexagon Yes spat +831 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_831.png The diamond is closer to the trapezoid than the pentagon No spat +832 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_832.png The circle is closer to the diamond than the hexagon No spat +833 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_833.png The diamond is closer to the parallelogram than the hexagon Yes spat +834 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_834.png The square is closer to the triangle than the pentagon No spat +835 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_835.png The circle is closer to the trapezoid than the pentagon Yes spat +836 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_836.png The trapezoid is closer to the circle than the pentagon No spat +837 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_837.png The pentagon is closer to the triangle than the hexagon Yes spat +838 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_838.png The circle is closer to the triangle than the parallelogram No spat +839 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_839.png The diamond is closer to the square than the circle No spat +840 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_840.png The parallelogram is closer to the square than the pentagon No spat +841 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_841.png The pentagon is closer to the diamond than the circle Yes spat +842 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_842.png The parallelogram is closer to the triangle than the circle No spat +843 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_843.png The parallelogram is closer to the square than the diamond Yes spat +844 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_844.png The triangle is closer to the circle than the square No spat +845 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_845.png The triangle is closer to the parallelogram than the square No spat +846 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_846.png The triangle is closer to the parallelogram than the hexagon No spat +847 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_847.png The circle is closer to the hexagon than the parallelogram Yes spat +848 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_848.png The parallelogram is closer to the hexagon than the pentagon Yes spat +849 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_849.png The circle is closer to the parallelogram than the triangle No spat +850 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_850.png The pentagon is closer to the square than the parallelogram Yes spat +851 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_851.png The trapezoid is closer to the diamond than the square Yes spat +852 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_852.png The hexagon is closer to the parallelogram than the triangle No spat +853 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_853.png The triangle is closer to the pentagon than the hexagon No spat +854 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_854.png The square is closer to the trapezoid than the parallelogram No spat +855 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_855.png The triangle is closer to the parallelogram than the square No spat +856 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_856.png The square is closer to the trapezoid than the diamond Yes spat +857 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_857.png The trapezoid is closer to the pentagon than the diamond Yes spat +858 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_858.png The square is closer to the pentagon than the hexagon No spat +859 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_859.png The pentagon is closer to the square than the diamond Yes spat +860 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_860.png The circle is closer to the parallelogram than the trapezoid No spat +861 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_861.png The diamond is closer to the hexagon than the square Yes spat +862 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_862.png The diamond is closer to the triangle than the circle Yes spat +863 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_863.png The triangle is closer to the circle than the hexagon No spat +864 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_864.png The hexagon is closer to the diamond than the trapezoid No spat +865 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_865.png The trapezoid is closer to the square than the circle No spat +866 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_866.png The circle is closer to the parallelogram than the pentagon No spat +867 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_867.png The square is closer to the parallelogram than the triangle Yes spat +868 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_868.png The parallelogram is closer to the pentagon than the diamond Yes spat +869 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_869.png The parallelogram is closer to the square than the hexagon Yes spat +870 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_870.png The circle is closer to the parallelogram than the trapezoid No spat +871 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_871.png The trapezoid is closer to the hexagon than the circle No spat +872 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_872.png The triangle is closer to the hexagon than the square Yes spat +873 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_873.png The hexagon is closer to the diamond than the circle No spat +874 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_874.png The triangle is closer to the pentagon than the square Yes spat +875 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_875.png The hexagon is closer to the square than the circle No spat +876 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_876.png The hexagon is closer to the diamond than the trapezoid Yes spat +877 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_877.png The trapezoid is closer to the hexagon than the square No spat +878 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_878.png The diamond is closer to the parallelogram than the trapezoid No spat +879 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_879.png The hexagon is closer to the diamond than the pentagon Yes spat +880 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_880.png The diamond is closer to the parallelogram than the triangle Yes spat +881 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_881.png The circle is closer to the diamond than the trapezoid Yes spat +882 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_882.png The diamond is closer to the pentagon than the parallelogram No spat +883 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_883.png The parallelogram is closer to the circle than the square Yes spat +884 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_884.png The circle is closer to the parallelogram than the triangle No spat +885 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_885.png The triangle is closer to the circle than the square No spat +886 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_886.png The parallelogram is closer to the trapezoid than the square Yes spat +887 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_887.png The hexagon is closer to the pentagon than the square Yes spat +888 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_888.png The hexagon is closer to the trapezoid than the triangle Yes spat +889 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_889.png The pentagon is closer to the trapezoid than the square Yes spat +890 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_890.png The square is closer to the triangle than the circle Yes spat +891 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_891.png The parallelogram is closer to the diamond than the circle Yes spat +892 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_892.png The hexagon is closer to the pentagon than the circle Yes spat +893 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_893.png The trapezoid is closer to the circle than the parallelogram Yes spat +894 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_894.png The circle is closer to the pentagon than the parallelogram Yes spat +895 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_895.png The pentagon is closer to the triangle than the diamond No spat +896 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_896.png The square is closer to the triangle than the hexagon Yes spat +897 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_897.png The parallelogram is closer to the square than the diamond Yes spat +898 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_898.png The hexagon is closer to the parallelogram than the pentagon No spat +899 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_899.png The square is closer to the hexagon than the diamond No spat +900 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_900.png The triangle is closer to the trapezoid than the parallelogram Yes spat +901 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_901.png The diamond is closer to the trapezoid than the pentagon No spat +902 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_902.png The square is closer to the diamond than the triangle No spat +903 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_903.png The square is closer to the triangle than the parallelogram No spat +904 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_904.png The triangle is closer to the parallelogram than the square Yes spat +905 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_905.png The triangle is closer to the diamond than the parallelogram No spat +906 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_906.png The diamond is closer to the triangle than the circle No spat +907 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_907.png The parallelogram is closer to the hexagon than the diamond No spat +908 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_908.png The trapezoid is closer to the triangle than the parallelogram Yes spat +909 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_909.png The hexagon is closer to the trapezoid than the pentagon No spat +910 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_910.png The triangle is closer to the circle than the parallelogram Yes spat +911 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_911.png The circle is closer to the parallelogram than the hexagon Yes spat +912 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_912.png The parallelogram is closer to the square than the circle Yes spat +913 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_913.png The hexagon is closer to the parallelogram than the trapezoid No spat +914 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_914.png The triangle is closer to the hexagon than the parallelogram Yes spat +915 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_915.png The circle is closer to the triangle than the square No spat +916 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_916.png The hexagon is closer to the square than the trapezoid No spat +917 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_917.png The parallelogram is closer to the square than the hexagon No spat +918 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_918.png The parallelogram is closer to the pentagon than the trapezoid No spat +919 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_919.png The parallelogram is closer to the triangle than the pentagon Yes spat +920 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_920.png The square is closer to the trapezoid than the pentagon Yes spat +921 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_921.png The pentagon is closer to the trapezoid than the hexagon Yes spat +922 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_922.png The diamond is closer to the trapezoid than the circle No spat +923 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_923.png The parallelogram is closer to the diamond than the trapezoid No spat +924 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_924.png The square is closer to the diamond than the pentagon Yes spat +925 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_925.png The trapezoid is closer to the circle than the square No spat +926 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_926.png The hexagon is closer to the circle than the triangle Yes spat +927 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_927.png The circle is closer to the trapezoid than the hexagon No spat +928 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_928.png The square is closer to the circle than the pentagon Yes spat +929 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_929.png The pentagon is closer to the trapezoid than the circle Yes spat +930 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_930.png The diamond is closer to the circle than the parallelogram No spat +931 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_931.png The parallelogram is closer to the pentagon than the circle No spat +932 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_932.png The parallelogram is closer to the circle than the square No spat +933 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_933.png The square is closer to the pentagon than the hexagon No spat +934 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_934.png The triangle is closer to the circle than the diamond No spat +935 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_935.png The parallelogram is closer to the square than the trapezoid Yes spat +936 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_936.png The circle is closer to the triangle than the hexagon No spat +937 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_937.png The pentagon is closer to the square than the hexagon No spat +938 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_938.png The trapezoid is closer to the pentagon than the diamond No spat +939 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_939.png The triangle is closer to the parallelogram than the hexagon Yes spat +940 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_940.png The triangle is closer to the trapezoid than the pentagon No spat +941 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_941.png The circle is closer to the trapezoid than the hexagon No spat +942 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_942.png The trapezoid is closer to the pentagon than the square Yes spat +943 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_943.png The circle is closer to the trapezoid than the hexagon Yes spat +944 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_944.png The pentagon is closer to the triangle than the hexagon No spat +945 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_945.png The pentagon is closer to the trapezoid than the hexagon No spat +946 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_946.png The square is closer to the pentagon than the triangle Yes spat +947 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_947.png The parallelogram is closer to the triangle than the diamond Yes spat +948 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_948.png The diamond is closer to the circle than the trapezoid No spat +949 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_949.png The circle is closer to the trapezoid than the hexagon Yes spat +950 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_950.png The trapezoid is closer to the hexagon than the parallelogram Yes spat +951 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_951.png The pentagon is closer to the triangle than the hexagon No spat +952 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_952.png The hexagon is closer to the circle than the pentagon Yes spat +953 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_953.png The triangle is closer to the square than the hexagon No spat +954 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_954.png The parallelogram is closer to the circle than the hexagon No spat +955 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_955.png The diamond is closer to the trapezoid than the parallelogram Yes spat +956 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_956.png The hexagon is closer to the pentagon than the square Yes spat +957 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_957.png The trapezoid is closer to the circle than the square No spat +958 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_958.png The pentagon is closer to the diamond than the triangle No spat +959 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_959.png The trapezoid is closer to the square than the hexagon No spat +960 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_960.png The trapezoid is closer to the square than the parallelogram Yes spat +961 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_961.png The circle is closer to the diamond than the triangle No spat +962 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_962.png The square is closer to the circle than the parallelogram Yes spat +963 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_963.png The hexagon is closer to the parallelogram than the square No spat +964 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_964.png The diamond is closer to the triangle than the hexagon Yes spat +965 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_965.png The parallelogram is closer to the circle than the triangle No spat +966 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_966.png The circle is closer to the triangle than the diamond No spat +967 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_967.png The square is closer to the trapezoid than the triangle No spat +968 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_968.png The diamond is closer to the triangle than the hexagon Yes spat +969 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_969.png The square is closer to the pentagon than the circle No spat +970 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_970.png The diamond is closer to the square than the pentagon No spat +971 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_971.png The parallelogram is closer to the square than the trapezoid No spat +972 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_972.png The hexagon is closer to the pentagon than the parallelogram Yes spat +973 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_973.png The parallelogram is closer to the square than the triangle No spat +974 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_974.png The triangle is closer to the diamond than the square No spat +975 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_975.png The circle is closer to the parallelogram than the trapezoid No spat +976 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_976.png The circle is closer to the pentagon than the parallelogram Yes spat +977 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_977.png The parallelogram is closer to the hexagon than the diamond No spat +978 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_978.png The parallelogram is closer to the hexagon than the triangle No spat +979 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_979.png The hexagon is closer to the triangle than the parallelogram Yes spat +980 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_980.png The circle is closer to the hexagon than the triangle No spat +981 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_981.png The hexagon is closer to the triangle than the square No spat +982 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_982.png The circle is closer to the pentagon than the hexagon Yes spat +983 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_983.png The parallelogram is closer to the hexagon than the diamond Yes spat +984 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_984.png The pentagon is closer to the diamond than the parallelogram No spat +985 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_985.png The trapezoid is closer to the pentagon than the parallelogram Yes spat +986 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_986.png The hexagon is closer to the circle than the triangle Yes spat +987 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_987.png The pentagon is closer to the triangle than the square Yes spat +988 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_988.png The trapezoid is closer to the square than the parallelogram No spat +989 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_989.png The diamond is closer to the trapezoid than the parallelogram Yes spat +990 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_990.png The triangle is closer to the hexagon than the pentagon Yes spat +991 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_991.png The triangle is closer to the trapezoid than the diamond Yes spat +992 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_992.png The triangle is closer to the diamond than the square Yes spat +993 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_993.png The hexagon is closer to the diamond than the triangle Yes spat +994 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_994.png The pentagon is closer to the trapezoid than the circle Yes spat +995 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_995.png The triangle is closer to the trapezoid than the diamond No spat +996 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_996.png The diamond is closer to the triangle than the circle No spat +997 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_997.png The square is closer to the triangle than the circle Yes spat +998 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_998.png The triangle is closer to the diamond than the hexagon No spat +999 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_999.png The hexagon is closer to the triangle than the trapezoid Yes spat +1000 /home/zhangyichen/LMUData/LMUData/images/ShapeGrid_dis/merged_1000.png The diamond is closer to the square than the parallelogram Yes spat diff --git a/VLMEvalKit-sudoku/.gitignore b/VLMEvalKit-sudoku/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..acefdb85171fa62201131cbfeac67d23582b62f1 --- /dev/null +++ b/VLMEvalKit-sudoku/.gitignore @@ -0,0 +1,212 @@ +.idea/ + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST +.vscode/ +.gradio/ + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +environment.yml + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# Images +images/ + +scripts/*ttf +.history +cache_dir/* + +# Evaluation Outputs +outputs/* +demo.ipynb +*json +!vlmeval/dataset/utils/vgrpbench/configs/formating-prompt/**/*.json +.vscode +*.swp +GPT4o_MINI/ + +2weiyun* +script.py +Gemini* +Claude3-5V* +GLM4V* +GPT4o* +GPT4V* +mmmu_debug +bailingMM +BailingMM* +SenseChat* +Step* +DoubaoVL +arch +BlueLM* +mmb_* +gpt-4.1* +Reka* +Taiyi +TeleMM +apple.jpg +assets/LOGO.png +api_list.txt +vlmeval/gemini_tmp.py +run.sh +run_g.sh +tmp/ +InternVL* +Qwen* +CongRong* +Seed1.5* +aguvis* +grok-* +GLM4.5* +SenseNova* + +.DS_Store diff --git a/VLMEvalKit-sudoku/docs/zh-CN/cp_origin_docs.sh b/VLMEvalKit-sudoku/docs/zh-CN/cp_origin_docs.sh new file mode 100644 index 0000000000000000000000000000000000000000..1e728323684a0aad1571eb392871d6c5de6644fc --- /dev/null +++ b/VLMEvalKit-sudoku/docs/zh-CN/cp_origin_docs.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Copy *.md files from docs/ if it doesn't have a Chinese translation + +for filename in $(find ../en/ -name '*.md' -printf "%P\n"); +do + mkdir -p $(dirname $filename) + cp -n ../en/$filename ./$filename +done diff --git a/VLMEvalKit-sudoku/llava/eval/eval_textvqa.py b/VLMEvalKit-sudoku/llava/eval/eval_textvqa.py new file mode 100644 index 0000000000000000000000000000000000000000..468f4bb120448a036bd5b5c7955464fe2e13892a --- /dev/null +++ b/VLMEvalKit-sudoku/llava/eval/eval_textvqa.py @@ -0,0 +1,65 @@ +import os +import argparse +import json +import re + +from llava.eval.m4c_evaluator import TextVQAAccuracyEvaluator + + +def get_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--annotation-file', type=str) + parser.add_argument('--result-file', type=str) + parser.add_argument('--result-dir', type=str) + return parser.parse_args() + + +def prompt_processor(prompt): + if prompt.startswith('OCR tokens: '): + pattern = r"Question: (.*?) Short answer:" + match = re.search(pattern, prompt, re.DOTALL) + question = match.group(1) + elif 'Reference OCR token: ' in prompt and len(prompt.split('\n')) == 3: + if prompt.startswith('Reference OCR token:'): + question = prompt.split('\n')[1] + else: + question = prompt.split('\n')[0] + elif len(prompt.split('\n')) == 2: + question = prompt.split('\n')[0] + else: + assert False + + return question.lower() + + +def eval_single(annotation_file, result_file): + experiment_name = os.path.splitext(os.path.basename(result_file))[0] + print(experiment_name) + annotations = json.load(open(annotation_file))['data'] + annotations = {(annotation['image_id'], annotation['question'].lower()): annotation for annotation in annotations} + results = [json.loads(line) for line in open(result_file)] + + pred_list = [] + for result in results: + annotation = annotations[(result['question_id'], prompt_processor(result['prompt']))] + pred_list.append({ + "pred_answer": result['text'], + "gt_answers": annotation['answers'], + }) + + evaluator = TextVQAAccuracyEvaluator() + print('Samples: {}\nAccuracy: {:.2f}%\n'.format(len(pred_list), 100. * evaluator.eval_pred_list(pred_list))) + + +if __name__ == "__main__": + args = get_args() + + if args.result_file is not None: + eval_single(args.annotation_file, args.result_file) + + if args.result_dir is not None: + for result_file in sorted(os.listdir(args.result_dir)): + if not result_file.endswith('.jsonl'): + print(f'Skipping {result_file}') + continue + eval_single(args.annotation_file, os.path.join(args.result_dir, result_file)) diff --git a/VLMEvalKit-sudoku/run.py b/VLMEvalKit-sudoku/run.py new file mode 100644 index 0000000000000000000000000000000000000000..627f96d8cd6e84e55c36964ec512ab3e7a5eaebf --- /dev/null +++ b/VLMEvalKit-sudoku/run.py @@ -0,0 +1,500 @@ +import json +import os +import subprocess +from functools import partial + + +# GET the number of GPUs on the node without importing libs like torch +def get_gpu_list(): + CUDA_VISIBLE_DEVICES = os.environ.get('CUDA_VISIBLE_DEVICES', '') + if CUDA_VISIBLE_DEVICES != '': + gpu_list = [int(x) for x in CUDA_VISIBLE_DEVICES.split(',')] + return gpu_list + try: + ps = subprocess.Popen(('nvidia-smi', '--list-gpus'), stdout=subprocess.PIPE) + output = subprocess.check_output(('wc', '-l'), stdin=ps.stdout) + return list(range(int(output))) + except: + return [] + + +RANK = int(os.environ.get('RANK', 0)) +WORLD_SIZE = int(os.environ.get('WORLD_SIZE', 1)) +LOCAL_WORLD_SIZE = int(os.environ.get("LOCAL_WORLD_SIZE",1)) +LOCAL_RANK = int(os.environ.get("LOCAL_RANK",1)) + +GPU_LIST = get_gpu_list() +if LOCAL_WORLD_SIZE > 1 and len(GPU_LIST): + NGPU = len(GPU_LIST) + assert NGPU >= LOCAL_WORLD_SIZE, "The number of processes should be less than or equal to the number of GPUs" + GPU_PER_PROC = NGPU // LOCAL_WORLD_SIZE + DEVICE_START_IDX = GPU_PER_PROC * LOCAL_RANK + CUDA_VISIBLE_DEVICES = [str(i) for i in GPU_LIST[DEVICE_START_IDX: DEVICE_START_IDX + GPU_PER_PROC]] + CUDA_VISIBLE_DEVICES = ','.join(CUDA_VISIBLE_DEVICES) + # Set CUDA_VISIBLE_DEVICES + os.environ['CUDA_VISIBLE_DEVICES'] = CUDA_VISIBLE_DEVICES + print( + f'RANK: {RANK}, LOCAL_RANK: {LOCAL_RANK}, WORLD_SIZE: {WORLD_SIZE},' + f'LOCAL_WORLD_SIZE: {LOCAL_WORLD_SIZE}, CUDA_VISIBLE_DEVICES: {CUDA_VISIBLE_DEVICES}' + ) + + +from vlmeval.config import supported_VLM +from vlmeval.dataset.video_dataset_config import supported_video_datasets +from vlmeval.dataset import build_dataset +from vlmeval.inference import infer_data_job +from vlmeval.inference_video import infer_data_job_video +from vlmeval.inference_mt import infer_data_job_mt +from vlmeval.smp import * +from vlmeval.utils.result_transfer import MMMU_result_transfer, MMTBench_result_transfer + + +# Make WORLD_SIZE invisible when build models +def build_model_from_config(cfg, model_name, use_vllm=False): + import vlmeval.api + import vlmeval.vlm + ws_bak = os.environ.pop('WORLD_SIZE', None) + + config = cp.deepcopy(cfg[model_name]) + if use_vllm: + config['use_vllm'] = use_vllm + if 'class' not in config: + return supported_VLM[model_name](**config) + cls_name = config.pop('class') + if hasattr(vlmeval.api, cls_name): + model = getattr(vlmeval.api, cls_name)(**config) + elif hasattr(vlmeval.vlm, cls_name): + model = getattr(vlmeval.vlm, cls_name)(**config) + else: + raise ValueError(f'Class {cls_name} is not supported in `vlmeval.api` or `vlmeval.vlm`') + + if ws_bak: + os.environ['WORLD_SIZE'] = ws_bak + return model + + +def build_dataset_from_config(cfg, dataset_name): + import vlmeval.dataset + import inspect + config = cp.deepcopy(cfg[dataset_name]) + if config == {}: + return supported_video_datasets[dataset_name]() + assert 'class' in config + cls_name = config.pop('class') + if hasattr(vlmeval.dataset, cls_name): + cls = getattr(vlmeval.dataset, cls_name) + sig = inspect.signature(cls.__init__) + valid_params = {k: v for k, v in config.items() if k in sig.parameters} + if cls.MODALITY == 'VIDEO': + if valid_params.get('fps', 0) > 0 and valid_params.get('nframe', 0) > 0: + raise ValueError('fps and nframe should not be set at the same time') + if valid_params.get('fps', 0) <= 0 and valid_params.get('nframe', 0) <= 0: + raise ValueError('fps and nframe should be set at least one valid value') + return cls(**valid_params) + else: + raise ValueError(f'Class {cls_name} is not supported in `vlmeval.dataset`') + + +def parse_args(): + help_msg = """\ +You can launch the evaluation by setting either --data and --model or --config. + +--data and --model: + Each Arg should be a list of strings, specifying the names of datasets and models. + To find all supported model names, please refer to the `vlmeval/config.py` of check the output of the command \ + `vlmutil mlist all` in the terminal (you should first have vlmeval installed). + To find all supported dataset names, please refer to the `vlmeval/dataset/__init__.py` file. The python script \ + to print all supported dataset names is as follows: + ```python + from vlmeval.dataset import SUPPORTED_DATASETS + print(SUPPORTED_DATASETS) + ``` + or you can check the output of the command `vlmutil dlist all` in the terminal. + To find all supported video dataset default settings, please refer to the \ + `vlmeval/dataset/video_dataset_config.py` file. + +--config: + Launch the evaluation by specifying the path to the config json file. Sample Json Content: + ```json + { + "model": { + "GPT4o_20240806_T00_HIGH": { + "class": "GPT4V", + "model": "gpt-4o-2024-08-06", + "temperature": 0, + "img_detail": "high" + }, + "GPT4o_20240806_T10_Low": { + "class": "GPT4V", + "model": "gpt-4o-2024-08-06", + "temperature": 1.0, + "img_detail": "low" + }, + "GPT4o_20241120": {} + }, + "data": { + "MME-RealWorld-Lite": { + "class": "MMERealWorld", + "dataset": "MME-RealWorld-Lite" + }, + "MMBench_DEV_EN_V11": { + "class": "ImageMCQDataset", + "dataset": "MMBench_DEV_EN_V11" + }, + "MMBench_Video_8frame_nopack": {}, + "Video-MME_16frame_subs": { + "class": "VideoMME", + "dataset": "Video-MME", + "nframe": 16, + "use_subtitle": true, + } + } + } + ``` + Currently, only `model` and `data` are supported fields. The content of each field is a dictionary. + For `model`, the key is the name of the model, and the value is a dictionary containing the following keys: + - `class`: The class name of the model, which should be a class in `vlmeval.vlm` or `vlmeval.api`. + - Other keys are specific to the model, please refer to the corresponding class. + - Tip: The defined model in the `supported_VLM` of `vlmeval/config.py` can be used as a shortcut. + For `data`, the key is the name of the dataset (should be the same as the `dataset` field in most cases, \ + except for video datasets), and the value is a dictionary containing the following keys: + - `class`: The class name of the dataset, which should be a class in `vlmeval.dataset`. + - `dataset`: The name of the dataset, which should be a string that is accepted by the `dataset` argument of the \ + corresponding class. + - Other keys are specific to the dataset, please refer to the corresponding class. + - Tip: The defined dataset in the `supported_video_datasets` of `vlmeval/dataset/video_dataset_config.py` \ + can be used as a shortcut. + + The keys in the `model` and `data` fields will be used for naming the prediction files and evaluation results. + When launching with `--config`, args for API VLMs, such as `--retry`, `--verbose`, will be ignored. +""" + parser = argparse.ArgumentParser(description=help_msg, formatter_class=argparse.RawTextHelpFormatter) + # Essential Args, Setting the Names of Datasets and Models + parser.add_argument('--data', type=str, nargs='+', help='Names of Datasets') + parser.add_argument('--model', type=str, nargs='+', help='Names of Models') + parser.add_argument('--config', type=str, help='Path to the Config Json File') + # Work Dir + parser.add_argument('--work-dir', type=str, default='./outputs', help='select the output directory') + # Infer + Eval or Infer Only + parser.add_argument('--mode', type=str, default='all', choices=['all', 'infer', 'eval']) + # API Kwargs, Apply to API VLMs and Judge API LLMs + parser.add_argument('--api-nproc', type=int, default=4, help='Parallel API calling') + parser.add_argument('--retry', type=int, default=None, help='retry numbers for API VLMs') + parser.add_argument('--judge-args', type=str, default=None, help='Judge arguments in JSON format') + # Explicitly Set the Judge Model + parser.add_argument('--judge', type=str, default=None) + # Logging Utils + parser.add_argument('--verbose', action='store_true') + # Configuration for Resume + # Ignore: will not rerun failed VLM inference + parser.add_argument('--ignore', action='store_true', help='Ignore failed indices. ') + # Reuse: will reuse the existing prediction files + parser.add_argument('--reuse', action='store_true') + # Reuse-aux: if set, when reuse is True, will also reuse the auxiliary evaluation files + parser.add_argument('--reuse-aux', type=int, default=True, help='reuse auxiliary evaluation files') + parser.add_argument( + '--use-vllm', action='store_true', help='use vllm to generate, the flag is only supported in Llama4 for now') + parser.add_argument('--use-verifier', action='store_true', help='use verifier to evaluate') + + args = parser.parse_args() + return args + + +def main(): + logger = get_logger('RUN') + args = parse_args() + use_config, cfg = False, None + if args.config is not None: + assert args.data is None and args.model is None, '--data and --model should not be set when using --config' + use_config, cfg = True, load(args.config) + args.model = list(cfg['model'].keys()) + args.data = list(cfg['data'].keys()) + else: + assert len(args.data), '--data should be a list of data files' + + if RANK == 0: + if not args.reuse: + logger.warning('--reuse is not set, will not reuse previous (before one day) temporary files') + else: + logger.warning('--reuse is set, will reuse the latest prediction & temporary pickle files') + + if 'MMEVAL_ROOT' in os.environ: + args.work_dir = os.environ['MMEVAL_ROOT'] + + if not use_config: + for k, v in supported_VLM.items(): + if hasattr(v, 'keywords') and 'retry' in v.keywords and args.retry is not None: + v.keywords['retry'] = args.retry + supported_VLM[k] = v + if hasattr(v, 'keywords') and 'verbose' in v.keywords and args.verbose is not None: + v.keywords['verbose'] = args.verbose + supported_VLM[k] = v + + # If FWD_API is set, will use class `GPT4V` for all API models in the config + if os.environ.get('FWD_API', None) == '1': + from vlmeval.config import api_models as supported_APIs + from vlmeval.api import GPT4V + for m in args.model: + if m in supported_APIs: + kws = supported_VLM[m].keywords + supported_VLM[m] = partial(GPT4V, **kws) + logger.warning(f'FWD_API is set, will use class `GPT4V` for {m}') + + if WORLD_SIZE > 1: + import torch.distributed as dist + dist.init_process_group( + backend='nccl', + timeout=datetime.timedelta(seconds=int(os.environ.get('DIST_TIMEOUT', 3600))) + ) + + for _, model_name in enumerate(args.model): + model = None + date, commit_id = timestr('day'), githash(digits=8) + eval_id = f"T{date}_G{commit_id}" + + pred_root = osp.join(args.work_dir, model_name, eval_id) + pred_root_meta = osp.join(args.work_dir, model_name) + os.makedirs(pred_root_meta, exist_ok=True) + + prev_pred_roots = ls(osp.join(args.work_dir, model_name), mode='dir') + if len(prev_pred_roots) and args.reuse: + prev_pred_roots.sort() + + if not osp.exists(pred_root): + os.makedirs(pred_root, exist_ok=True) + + if use_config: + model = build_model_from_config(cfg['model'], model_name, args.use_vllm) + + for _, dataset_name in enumerate(args.data): + if WORLD_SIZE > 1: + dist.barrier() + + try: + pred_format = get_pred_file_format() + result_file_base = f'{model_name}_{dataset_name}.{pred_format}' + + if use_config: + if WORLD_SIZE > 1: + if RANK == 0: + dataset = build_dataset_from_config(cfg['data'], dataset_name) + dist.barrier() + dataset = build_dataset_from_config(cfg['data'], dataset_name) + if dataset is None: + logger.error(f'Dataset {dataset_name} is not valid, will be skipped. ') + continue + else: + dataset_kwargs = {} + if dataset_name in ['MMLongBench_DOC', 'DUDE', 'DUDE_MINI', 'SLIDEVQA', 'SLIDEVQA_MINI']: + dataset_kwargs['model'] = model_name + + # If distributed, first build the dataset on the main process for doing preparation works + if WORLD_SIZE > 1: + if RANK == 0: + dataset = build_dataset(dataset_name, **dataset_kwargs) + dist.barrier() + + dataset = build_dataset(dataset_name, **dataset_kwargs) + if dataset is None: + logger.error(f'Dataset {dataset_name} is not valid, will be skipped. ') + continue + + # Handling Multi-Turn Dataset + result_file = osp.join(pred_root, result_file_base) + # Reuse the previous prediction file if exists + if RANK == 0 and len(prev_pred_roots): + prepare_reuse_files( + pred_root_meta=pred_root_meta, eval_id=eval_id, model_name=model_name, + dataset_name=dataset_name, reuse=args.reuse, reuse_aux=args.reuse_aux + ) + + if WORLD_SIZE > 1: + dist.barrier() + + if model is None: + model = model_name # which is only a name + + if args.model != "eval": + # Perform the Inference + if dataset.MODALITY == 'VIDEO': + model = infer_data_job_video( + model, + work_dir=pred_root, + model_name=model_name, + dataset=dataset, + result_file_name=result_file_base, + verbose=args.verbose, + api_nproc=args.api_nproc, + use_vllm=args.use_vllm) + elif dataset.TYPE == 'MT': + model = infer_data_job_mt( + model, + work_dir=pred_root, + model_name=model_name, + dataset=dataset, + verbose=args.verbose, + api_nproc=args.api_nproc, + ignore_failed=args.ignore, + use_vllm=args.use_vllm) + else: + model = infer_data_job( + model, + work_dir=pred_root, + model_name=model_name, + dataset=dataset, + verbose=args.verbose, + api_nproc=args.api_nproc, + ignore_failed=args.ignore, + use_vllm=args.use_vllm) + + # Set the judge kwargs first before evaluation or dumping + + judge_kwargs = { + 'nproc': args.api_nproc, + 'verbose': args.verbose, + 'retry': args.retry if args.retry is not None else 3, + **(json.loads(args.judge_args) if args.judge_args else {}), + } + + if args.retry is not None: + judge_kwargs['retry'] = args.retry + if args.judge is not None: + judge_kwargs['model'] = args.judge + else: + print(dataset_name) + if dataset.TYPE in ['MCQ', 'Y/N', 'MCQ_MMMU_Pro'] or listinstr( + ['moviechat1k', 'mme-reasoning'], dataset_name.lower() + ): + if listinstr(['WeMath', 'MME-Reasoning'], dataset_name): + judge_kwargs['model'] = 'gpt-4o-mini' + elif listinstr(['VisuLogic'], dataset_name): + judge_kwargs['model'] = 'exact_matching' + else: + judge_kwargs['model'] = 'chatgpt-0125' + elif listinstr(['MMVet', 'LLaVABench', 'MMBench_Video'], dataset_name): + if listinstr(['LLaVABench_KO'], dataset_name): + judge_kwargs['model'] = 'gpt-4o-0806' + else: + judge_kwargs['model'] = 'gpt-4-turbo' + elif listinstr(['VGRPBench'], dataset_name): + judge_kwargs['model'] = 'gpt-4o' + elif listinstr(['MathVista', 'MathVerse', 'MathVision', 'DynaMath', 'VL-RewardBench', 'LogicVista', 'MOAT', 'OCR_Reasoning'], dataset_name): # noqa: E501 + judge_kwargs['model'] = 'gpt-4o-mini' + elif listinstr(['OlympiadBench'], dataset_name): + use_api_judger = judge_kwargs.get("olympiad_use_api_judger", False) + if use_api_judger: + judge_kwargs['model'] = 'gpt-4o-mini' + elif listinstr(['MMLongBench', 'MMDU', 'DUDE', 'SLIDEVQA', 'MIA-Bench', 'WildVision', 'MMAlignBench', 'MM-IFEval'], dataset_name): # noqa: E501 + judge_kwargs['model'] = 'gpt-4o' + elif listinstr(['ChartMimic'], dataset_name): + judge_kwargs['model'] = 'gpt-4o' + elif listinstr(['VDC'], dataset_name): + judge_kwargs['model'] = 'llama31-8b' + elif listinstr(['Video_MMLU_QA', 'Video_MMLU_CAP'], dataset_name): + judge_kwargs['model'] = 'qwen-72b' + elif listinstr(['MMVMBench'], dataset_name): + judge_kwargs['model'] = 'gpt-4o' + elif listinstr(['CVQA_EN', 'CVQA_LOC'], dataset_name): + judge_kwargs['model'] = 'gpt-4.1' + elif listinstr(['M4Bench'], dataset_name): + judge_kwargs['model'] = 'gpt-4o' + elif listinstr(['AyaVisionBench'], dataset_name): + judge_kwargs['model'] = 'gpt-4.1' + + if args.use_verifier: + judge_kwargs['use_verifier'] = True + if args.use_vllm: + judge_kwargs['use_vllm'] = True + + if RANK == 0: + logger.info(judge_kwargs) + + if WORLD_SIZE > 1: + dist.barrier() + + # Only RANK 0 handles the evaluation part + if RANK == 0: + # Prepare Submission Files for MMMU_TEST AND MMT-Bench_ALL + if dataset_name in ['MMMU_TEST']: + result_json = MMMU_result_transfer(result_file) + logger.info(f'Transfer MMMU_TEST result to json for official evaluation, ' + f'json file saved in {result_json}') + continue + elif 'MMT-Bench_ALL' in dataset_name: + submission_file = MMTBench_result_transfer(result_file, **judge_kwargs) + logger.info(f'Extract options from prediction of MMT-Bench FULL split for official evaluation ' + f'(https://eval.ai/web/challenges/challenge-page/2328/overview), ' + f'submission file saved in {submission_file}') + continue + + # Skip the evaluation part if only infer + if args.mode == 'infer': + continue + + # Skip the evaluation part if the dataset evaluation is not supported or annotations are missing + if 'MLLMGuard_DS' in dataset_name: + logger.info('The evaluation of MLLMGuard_DS is not supported yet. ') + continue + elif 'AesBench_TEST' == dataset_name: + logger.info(f'The results are saved in {result_file}. ' + f'Please send it to the AesBench Team via huangyipo@hotmail.com.') + continue + elif dataset_name in ['DocVQA_TEST', 'InfoVQA_TEST', 'Q-Bench1_TEST', 'A-Bench_TEST']: + logger.info(f'{dataset_name} is a test split without ground-truth. ' + 'Thus only the inference part is supported for those datasets. ') + continue + elif dataset_name in [ + 'MMBench_TEST_CN', 'MMBench_TEST_EN', 'MMBench', 'MMBench_CN', + 'MMBench_TEST_CN_V11', 'MMBench_TEST_EN_V11', 'MMBench_V11', 'MMBench_CN_V11' + ] and not MMBenchOfficialServer(dataset_name): + logger.error( + f'Can not evaluate {dataset_name} on non-official servers, will skip the evaluation.') + continue + + # Setup the proxy for the evaluation + eval_proxy = os.environ.get('EVAL_PROXY', None) + old_proxy = os.environ.get('HTTP_PROXY', '') + if eval_proxy is not None: + proxy_set(eval_proxy) + + # Perform the Evaluation + eval_results = dataset.evaluate(result_file, **judge_kwargs) + # Display Evaluation Results in Terminal + if eval_results is not None: + assert isinstance(eval_results, dict) or isinstance(eval_results, pd.DataFrame) + logger.info(f'The evaluation of model {model_name} x dataset {dataset_name} has finished! ') + logger.info('Evaluation Results:') + if isinstance(eval_results, dict): + logger.info('\n' + json.dumps(eval_results, indent=4)) + elif isinstance(eval_results, pd.DataFrame): + if len(eval_results) < len(eval_results.columns): + eval_results = eval_results.T + logger.info('\n' + tabulate(eval_results)) + + # Restore the proxy + if eval_proxy is not None: + proxy_set(old_proxy) + + # Create the symbolic links for the prediction files + files = os.listdir(pred_root) + files = [x for x in files if (f'{model_name}_{dataset_name}' in x or "status.json" in x)] + for f in files: + cwd = os.getcwd() + file_addr = osp.join(cwd, pred_root, f) + link_addr = osp.join(cwd, pred_root_meta, f) + if osp.exists(link_addr) or osp.islink(link_addr): + os.remove(link_addr) + os.symlink(file_addr, link_addr) + + except Exception as e: + logger.exception(f'Model {model_name} x Dataset {dataset_name} combination failed: {e}, ' + 'skipping this combination.') + continue + + if WORLD_SIZE > 1: + dist.destroy_process_group() + + +if __name__ == '__main__': + load_env() + main() diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/__pycache__/__init__.cpython-310.pyc b/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc859715e0af6964cdea264d4501a2ab471e2a0f Binary files /dev/null and b/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/__pycache__/__init__.cpython-310.pyc differ diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/__pycache__/cg_av_counting.cpython-310.pyc b/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/__pycache__/cg_av_counting.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..566717db1ab011f7c06feaf83a40bf3bf19d098f Binary files /dev/null and b/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/__pycache__/cg_av_counting.cpython-310.pyc differ diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/cg_av_counting.py b/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/cg_av_counting.py new file mode 100644 index 0000000000000000000000000000000000000000..8626c7fd401aedceed5e3dc0a6b55395cd99c296 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/cg_av_counting.py @@ -0,0 +1,405 @@ +from huggingface_hub import snapshot_download +from ...smp import * +from ..video_base import VideoBaseDataset +from ..utils import build_judge, DEBUG_MESSAGE, cgbench +from .utils import * +from ...utils import track_progress_rich + + +class CGAVCounting(VideoBaseDataset): + + dataset = "CG-AV-Counting" + + TYPE = "Video-Counting" + + MD5 = "d1cd8486353ab85178098d443264a7d0" + + SYS = "" + + def __init__( + self, + dataset="CG-AV-Counting", + use_frame_time=False, + nframe=0, + fps=-1, + ): + super().__init__(dataset=dataset, nframe=nframe, fps=fps) + self.use_frame_time = use_frame_time + self.dataset_name = dataset + self.frame_tmpl_clue = 'frame-{}.jpg' + + @classmethod + def supported_datasets(cls): + return ["CGAVCounting"] + + def frame_paths_clue(self, video,timestamp_list): + frame_root = osp.join(self.frame_root, video) + os.makedirs(frame_root, exist_ok=True) + return [osp.join(frame_root, self.frame_tmpl_clue.format(i)) for i in timestamp_list] + + def save_video_frames_clue(self, video,uid,timestamp_list): + if type(uid) is not str: + uid = str(uid) + import decord + frame_paths = self.frame_paths_clue(uid,timestamp_list) + flag = np.all([osp.exists(p) for p in frame_paths]) + if flag: + frame = Image.open(frame_paths[0]) + return frame_paths,frame.width,frame.height + vid_path = osp.join(self.data_root, video) + vid = decord.VideoReader(vid_path) + frames = [] + # 获取视频的帧率 + fps = vid.get_avg_fps() + lock_path = osp.splitext(vid_path)[0] + '.lock' + with portalocker.Lock(lock_path, 'w', timeout=30): + for timestamp_sec in timestamp_list: + # 计算视频帧对应的索引 + frame_idx = int(timestamp_sec * fps) + + # 获取对应帧 + frame = vid[frame_idx] + + # 将帧转换为PIL图像 + img = Image.fromarray(frame.asnumpy()) + frames.append(img) + for im, pth in zip(frames, frame_paths): + if not osp.exists(pth): + im.save(pth) + return frame_paths,frames[0].width,frames[0].height + + def format_time(self,t): + return f"{t:.2f}" + + def get_output_filename(self,item): + video_id = Path(item["video"]).stem + start_str = self.format_time(item["query_interval"][0]) + end_str = self.format_time(item["query_interval"][1]) + return f"{video_id}_{start_str}_{end_str}.mp4" + + def prepare_dataset(self, dataset_name="CG-AV-Counting", repo_id="CG-Bench/CG-AV-Counting"): + + def check_integrity(pth): + data_file = osp.join(pth, f"{dataset_name}.tsv") + + if not os.path.exists(data_file): + return False + + if md5(data_file) != self.MD5: + return False + data = load(data_file) + for video_pth in data["video"]: + if not osp.exists(osp.join(pth, video_pth)): + return False + return True + + cache_path = get_cache_path(repo_id) + + if cache_path is not None and check_integrity(cache_path): + dataset_path = cache_path + else: + + def generate_tsv(pth): + + tsv_file = osp.join(pth, f"{dataset_name}.tsv") + + task_modes = ["long_acc", "ref_acc", "clue_acc"] + all_data = [] + for task_mode in task_modes: + with open(osp.join(pth, "cg-av-counting.json"), "r") as f: + data_file = pd.DataFrame(json.load(f)) + + data_file = data_file.assign(index=range(len(data_file))) + data_file["video_uid"] = data_file["video"].replace(".mp4","") + data_file["video"] = data_file["video"].apply(lambda x: f"cg_videos_720p/{x}") + + data_file["ref_video_path"] = "" + data_file["ref_video_uid"] = "" + + if task_mode in ["ref_acc"]: + data_file["ref_video_path"] = data_file.apply( + lambda row: f"ref_videos/{self.get_output_filename(row)}", axis=1 + ) + data_file["ref_video_uid"] = data_file["ref_video_path"].apply( + lambda x: x.split("/")[-1].replace(".mp4", "")) + + data_file["task_mode"] = task_mode + + if task_mode == "clue_acc": + data_file["answer"] = data_file["clue"].apply(json.dumps) + + data_file = data_file[ + [ + "index", + "video_uid", + "video", + "ref_video_path", + "ref_video_uid", + "question", + "answer", + "type", + "category", + "task_mode" + ] + ] + + all_data.append(data_file) + + final_data = pd.concat(all_data, ignore_index=True) + final_data["index"] = range(len(final_data)) + final_data.to_csv(tsv_file, sep="\t", index=False) + dataset_path = cache_path + + if modelscope_flag_set(): + from modelscope import dataset_snapshot_download + + dataset_path = dataset_snapshot_download(dataset_id=repo_id) + else: + dataset_path = snapshot_download(repo_id=repo_id, repo_type="dataset") + + unzip_hf_zip(dataset_path) + + generate_tsv(dataset_path) + + tsv_file = osp.join(dataset_path, f"{dataset_name}.tsv") + + return dict(data_file=tsv_file, root=dataset_path) + + def build_prompt(self, line,video_llm): + if isinstance(line, int): + assert line < len(self) + line = self.data.iloc[line] + task_mode = line["task_mode"] + assert task_mode in ["long_acc","clue_acc","ref_acc"] + if task_mode == "long_acc": + user_prompt = "" + message = [] + video_path = line["video"] + if video_llm: + message.append(dict(type="video", value=osp.join(self.data_root, video_path))) + else: + image_paths, frame_indices, vid_fps = self.save_video_frames( + video_path, uid=line["video_uid"], num_frames=self.nframe, fps=self.fps + ) + message.extend(dict(type="image", value=im) for im in image_paths) + + if self.use_frame_time: + user_prompt += get_timestampes(frame_indices, vid_fps) + + user_prompt += ( + f"Please answer the question '{line['question']}' with a number. Just output the number itself, " + "don't output anything else." + ) + message.append(dict(type="text", value=user_prompt)) + elif task_mode == "ref_acc": + user_prompt = "" + message = [] + video_path = line["ref_video_path"] + if video_llm: + message.append(dict(type="video", value=osp.join(self.data_root, video_path))) + else: + image_paths, frame_indices, vid_fps = self.save_video_frames( + video_path, uid=line["ref_video_uid"], num_frames=self.nframe, fps=self.fps + ) + message.extend(dict(type="image", value=im) for im in image_paths) + + if self.use_frame_time: + user_prompt += get_timestampes(frame_indices, vid_fps) + user_prompt += ( + f"Please answer the question '{line['question']}' with a number. Just output the number itself, " + "don't output anything else." + ) + message.append(dict(type="text", value=user_prompt)) + elif task_mode == "clue_acc": + if line["category"] == "event": + user_prompt = "" + message = [] + video_path = line["video"] + if video_llm: + message.append(dict(type="video", value=osp.join(self.data_root, video_path))) + else: + image_paths, frame_indices, vid_fps = self.save_video_frames( + video_path, uid=line["video_uid"], num_frames=self.nframe, fps=self.fps + ) + message.extend(dict(type="image", value=im) for im in image_paths) + user_prompt += get_timestampes(frame_indices, vid_fps) + + user_prompt += ( + f"Watch the video and provide your answer to the question '{line['question']}', " + "including the start and end timestamps for each event." + "Format your answer in JSON, enclosed in and tags. " + "The output should look like this: [[\"start_time\", \"end_time\"], ...]. " + "Ensure each timestamp is in seconds (e.g., 'xx.xx')." + ) + message.append(dict(type="text", value=user_prompt)) + elif line["category"] == "object": + user_prompt = "" + message = [] + video_path = line["video"] + clue_timestamp_list = [] + for clue in json.loads(line["answer"]): + if clue["timestamp"] not in clue_timestamp_list: + clue_timestamp_list.append(clue["timestamp"]) + image_paths, width, height = self.save_video_frames_clue( + video_path, uid=line["video_uid"], timestamp_list=clue_timestamp_list + ) + message.append( + dict(type="text", value=f"There are {len(image_paths)} frames in the size of {width}x{height}")) + for idx,im in enumerate(image_paths): + message.append(dict(type="text", value=f"Frame{idx + 1}:")) + message.append(dict(type="image", value=im)) + user_prompt += ( + f"Answer the question '{line['question']}', " + "including the bounding box for the query object in the first frame " + "where it appears. For subsequent frames where the object appears, " + "do not provide the bounding box again. " + "Format your answer in JSON, enclosed within and tags. " + "The output should look like this: " + "{\"Frame1\": [[x_min, y_min, x_max, y_max]], \"Frame2\": [...],...}. " + "In the output, each frame should either contain the bounding box of the object " + "(if it appears for the first time in that frame) or an empty list `[]` " + "(if the object does not appear or it has already been labeled in a previous frame). " + "Ensure that bounding boxes are listed as [x_min, y_min, x_max, y_max]." + ) + message.append(dict(type="text", value=user_prompt)) + elif line["category"] == "attribute": + user_prompt = "" + message = [] + video_path = line["video"] + clue_timestamp_list = [] + for clue_ in json.loads(line["answer"]): + for clue in clue_: + if clue["timestamp"] not in clue_timestamp_list: + clue_timestamp_list.append(clue["timestamp"]) + image_paths,width,height = self.save_video_frames_clue( + video_path, uid=line["video_uid"],timestamp_list=clue_timestamp_list + ) + message.append(dict( + type="text", + value=f"There are {len(image_paths)} frames in the size of {width}x{height}")) + for idx,im in enumerate(image_paths): + message.append(dict(type="text", value=f"Frame{idx + 1}:")) + message.append(dict(type="image", value=im)) + user_prompt += ( + f"Answer the question '{line['question']}', clustering the objects according to the question. " + "For each unique cluster, assign a unique label and return the bounding box for each object in " + "the first frame where it appears. For subsequent frames where the object appears, " + "do not output anything. " + "Format your answer in JSON, enclosed within and tags. " + "The output should look like this: " + "{\"Frame 1\": [{\"bbox\": [x_min, y_min, x_max, y_max], 'label': \"Label 1\"}], " + "\"Frame 2\": [...], ...}. " + "In the output, each frame should either contain the bounding box and label for the object " + "(if it appears for the first time in that frame) or an empty list `[]` " + "(if the object has already been labeled or does not appear in that frame). " + "The label should correspond to a unique object cluster according to the question." + ) + message.append(dict(type="text", value=user_prompt)) + print(message) + return message + + def save_video_frames(self, video, uid, num_frames=8, fps=-1): + + if type(uid) is not str: + uid = str(uid) + import decord + vid_path = osp.join(self.data_root, video) + vid = decord.VideoReader(vid_path) + vid_fps = vid.get_avg_fps() + n_frames = len(vid) + + if num_frames > 0 and fps < 0: + step_size = len(vid) / (num_frames + 1) + indices = [int(i * step_size) for i in range(1, num_frames + 1)] + + frame_paths = self.frame_paths(uid) + elif fps > 0: + total_duration = n_frames / vid_fps + required_frames = int(total_duration * fps) + step_size = vid_fps / fps + indices = [int(i * step_size) for i in range(required_frames)] + frame_paths = self.frame_paths_fps(uid, len(indices)) + + # Save and validate frames + valid_paths = [] + valid_indices = [] + lock_path = osp.splitext(vid_path)[0] + '.lock' + with portalocker.Lock(lock_path, 'w', timeout=30): + if not np.all([osp.exists(p) for p in frame_paths]): + images = [vid[i].asnumpy() for i in indices] + for i, (img_array, path) in enumerate(zip(images, frame_paths)): + if osp.exists(path): + try: + with Image.open(path) as img: + img.verify() + valid_paths.append(path) + valid_indices.append(indices[i]) + except Exception: + continue + else: + try: + img = Image.fromarray(img_array) + img.save(path) + img.verify() + valid_paths.append(path) + valid_indices.append(indices[i]) + except Exception: + continue + else: + for i, path in enumerate(frame_paths): + try: + with Image.open(path) as img: + img.verify() + valid_paths.append(path) + valid_indices.append(indices[i]) + except Exception: + continue + + return valid_paths, valid_indices, vid_fps + + def evaluate(self, eval_file, **judge_kwargs): + + assert get_file_extension(eval_file) in ['xlsx', 'json', 'tsv'], \ + 'data file should be an supported format (xlsx/json/tsv) file' + + tgt_file = get_intermediate_file_path(eval_file, '_rating', 'json') + score_file = get_intermediate_file_path(eval_file, '_score', 'csv') + + data = load(eval_file) + + data_un = data[~pd.isna(data["prediction"])] + data_pred_na = data[pd.isna(data["prediction"])] + + data_pred_na["score"] = -1 + + scores_df = data_un.apply( + lambda row: post_process( + response=row["prediction"], + right_answer=row["answer"], + task_mode=row["task_mode"], + category=row["category"] + ), + axis=1, + result_type='expand' + ) + + data_un = pd.concat([data_un, scores_df], axis=1) + + data = pd.concat([data_pred_na, data_un]) + + rejected_count = (data["score"] == -1).sum() + + print( + f"Among {len(data)} questions, " + f"failed to obtain prediction for {len(data_pred_na)} questions, " + f"failed to obtain the score for {rejected_count - len(data_pred_na)} questions. " + f"Those questions will be counted as -1 score in ALL rating, and will not be counted in VALID rating." + ) + + dump(data, score_file) + + rating = rating_func(score_file) + + dump(rating, tgt_file) + + return rating diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/utils.py b/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..116d0436b58dfad6ac0b6eb1850761e7831cbde9 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/CGAVCounting/utils.py @@ -0,0 +1,422 @@ +import json +import math + +from ...smp import * +import numpy as np +import re +import zipfile + +from pathlib import Path +from tqdm import tqdm +import signal + + +def rating_func(data_path): + df = load(data_path) + + task_mode_fields = { + "long_acc": ["acc", "oboa", "mae", "rmse"], + "ref_acc": ["acc", "oboa", "mae", "rmse"], + "clue_acc": ["wcs", "ifa"], + } + + rating = {} + + for task_mode, fields in task_mode_fields.items(): + sub_df = df[df["task_mode"] == task_mode] + for field in fields: + values = sub_df[field] + if field == "rmse": + # RMSE: sqrt(mean(x^2)) + rmse_val = np.sqrt(values.mean()) + rating[f"{task_mode}/rmse"] = round(rmse_val, 4) + else: + rating[f"{task_mode}/{field}"] = round(values.mean(), 4) + + return rating + + +def get_timestampes(frame_indices, fps): + seconds = list(map(lambda x: str(round(x / fps, 4)), frame_indices)) + timestamps = ", ".join(seconds) + return "A total of {frame_num} frames are sampled. Their corresponding timestamps are:\n\n{timestamps}\n\n".format( + frame_num=len(frame_indices), timestamps=timestamps + ) + + +def time_str_to_seconds(time_str: str) -> float: + time_str = time_str.strip() + if '.' in time_str: + time_main, milliseconds = time_str.split('.') + milliseconds = float(f"0.{milliseconds}") + else: + time_main = time_str + milliseconds = 0.0 + + parts = list(map(int, time_main.split(":"))) + + if len(parts) == 2: + minutes, seconds = parts + total_seconds = minutes * 60 + seconds + elif len(parts) == 3: + hours, minutes, seconds = parts + total_seconds = hours * 3600 + minutes * 60 + seconds + else: + raise ValueError(f"Invalid time format: {time_str}") + + return total_seconds + milliseconds + + +def extract_outer_json(text): + stack = [] + start_idx = None + opening = {'{': '}', '[': ']'} + closing = {'}': '{', ']': '['} + + for i, char in enumerate(text): + if char in opening: + if not stack: + start_idx = i # 最外层起点 + stack.append(char) + elif char in closing: + if stack and stack[-1] == closing[char]: + stack.pop() + if not stack and start_idx is not None: + candidate = text[start_idx:i + 1] + try: + return json.dumps(json.loads(candidate)) + except json.JSONDecodeError: + continue # 尝试下一个 JSON 块 + return None + + +def compute_tiou(t1, t2): + """Temporal IoU""" + inter_start = max(t1[0], t2[0]) + inter_end = min(t1[1], t2[1]) + inter = max(0.0, inter_end - inter_start) + union = max(t1[1], t2[1]) - min(t1[0], t2[0]) + return inter / union if union > 0 else 0.0 + + +def compute_sIoU(box1, box2): + """ + Complete IoU (sIoU) between two bounding boxes. + Args: + box1 (list or np.array): [x1, y1, x2, y2] of ground truth box + box2 (list or np.array): [x1, y1, x2, y2] of predicted box + + Returns: + IoU (float): The IoU score between the two boxes. + """ + + # Ensure the coordinates are ordered: [min_x, min_y, max_x, max_y] + box1 = np.array([min(box1[0], box1[2]), min(box1[1], box1[3]), + max(box1[0], box1[2]), max(box1[1], box1[3])]) + box2 = np.array([min(box2[0], box2[2]), min(box2[1], box2[3]), + max(box2[0], box2[2]), max(box2[1], box2[3])]) + + # Compute the intersection area + inter_x1 = max(box1[0], box2[0]) + inter_y1 = max(box1[1], box2[1]) + inter_x2 = min(box1[2], box2[2]) + inter_y2 = min(box1[3], box2[3]) + + inter_area = max(0, inter_x2 - inter_x1) * max(0, inter_y2 - inter_y1) + + # Compute areas of the individual boxes + area1 = (box1[2] - box1[0]) * (box1[3] - box1[1]) + area2 = (box2[2] - box2[0]) * (box2[3] - box2[1]) + + # Compute union area + union = area1 + area2 - inter_area + iou = inter_area / union if union > 0 else 0.0 + + return iou + + +def greedy_matching(gt_instances, pred_instances, iou_func): + """Greedy matching based on maximum IoU""" + unmatched_gt = set(range(len(gt_instances))) + unmatched_pred = set(range(len(pred_instances))) + matches = [] + + while unmatched_gt and unmatched_pred: + max_iou = -1 + best_match = None + for gt_idx in unmatched_gt: + for pred_idx in unmatched_pred: + iou = iou_func(gt_instances[gt_idx], pred_instances[pred_idx]) + if iou > max_iou: + max_iou = iou + best_match = (gt_idx, pred_idx) + + if best_match: + gt_idx, pred_idx = best_match + matches.append((gt_idx, pred_idx)) + unmatched_gt.remove(gt_idx) + unmatched_pred.remove(pred_idx) + + return matches + + +def compute_cluster_pair_wcs(gt, pred, iou_type): + if iou_type == 'tIoU': + loc_sum = 0.0 + for g in gt: + loc_sum += max([compute_tiou(g, p) for p in pred] or [0.0]) + loc_acc = loc_sum / len(gt) if gt else 0.0 + count_penalty = 1.0 - abs(len(pred) - len(gt)) / max(len(gt), 1) + # count_penalty = 1.0 + return math.sqrt(loc_acc * max(0, count_penalty)) + + elif iou_type == 'sIoU': + # group by frame index + from collections import defaultdict + gt_by_f = defaultdict(list) + pred_by_f = defaultdict(list) + for f, box in gt: + gt_by_f[f].append(box) + for f, box in pred: + pred_by_f[f].append(box) + + all_f = set(gt_by_f) | set(pred_by_f) + wcs = 0.0 + for f in all_f: + gt_f = gt_by_f.get(f, []) + pred_f = pred_by_f.get(f, []) + matches = greedy_matching(gt_f, pred_f, compute_sIoU) + loc_sum = sum([compute_sIoU(gt_f[i], pred_f[j]) for i, j in matches]) + loc_acc = loc_sum / len(gt_f) if gt_f else 0.0 + count_penalty = 1.0 - abs(len(pred_f) - len(gt_f)) / max(len(gt_f), 1) + # count_penalty = 1.0 + wcs += math.sqrt(loc_acc * max(0, count_penalty)) + return wcs / max(len(all_f), 1) + + else: + raise ValueError("Unsupported iou_type") + + +class TimeoutException(Exception): + pass + + +def timeout_handler(signum, frame): + raise TimeoutException("Function execution exceeded the time limit.") + + +def compute_wcs_unlabeled(gt_clusters, pred_clusters, iou_type='tIoU', + timeout=10): # 主要是给attribute用的,但是object和event视作一个cluster也能用 + from scipy.optimize import linear_sum_assignment + # Set the timeout signal handler + signal.signal(signal.SIGALRM, timeout_handler) + signal.alarm(timeout) # Set the alarm to go off in 'timeout' seconds + + try: + # Original function logic + K = len(gt_clusters) + M = len(pred_clusters) + + # Build cost matrix (we want max score → min cost) + score_matrix = np.zeros((K, M)) + for i in range(K): + for j in range(M): + score_matrix[i, j] = compute_cluster_pair_wcs(gt_clusters[i], pred_clusters[j], iou_type) + + cost_matrix = -score_matrix # maximize score → minimize cost + + row_ind, col_ind = linear_sum_assignment(cost_matrix) + + matched_scores = [score_matrix[i, j] for i, j in zip(row_ind, col_ind)] + + # WCS = average over gt clusters (including unmatched = 0) + total_wcs = sum(matched_scores) + return total_wcs / K + + except TimeoutException: + print(gt_clusters, pred_clusters) + print("Function execution exceeded the time limit.") + return None # or you can return some default value to indicate timeout + + finally: + signal.alarm(0) # Cancel the alarm after the function completes or times out + + +def post_process(response, right_answer, task_mode, category): + from word2number import w2n + if task_mode in ["long_acc", "ref_acc"]: + result = {"acc": 0, "oboa": 0, "mae": 0, "rmse": 0} + if response: + try: + pred = w2n.word_to_num(response) + except: + pred = 0 + if abs(float(right_answer) - float(pred)) <= 1e-5: + result["acc"] = 1 + + if abs(float(right_answer) - float(pred)) <= 1: + result["oboa"] = 1 + + if abs(float(right_answer) - float(pred)) <= max(2 * float(right_answer),100): + result["mae"] = abs(float(right_answer) - float(pred)) + result["rmse"] = abs(float(right_answer) - float(pred)) ** 2 + else: + result["mae"] = abs(float(right_answer) * 2) + result["rmse"] = abs(float(right_answer) * 2) ** 2 + elif task_mode == "clue_acc": + result = {"wcs": 0, "ifa": 0} + if response: + clues = json.loads(right_answer) + content_match = re.search(r"(.*?)", response, re.DOTALL) + student_answer = content_match.group(1).strip() if content_match else response.strip() + j = None + try: + try: + j = json.loads(student_answer) + except: + j = json.loads(extract_outer_json(student_answer)) + except: + pass + if j is not None: + try: + if category == "event": + pred = [] + for e in j: + + if isinstance(e[0],str) and isinstance(e[1],str) and ":" in e[0] and ":" in e[1]: + pred.append([time_str_to_seconds(e[0]), time_str_to_seconds(e[1])]) + else: + pred.append([float(e[0].split(" ")[0]) if isinstance(e[0],str) else e[0], + float(e[1].split(" ")[0]) if isinstance(e[1],str) else e[1]]) + gt = [] + for e in clues: + gt.append([float(e['start']), float(e['end'])]) + + result["wcs"] = compute_wcs_unlabeled([gt], [pred], "tIoU") + result["ifa"] = 1 + elif category == "object": + gt = [] + clue_timestamp_list = [] + for clue in clues: + if clue["timestamp"] not in clue_timestamp_list: + clue_timestamp_list.append(clue["timestamp"]) + for clue in clues: + gt.append((clue_timestamp_list.index(clue["timestamp"]), clue['bbox'])) + pred = [] + for key in j.keys(): + if "Frame" not in key: + continue + idx = int(key.replace("Frame", "")) - 1 + if len(j[key]) == 0: + continue + if isinstance(j[key][0],list) and len(j[key][0]) == 4: + for e in j[key]: + if isinstance(e,list) and len(e) == 4: + pred.append((idx, e)) + elif isinstance(j[key][0],list) and len(j[key][0]) == 2: + for ii in range(int(len(j[key]) // 2)): + if isinstance(j[key][ii * 2],list) and len(j[key][ii * 2]) == 2 and isinstance( + j[key][ii * 2 + 1],list) and len(j[key][ii * 2 + 1]) == 2: + pred.append((idx, [j[key][ii * 2][0], j[key][ii * 2][1], j[key][ii * 2 + 1][0], + j[key][ii * 2 + 1][1]])) + result["wcs"] = compute_wcs_unlabeled([gt], [pred], "sIoU") + result["ifa"] = 1 + elif category == "attribute": + gt = [] + clue_timestamp_list = [] + for clue_ in clues: + for clue in clue_: + if clue["timestamp"] not in clue_timestamp_list: + clue_timestamp_list.append(clue["timestamp"]) + for clue_ in clues: + gt_ = [] + for clue in clue_: + gt_.append((clue_timestamp_list.index(clue["timestamp"]), clue['bbox'])) + gt.append(gt_) + pred = {} + for key in j.keys(): + if "Frame" not in key: + continue + idx = int(key.replace("Frame", "")) - 1 + for e in j[key]: + if e['label'] not in pred.keys(): + pred[e['label']] = [] + if 'bbox' in e: + if isinstance(e['bbox'],list) and len(e['bbox']) == 4: + pred[e['label']].append((idx, e['bbox'])) + if 'bbox_2d' in e: + if isinstance(e['bbox_2d'],list) and len(e['bbox_2d']) == 4: + pred[e['label']].append((idx, e['bbox_2d'])) + pred_list = [pred[key] for key in pred] + result["wcs"] = compute_wcs_unlabeled(gt, pred_list, "sIoU") + result["ifa"] = 1 + except: + pass + + return result + + +def get_chunk_number(filename): + try: + num = filename.split("chunk_")[1].split(".zip")[0] + return int(num) + except: + return float('inf') + + +def auto_merge_and_unzip_parts(target_dir, extract_dir, zip_prefix=None): + target_dir = Path(target_dir) + extract_dir = Path(extract_dir) + extract_dir.mkdir(parents=True, exist_ok=True) + + # 匹配 zip 分卷:例如 video_chunk_001.zip.part000 + part_files = sorted(target_dir.glob("*.zip.part*")) + groups = {} + + # 分组:根据前缀提取 group 名(即 zip 文件名) + for part_file in part_files: + match = re.match(r"(.*\.zip)\.part\d+$", part_file.name) + if match: + zip_name = match.group(1) + if zip_prefix is None or Path(zip_name).stem.startswith(zip_prefix): + groups.setdefault(zip_name, []).append(part_file) + + if not groups: + print(f"No matching zip parts found with prefix: {zip_prefix}") + return + + # 合并每一组分卷 -> 解压 + for zip_name, parts in tqdm(groups.items(), desc="Merging and unzipping"): + parts = sorted(parts, key=lambda p: int(p.name.split("part")[-1])) + zip_path = target_dir / zip_name + + # 合并分卷 + with open(zip_path, 'wb') as outfile: + for part in parts: + with open(part, 'rb') as infile: + outfile.write(infile.read()) + + # 解压合并后的 zip 文件 + with zipfile.ZipFile(zip_path, 'r') as zip_ref: + zip_ref.extractall(extract_dir) + + # 删除合并后的 zip 文件(可注释) + zip_path.unlink() + + +def unzip_hf_zip(target_dir): + target_dir = Path(target_dir) + + videos_dir = target_dir / "cg_videos_720p" + ref_videos_dir = target_dir / "ref_videos" + + if videos_dir.exists() and ref_videos_dir.exists(): + print("all target dirs exist, skip.") + return + + videos_dir.mkdir(parents=True, exist_ok=True) + + auto_merge_and_unzip_parts(target_dir,ref_videos_dir, zip_prefix="ref_videos") + auto_merge_and_unzip_parts(target_dir,videos_dir, zip_prefix="videos") + + print("sucessfully unzip all files.") diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/README.md b/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/README.md new file mode 100644 index 0000000000000000000000000000000000000000..34491189580c17e4193a889e5da9c051be632c88 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/README.md @@ -0,0 +1,79 @@ +# EgoExoBench + +This is the official repository of [EgoExoBench: A +Benchmark for First- and Third-person View Video +Understanding in MLLMs]() + +## 📊 Benchmark Overview + +**EgoExoBench** is a large-scale benchmark designed to evaluate cross-view video understanding in multimodal large language models (MLLMs). It contains paired egocentric–exocentric videos and over **7,300 multiple-choice questions** across **11 subtasks**, covering three key dimensions of ego–exo reasoning: + +* **Ego-Exo Relation** +* **Ego-Exo View Transition** +* **Ego-Exo Temporal Reasoning** + +## 📝 Data Preparation + +### Video Data + +EgoExoBench builds upon six publicly available ego–exo datasets. + +* [Ego-Exo4D](https://ego-exo4d-data.org/) +* [LEMMA](https://sites.google.com/view/lemma-activity) +* [EgoExoLearn](https://huggingface.co/datasets/hyf015/EgoExoLearn) +* [TF2023](https://github.com/ziweizhao1993/PEN) +* [EgoMe](https://huggingface.co/datasets/HeqianQiu/EgoMe) +* [CVMHAT](https://github.com/RuizeHan/CVMHT) + +The script will automatically download the processed video data, **except Ego-Exo4D**, due to license restrictions. You need to manually download it from the [official website](https://ego-exo4d-data.org/) and organize it as shown below. + +If you prefer to download all datasets manually, you can simply create empty `processed_videos/` and `processed_frames/` folders and organize the datasets in the following structure: + +``` +[LMUData]/videos/EgoExoBench +├── CVMHAT/ +│ └── data/ +├── EgoExo4D/ +│ └── takes/ +├── EgoExoLearn/ +├── EgoMe/ +├── LEMMA/ +├── TF2023/ +│ └── data/ +├── processed_frames/ +└── processed_videos/ +``` +### Multiple-Choice Questions (MCQs) + +The script will automatically download the EgoExoBench **multiple-choice questions (MCQs)** file from this [link](https://huggingface.co/datasets/Heleun/EgoExoBench_MCQ). + +## 🚀 Model Evaluation + +Use the following commands to evaluate your VLMs on EgoExoBench: + +```shell +# For lightweight vision-language models +torchrun --nproc-per-node=1 run.py \ + --data EgoExoBench_MCQ \ + --model Qwen2.5-VL-7B-Instruct-ForVideo + +# For larger models with higher memory usage +python run.py \ + --data EgoExoBench_MCQ \ + --model Qwen2.5-VL-72B-Instruct-ForVideo +``` + +To skip evaluation on the **Ego-Exo4D** portion of the benchmark, specify the `EgoExoBench_64frame_skip_EgoExo4D` configuration with the **`--data`** argument. + +``` +# Example command to skip Ego-Exo4D +torchrun --nproc-per-node=1 run.py \ + --data EgoExoBench_64frame_skip_EgoExo4D \ + --model [Your_Model_Name] +``` + +> 💡 Note: If you encounter errors related to stacking videos with varying frame counts, try using `transformers==4.49.0` as a temporary workaround. + +## 🙏 Acknowledgements + +EgoExoBench builds upon publicly available ego–exo datasets: [Ego-Exo4D](https://ego-exo4d-data.org/), [LEMMA](https://sites.google.com/view/lemma-activity), [EgoExoLearn](https://huggingface.co/datasets/hyf015/EgoExoLearn), [TF2023](https://github.com/ziweizhao1993/PEN), [EgoMe](https://huggingface.co/datasets/HeqianQiu/EgoMe), [CVMHAT](https://github.com/RuizeHan/CVMHT). Thanks for open-sourcing! diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/__pycache__/utils.cpython-310.pyc b/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/__pycache__/utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..026abd71bbcfe0450ce000082b33d6f7473f51ae Binary files /dev/null and b/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/__pycache__/utils.cpython-310.pyc differ diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/cvmhat_preprocess.py b/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/cvmhat_preprocess.py new file mode 100644 index 0000000000000000000000000000000000000000..1bdba4e4f4840021f7f69eb2ccef8a4230acd290 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/cvmhat_preprocess.py @@ -0,0 +1,45 @@ +import json +import os +import xml.etree.ElementTree as ET +import cv2 + +# replace with your actual path +ann_file = 'EgoExoBench/MCQ/Ego-Exo-Relation/person_relation.json' + + +def add_bbox(bbox_img_path): + bbox_dir = os.path.dirname(bbox_img_path) + os.makedirs(bbox_dir, exist_ok=True) + ori_img_dir = os.path.dirname(bbox_img_path).replace('bbox', 'frame_sel') + frame_idx, person_id = os.path.basename(bbox_img_path).split('.')[0].split('_') + ori_img_path = os.path.join(ori_img_dir, frame_idx + '.jpg') + xml_file = ori_img_path.replace('data', 'GT_xml').replace('frame_sel/', '').replace('.jpg', '.xml') + + tree = ET.parse(xml_file) + root = tree.getroot() + im = cv2.imread(ori_img_path) + for object in root.findall('object'): + object_name = object.find('name').text + if object_name != person_id: + continue + im_copy = im.copy() + Xmin = int(object.find('rectangle').find('xmin').text) + Ymin = int(object.find('rectangle').find('ymin').text) + Xmax = int(object.find('rectangle').find('xmax').text) + Ymax = int(object.find('rectangle').find('ymax').text) + color = (255, 0, 0) + cv2.rectangle(im_copy,(Xmin,Ymin),(Xmax,Ymax),color,3) + cv2.imwrite(bbox_img_path, im_copy) + return + + +with open(ann_file, 'r') as f: + ann_data = json.load(f) + for aitem in ann_data.values(): + image_paths = [] + image_paths.extend(aitem['query']['image_paths']) + for oitem in aitem['options']: + image_paths.extend(oitem['image_paths']) + + for image_path in image_paths: + add_bbox(image_path) diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/tf2023_preprocess.py b/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/tf2023_preprocess.py new file mode 100644 index 0000000000000000000000000000000000000000..3a10cde3a474d1b856a36b7ae23b1270334359b2 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/tf2023_preprocess.py @@ -0,0 +1,71 @@ +import json +import os +import cv2 +import numpy as np + +# replace the path with your actual path +ann_file = 'EgoExoBench/MCQ/Ego-Exo-View-Transition/ego_wearer_identification.json' + + +def add_bbox(bbox_img_path): + + bbox_dir = os.path.dirname(bbox_img_path) + os.makedirs(bbox_dir, exist_ok=True) + vid, frame_idx, person_id = bbox_img_path.split('/')[-4],bbox_img_path.split('/')[-2], bbox_img_path.split('/')[-1].split('.')[0] # noqa: E501 + import os.path as osp + json_file = os.path.join(osp.dirname(osp.dirname(osp.dirname(osp.dirname(bbox_img_path)))), vid, 'Segmentation/T', frame_idx + '.json') # noqa: E501 + ori_img_path = json_file.replace('.json', '.jpg') + + with open(json_file, mode='r', encoding="utf-8") as f: + configs = json.load(f) + shapes = configs["shapes"] + + mask = np.zeros((configs["imageHeight"], configs["imageWidth"], 1), np.uint8) + + if not os.path.exists(ori_img_path): + ori_img_path = ori_img_path.replace('T/', '') + + if not os.path.exists(ori_img_path): + ori_img_path = ori_img_path.replace('Segmentation/', 'frame/T/') + + original_image = cv2.imread(ori_img_path) + + for shape in shapes: + if shape['label'] != person_id: + continue + + cv2.fillPoly(mask, [np.array(shape["points"], np.int32)], 1) + + retval, labels, stats, centroids = cv2.connectedComponentsWithStats(mask, connectivity=8) + stats = stats[stats[:,4].argsort()] + bboxs = stats[:-1] + + for b in bboxs: + x0, y0 = b[0], b[1] + x1 = b[0] + b[2] + y1 = b[1] + b[3] + + start_point, end_point = (x0, y0), (x1, y1) + color = (0, 0, 255) + thickness = 2 + mask_bboxs = cv2.rectangle(original_image, start_point, end_point, color, thickness) + mask_bboxs = cv2.resize(mask_bboxs, (540, 360)) + cv2.imwrite(bbox_img_path, mask_bboxs) + return + + +def rescale_img(img_path, width, height): + img = cv2.imread(img_path) + resized_img = cv2.resize(img, (width, height)) + cv2.imwrite(img_path, resized_img) + + +with open(ann_file, 'r') as f: + ann_data = json.load(f) + for aitem in ann_data.values(): + image_paths = [] + for oitem in aitem['options']: + add_bbox(oitem['image_paths'][0]) + + for img_path in aitem['query']['image_paths']: + rescale_img(img_path, 960, 540) diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/utils.py b/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..6c6d85d72470132787c8db7e13fdcfe400ad8c83 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/EgoExoBench/utils.py @@ -0,0 +1,771 @@ +from ...smp import * +from ..utils.multiple_choice import extract_answer_from_item +from PIL import Image, ImageOps +import torchvision +import random +import numbers +import math +import torch +import json +import pandas as pd + + +import numpy as np +import re + + +def get_dimension_rating(data_path, category_type='subtask_type'): + data = load(data_path) + result_board = {} + for idx, item in data.iterrows(): + if item[category_type] not in result_board: + result_board[item[category_type]] = [0, 0] + result_board[item[category_type]][1] += 1 + if item['score']: + result_board[item[category_type]][0] += 1 + + correct = 0 + total = 0 + for key, value in result_board.items(): + correct += value[0] + total += value[1] + result_board[key].append(f'{value[0] / value[1] * 100:.2f}%') + + result_board['overall'] = [correct, total, f'{correct / total * 100:.2f}%'] + + return result_board + + +def extract_characters_regex(s): + s = s.strip() + answer_prefixes = [ + 'The best answer is', + 'The correct answer is', + 'The answer is', + 'The answer', + 'The best option is' + 'The correct option is', + 'Best answer:' + 'Best option:', + 'Answer:', + 'Option:', + ] + for answer_prefix in answer_prefixes: + s = s.replace(answer_prefix, '') + + if len(s.split()) > 10 and not re.search('[ABCD]', s): + return '' + matches = re.search(r'[ABCD]', s) + if matches is None: + return '' + return matches[0] + + +def extract_option(model, input_item, dataset_name): + options = input_item['question'].split('\n')[1:] + for id, option in enumerate(options): + option_id = chr(ord('A') + id) + '.' + if option.find(option_id) >= 0: + input_item[chr(ord('A') + id)] = option[option.find(option_id) + len(option_id):].strip('. \n') + return extract_answer_from_item(model, input_item, dataset_name)['opt'] + + +def process_results(score_file,model_name): + from sklearn.metrics import ( + accuracy_score, + precision_score, + recall_score, + f1_score, + classification_report, + confusion_matrix, + roc_auc_score + ) + data = pd.read_excel(score_file) + + # Create the prediction column based on the Score and Answer columns + data['prediction'] = data.apply( + lambda row: row['answer'] if row['score'] == 1 else ('Yes' if row['answer'] == 'No' else 'No'), axis=1 + ) + + # Recompute metrics for tamper types including 'original' in the calculations but exclude 'original' from the output + grouped_metrics_with_original_excluding_original = {} + + original_group = data[data['tamper_type'] == 'original'] + + for tamper_type, group in data[data['tamper_type'] != 'original'].groupby('tamper_type'): + # Combine the current group with the 'original' group + combined_group = pd.concat([group, original_group]) + + # Extract ground truth and predictions for the combined group + y_true_group = combined_group['answer'].map({'Yes': 1, 'No': 0}) + y_pred_group = combined_group['prediction'].map({'Yes': 1, 'No': 0}) + + # Calculate metrics for the combined group + accuracy = accuracy_score(y_true_group, y_pred_group) + precision = precision_score(y_true_group, y_pred_group, zero_division=0) + recall = recall_score(y_true_group, y_pred_group, zero_division=0) + f1 = f1_score(y_true_group, y_pred_group, zero_division=0) + conf_matrix = confusion_matrix(y_true_group, y_pred_group) + + # Store metrics for the tamper_type + grouped_metrics_with_original_excluding_original[tamper_type] = { + "Accuracy": accuracy, + "Precision": precision, + "Recall": recall, + "F1 Score": f1, + "Confusion Matrix": conf_matrix.tolist() # Convert to list for JSON compatibility + } + + # Add the Macro Average row to the Dictionary + # grouped_metrics_with_original_excluding_original["overall"] = macro_averages + + # Display the metrics in a dataframe for clarity + df_grouped_metrics_with_original_excluding_original = pd.DataFrame.from_dict( + grouped_metrics_with_original_excluding_original, orient='index' + ) + + # Compute Macro Averages for Accuracy, Precision, Recall, and F1 Score + macro_averages = { + "Accuracy": df_grouped_metrics_with_original_excluding_original["Accuracy"].mean(), + "Precision": df_grouped_metrics_with_original_excluding_original["Precision"].mean(), + "Recall": df_grouped_metrics_with_original_excluding_original["Recall"].mean(), + "F1 Score": df_grouped_metrics_with_original_excluding_original["F1 Score"].mean(), + "Confusion Matrix": "N/A" # Macro average doesn't have a meaningful confusion matrix + } + + # # Add the Macro Average row to the DataFrame + df_grouped_metrics_with_original_excluding_original.loc["overall"] = macro_averages + + # df_grouped_metrics_with_original_excluding_original + metrics_dict = json.loads(df_grouped_metrics_with_original_excluding_original.T.to_json()) + # Process Model Level Metrics + formatted_data = [] + for task, task_metrics in metrics_dict.items(): + task_metrics['Model'] = model_name + task_metrics['Task'] = task + formatted_data.append(task_metrics) + + df_metrics = pd.DataFrame(formatted_data) + + # Reorder columns to make 'Model' and 'Task' appear first + columns_order = ['Model', 'Task'] + [col for col in df_metrics.columns if col not in ['Model', 'Task']] + df_metrics = df_metrics[columns_order] + + return df_metrics + + +def aggregate_metrics_with_macro_average(score_file): + from sklearn.metrics import ( + accuracy_score, + precision_score, + recall_score, + f1_score, + classification_report, + confusion_matrix, + roc_auc_score + ) + # Load data + data = pd.read_excel(score_file) + + # Create the prediction column based on the Score and Answer columns + data['prediction'] = data.apply( + lambda row: row['answer'] if row['score'] == 1 else ('Yes' if row['answer'] == 'No' else 'No'), axis=1 + ) + + # Initialize a dictionary to store metrics + task_type_metrics = {} + + # Process each task_type separately + for task_type, task_group in data.groupby('task_type'): + # Separate the 'original' group for the current task_type + original_group = task_group[task_group['tamper_type'] == 'original'] + + # Skip if there is no 'original' data for this task_type + if original_group.empty: + continue + + # Process each tamper type for the current task_type (excluding 'original') + tamper_metrics = {} + for tamper_type, tamper_group in task_group[task_group['tamper_type'] != 'original'].groupby('tamper_type'): + + # Combine the tamper group with the original group of the current task_type + combined_group = pd.concat([tamper_group, original_group]) + + # Map answers and predictions to binary values + y_true = combined_group['answer'].map({'Yes': 1, 'No': 0}) + y_pred = combined_group['prediction'].map({'Yes': 1, 'No': 0}) + + # Compute metrics + accuracy = accuracy_score(y_true, y_pred) + precision = precision_score(y_true, y_pred, zero_division=0) + recall = recall_score(y_true, y_pred, zero_division=0) + f1 = f1_score(y_true, y_pred, zero_division=0) + conf_matrix = confusion_matrix(y_true, y_pred) + + # Store metrics for the tamper_type + tamper_metrics[tamper_type] = { + "Accuracy": accuracy, + "Precision": precision, + "Recall": recall, + "F1 Score": f1, + "Confusion Matrix": conf_matrix.tolist() # Convert to list for JSON compatibility + } + + # Compute Macro Averages for the current task_type + metrics_df = pd.DataFrame(tamper_metrics).T + macro_average = { + "Accuracy": metrics_df["Accuracy"].mean(), + "Precision": metrics_df["Precision"].mean(), + "Recall": metrics_df["Recall"].mean(), + "F1 Score": metrics_df["F1 Score"].mean(), + "Confusion Matrix": "N/A" # Macro average doesn't have a meaningful confusion matrix + } + + # Add the macro average as "overall" for the task_type + tamper_metrics["overall"] = macro_average + + # Add tamper metrics for the current task_type to the main dictionary + task_type_metrics[task_type] = tamper_metrics + + # Transform the nested dictionary into a DataFrame + dataframes = [] + for task_type, metrics in task_type_metrics.items(): + task_df = pd.DataFrame.from_dict(metrics, orient='index') + task_df['task_type'] = task_type # Add the task_type as a column + dataframes.append(task_df) + + # Combine all task-specific DataFrames into a single DataFrame + result_df = pd.concat(dataframes).reset_index().rename(columns={'index': 'tamper_type'}) + # Reorder the columns to place task_type first, then tamper_type + result_df = result_df[['task_type', 'tamper_type', 'Accuracy', 'Precision', 'Recall', + 'F1 Score', 'Confusion Matrix']] + + # Select only numeric columns for aggregation + numeric_columns = ['Accuracy', 'Precision', 'Recall', 'F1 Score'] + + # Group by task_type and tamper_type, and calculate the mean for numeric columns + average_metrics = result_df.groupby(['task_type', 'tamper_type'])[numeric_columns].mean().reset_index() + + return average_metrics + + +def check_ans(pred, gt): + """ + Checks if the predicted answer matches the ground truth. + + Args: + pred (str): The predicted answer. + gt (str): The ground truth answer. + + Returns: + bool: True if the predicted answer matches the ground truth, False otherwise. + """ + # Convert both predictions and ground truths to lowercase and split them into options and contents + flag = False + + # Split prediction into option and content + pred_list = pred.lower().strip().split(' ') + pred_option, _ = pred_list[0], ' '.join(pred_list[1:]) + + # Split ground truth into option and content + gt_list = gt.lower().strip().split(' ') + gt_option, gt_content = gt_list[0], ' '.join(gt_list[1:]) + + # Remove trailing period from ground truth content if present + if gt_content[-1] == '.': + gt_content = gt_content[:-1] + + # Check for matching conditions + # Condition 1: If the predicted option is a substring of the ground truth option + if pred_option.replace('.', '') in gt_option: + flag = True + # Condition 2: If the ground truth option is a substring of the predicted option + elif gt_option in pred_option: + flag = True + # Condition 3: If the ground truth is a substring of the predicted answer + elif gt in pred: + flag = True + + return flag + + +def check_ans_with_model(pred, gt, model, item, dataset_name='MVBench'): + """ + Checks if the predicted answer matches the ground truth using a given model. + + Args: + pred (str): The predicted answer. + gt (str): The ground truth answer. + model: A machine learning model used for additional verification. + item (dict): An item containing information about the question or task. + dataset_name (str, optional): Name of the dataset being used. Defaults to 'MVBench'. + + Returns: + bool: True if the predicted answer matches the ground truth, False otherwise. + """ + # Initialize flag to track match status + flag = False + + # Preprocess prediction and ground truth by converting to lowercase and splitting into options and contents + pred_list = pred.lower().strip().split(' ') + pred_option, _ = pred_list[0], ' '.join(pred_list[1:]) + gt_list = gt.lower().strip().split(' ') + gt_option, gt_content = gt_list[0], ' '.join(gt_list[1:]) + + # Remove trailing period from ground truth content if presen + if gt_content[-1] == '.': + gt_content = gt_content[:-1] + + # Check for matching conditions + # Condition 1: If the predicted option is a substring of the ground truth option + if pred_option.replace('.', '') in gt_option: + flag = True + # Condition 2: If the ground truth option is a substring of the predicted option + elif gt_option in pred_option: + flag = True + # Condition 3: Use the provided model to verify the answer + elif extract_answer_from_item(model, item, dataset_name)['opt'] == item['answer']: + flag = True + + return flag + + +def check_ans_advanced(pred, gt): + number_table = { + 0: 'zero', + 1: 'one', + 2: 'two', + 3: 'three', + 4: 'four', + 5: 'five', + 6: 'six', + 7: 'seven', + 8: 'eight', + 9: 'nine', + } + flag = False + + pred_list = pred.lower().split(' ') + pred_option, _ = pred_list[0], ' '.join(pred_list[1:]) + gt_list = gt.lower().split(' ') + gt_option, gt_content = gt_list[0], ' '.join(gt_list[1:]) + if gt_content[-1] == '.': + gt_content = gt_content[:-1] + + try: + gt_content = number_table[int(gt_content.strip('. \n'))] + print(gt_content) + except: + pass + + if pred_option.replace('.', '') in gt_option: + flag = True + elif gt_option in pred_option: + flag = True + elif gt_content.lower().strip('. \n') in pred.lower().strip('. \n'): + flag = True + + return flag + + +class GroupRandomCrop(object): + def __init__(self, size): + if isinstance(size, numbers.Number): + self.size = (int(size), int(size)) + else: + self.size = size + + def __call__(self, img_group): + + w, h = img_group[0].size + th, tw = self.size + + out_images = list() + + x1 = random.randint(0, w - tw) + y1 = random.randint(0, h - th) + + for img in img_group: + assert (img.size[0] == w and img.size[1] == h) + if w == tw and h == th: + out_images.append(img) + else: + out_images.append(img.crop((x1, y1, x1 + tw, y1 + th))) + + return out_images + + +class MultiGroupRandomCrop(object): + def __init__(self, size, groups=1): + if isinstance(size, numbers.Number): + self.size = (int(size), int(size)) + else: + self.size = size + self.groups = groups + + def __call__(self, img_group): + + w, h = img_group[0].size + th, tw = self.size + + out_images = list() + + for i in range(self.groups): + x1 = random.randint(0, w - tw) + y1 = random.randint(0, h - th) + + for img in img_group: + assert (img.size[0] == w and img.size[1] == h) + if w == tw and h == th: + out_images.append(img) + else: + out_images.append(img.crop((x1, y1, x1 + tw, y1 + th))) + + return out_images + + +class GroupCenterCrop(object): + def __init__(self, size): + self.worker = torchvision.transforms.CenterCrop(size) + + def __call__(self, img_group): + return [self.worker(img) for img in img_group] + + +class GroupRandomHorizontalFlip(object): + """Randomly horizontally flips the given PIL.Image with a probability of 0.5 + """ + + def __init__(self, is_flow=False): + self.is_flow = is_flow + + def __call__(self, img_group, is_flow=False): + v = random.random() + if v < 0.5: + ret = [img.transpose(Image.FLIP_LEFT_RIGHT) for img in img_group] + if self.is_flow: + for i in range(0, len(ret), 2): + # invert flow pixel values when flipping + ret[i] = ImageOps.invert(ret[i]) + return ret + else: + return img_group + + +class GroupNormalize(object): + def __init__(self, mean, std): + self.mean = mean + self.std = std + + def __call__(self, tensor): + rep_mean = self.mean * (tensor.size()[0] // len(self.mean)) + rep_std = self.std * (tensor.size()[0] // len(self.std)) + + # TODO: make efficient + for t, m, s in zip(tensor, rep_mean, rep_std): + t.sub_(m).div_(s) + + return tensor + + +class GroupScale(object): + """ Rescales the input PIL.Image to the given 'size'. + 'size' will be the size of the smaller edge. + For example, if height > width, then image will be + rescaled to (size * height / width, size) + size: size of the smaller edge + interpolation: Default: PIL.Image.BILINEAR + """ + + def __init__(self, size, interpolation=Image.BILINEAR): + self.worker = torchvision.transforms.Resize(size, interpolation) + + def __call__(self, img_group): + return [self.worker(img) for img in img_group] + + +class GroupOverSample(object): + def __init__(self, crop_size, scale_size=None, flip=True): + self.crop_size = crop_size if not isinstance( + crop_size, int) else (crop_size, crop_size) + + if scale_size is not None: + self.scale_worker = GroupScale(scale_size) + else: + self.scale_worker = None + self.flip = flip + + def __call__(self, img_group): + + if self.scale_worker is not None: + img_group = self.scale_worker(img_group) + + image_w, image_h = img_group[0].size + crop_w, crop_h = self.crop_size + + offsets = GroupMultiScaleCrop.fill_fix_offset( + False, image_w, image_h, crop_w, crop_h) + oversample_group = list() + for o_w, o_h in offsets: + normal_group = list() + flip_group = list() + for i, img in enumerate(img_group): + crop = img.crop((o_w, o_h, o_w + crop_w, o_h + crop_h)) + normal_group.append(crop) + flip_crop = crop.copy().transpose(Image.FLIP_LEFT_RIGHT) + + if img.mode == 'L' and i % 2 == 0: + flip_group.append(ImageOps.invert(flip_crop)) + else: + flip_group.append(flip_crop) + + oversample_group.extend(normal_group) + if self.flip: + oversample_group.extend(flip_group) + return oversample_group + + +class GroupFullResSample(object): + def __init__(self, crop_size, scale_size=None, flip=True): + self.crop_size = crop_size if not isinstance( + crop_size, int) else (crop_size, crop_size) + + if scale_size is not None: + self.scale_worker = GroupScale(scale_size) + else: + self.scale_worker = None + self.flip = flip + + def __call__(self, img_group): + + if self.scale_worker is not None: + img_group = self.scale_worker(img_group) + + image_w, image_h = img_group[0].size + crop_w, crop_h = self.crop_size + + w_step = (image_w - crop_w) // 4 + h_step = (image_h - crop_h) // 4 + + offsets = list() + offsets.append((0 * w_step, 2 * h_step)) # left + offsets.append((4 * w_step, 2 * h_step)) # right + offsets.append((2 * w_step, 2 * h_step)) # center + + oversample_group = list() + for o_w, o_h in offsets: + normal_group = list() + flip_group = list() + for i, img in enumerate(img_group): + crop = img.crop((o_w, o_h, o_w + crop_w, o_h + crop_h)) + normal_group.append(crop) + if self.flip: + flip_crop = crop.copy().transpose(Image.FLIP_LEFT_RIGHT) + + if img.mode == 'L' and i % 2 == 0: + flip_group.append(ImageOps.invert(flip_crop)) + else: + flip_group.append(flip_crop) + + oversample_group.extend(normal_group) + oversample_group.extend(flip_group) + return oversample_group + + +class GroupMultiScaleCrop(object): + + def __init__(self, input_size, scales=None, max_distort=1, + fix_crop=True, more_fix_crop=True): + self.scales = scales if scales is not None else [1, .875, .75, .66] + self.max_distort = max_distort + self.fix_crop = fix_crop + self.more_fix_crop = more_fix_crop + self.input_size = input_size if not isinstance(input_size, int) else [ + input_size, input_size] + self.interpolation = Image.BILINEAR + + def __call__(self, img_group): + + im_size = img_group[0].size + + crop_w, crop_h, offset_w, offset_h = self._sample_crop_size(im_size) + crop_img_group = [ + img.crop( + (offset_w, + offset_h, + offset_w + crop_w, + offset_h + crop_h)) for img in img_group] + ret_img_group = [img.resize((self.input_size[0], self.input_size[1]), self.interpolation) + for img in crop_img_group] + return ret_img_group + + def _sample_crop_size(self, im_size): + image_w, image_h = im_size[0], im_size[1] + + # find a crop size + base_size = min(image_w, image_h) + crop_sizes = [int(base_size * x) for x in self.scales] + crop_h = [ + self.input_size[1] if abs( + x - self.input_size[1]) < 3 else x for x in crop_sizes] + crop_w = [ + self.input_size[0] if abs( + x - self.input_size[0]) < 3 else x for x in crop_sizes] + + pairs = [] + for i, h in enumerate(crop_h): + for j, w in enumerate(crop_w): + if abs(i - j) <= self.max_distort: + pairs.append((w, h)) + + crop_pair = random.choice(pairs) + if not self.fix_crop: + w_offset = random.randint(0, image_w - crop_pair[0]) + h_offset = random.randint(0, image_h - crop_pair[1]) + else: + w_offset, h_offset = self._sample_fix_offset( + image_w, image_h, crop_pair[0], crop_pair[1]) + + return crop_pair[0], crop_pair[1], w_offset, h_offset + + def _sample_fix_offset(self, image_w, image_h, crop_w, crop_h): + offsets = self.fill_fix_offset( + self.more_fix_crop, image_w, image_h, crop_w, crop_h) + return random.choice(offsets) + + @staticmethod + def fill_fix_offset(more_fix_crop, image_w, image_h, crop_w, crop_h): + w_step = (image_w - crop_w) // 4 + h_step = (image_h - crop_h) // 4 + + ret = list() + ret.append((0, 0)) # upper left + ret.append((4 * w_step, 0)) # upper right + ret.append((0, 4 * h_step)) # lower left + ret.append((4 * w_step, 4 * h_step)) # lower right + ret.append((2 * w_step, 2 * h_step)) # center + + if more_fix_crop: + ret.append((0, 2 * h_step)) # center left + ret.append((4 * w_step, 2 * h_step)) # center right + ret.append((2 * w_step, 4 * h_step)) # lower center + ret.append((2 * w_step, 0 * h_step)) # upper center + + ret.append((1 * w_step, 1 * h_step)) # upper left quarter + ret.append((3 * w_step, 1 * h_step)) # upper right quarter + ret.append((1 * w_step, 3 * h_step)) # lower left quarter + ret.append((3 * w_step, 3 * h_step)) # lower righ quarter + + return ret + + +class GroupRandomSizedCrop(object): + """Random crop the given PIL.Image to a random size of (0.08 to 1.0) of the original size + and and a random aspect ratio of 3/4 to 4/3 of the original aspect ratio + This is popularly used to train the Inception networks + size: size of the smaller edge + interpolation: Default: PIL.Image.BILINEAR + """ + + def __init__(self, size, interpolation=Image.BILINEAR): + self.size = size + self.interpolation = interpolation + + def __call__(self, img_group): + for attempt in range(10): + area = img_group[0].size[0] * img_group[0].size[1] + target_area = random.uniform(0.08, 1.0) * area + aspect_ratio = random.uniform(3. / 4, 4. / 3) + + w = int(round(math.sqrt(target_area * aspect_ratio))) + h = int(round(math.sqrt(target_area / aspect_ratio))) + + if random.random() < 0.5: + w, h = h, w + + if w <= img_group[0].size[0] and h <= img_group[0].size[1]: + x1 = random.randint(0, img_group[0].size[0] - w) + y1 = random.randint(0, img_group[0].size[1] - h) + found = True + break + else: + found = False + x1 = 0 + y1 = 0 + + if found: + out_group = list() + for img in img_group: + img = img.crop((x1, y1, x1 + w, y1 + h)) + assert (img.size == (w, h)) + out_group.append( + img.resize( + (self.size, self.size), self.interpolation)) + return out_group + else: + # Fallback + scale = GroupScale(self.size, interpolation=self.interpolation) + crop = GroupRandomCrop(self.size) + return crop(scale(img_group)) + + +class ConvertDataFormat(object): + def __init__(self, model_type): + self.model_type = model_type + + def __call__(self, images): + if self.model_type == '2D': + return images + tc, h, w = images.size() + t = tc // 3 + images = images.view(t, 3, h, w) + images = images.permute(1, 0, 2, 3) + return images + + +class Stack(object): + + def __init__(self, roll=False): + self.roll = roll + + def __call__(self, img_group): + if img_group[0].mode == 'L': + return np.concatenate([np.expand_dims(x, 2) + for x in img_group], axis=2) + elif img_group[0].mode == 'RGB': + if self.roll: + return np.concatenate([np.array(x)[:, :, ::-1] + for x in img_group], axis=2) + else: + # print(np.concatenate(img_group, axis=2).shape) + # print(img_group[0].shape) + return np.concatenate(img_group, axis=2) + + +class ToTorchFormatTensor(object): + """ Converts a PIL.Image (RGB) or numpy.ndarray (H x W x C) in the range [0, 255] + to a torch.FloatTensor of shape (C x H x W) in the range [0.0, 1.0] """ + + def __init__(self, div=True): + self.div = div + + def __call__(self, pic): + if isinstance(pic, np.ndarray): + # handle numpy array + img = torch.from_numpy(pic).permute(2, 0, 1).contiguous() + else: + # handle PIL Image + img = torch.ByteTensor( + torch.ByteStorage.from_buffer( + pic.tobytes())) + img = img.view(pic.size[1], pic.size[0], len(pic.mode)) + # put it from HWC to CHW format + # yikes, this transpose takes 80% of the loading time/CPU + img = img.transpose(0, 1).transpose(0, 2).contiguous() + return img.float().div(255) if self.div else img.float() + + +class IdentityTransform(object): + + def __call__(self, data): + return data diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__init__.py b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__pycache__/__init__.cpython-310.pyc b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af3a960ea90697582e4c50fb3e3d84d77dbf4621 Binary files /dev/null and b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__pycache__/__init__.cpython-310.pyc differ diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__pycache__/screenspot_pro.cpython-310.pyc b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__pycache__/screenspot_pro.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9f312932f668f0d3cb407493a89cb6747392164 Binary files /dev/null and b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__pycache__/screenspot_pro.cpython-310.pyc differ diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__pycache__/screenspot_v2.cpython-310.pyc b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__pycache__/screenspot_v2.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7bed7033a1c57e267775b0cfaa5f00e6566d10fd Binary files /dev/null and b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/__pycache__/screenspot_v2.cpython-310.pyc differ diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/GUI/screenspot.py b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/screenspot.py new file mode 100644 index 0000000000000000000000000000000000000000..842d61ad0da26c52bd23b864eee46af300ea8760 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/screenspot.py @@ -0,0 +1,461 @@ +import os +import re +import tempfile +import itertools +from functools import partial + +import pandas as pd +import ast + +from ..image_base import ImageBaseDataset, img_root_map +from ..utils import build_judge, DEBUG_MESSAGE +from ...smp import * +from ...utils import track_progress_rich +from ipdb import set_trace as st + +logger = get_logger("RUN") + +""" +{ + "img_filename": "web_3b0ad239-da6b-4f6f-8f12-f674dc90ff33.png", + "bbox": [42, 1102, 197, 70], + "question": "view the details of the item", + "data_type": "text", + "data_source": "shop" +}, +{ + "img_filename": "web_3b0ad239-da6b-4f6f-8f12-f674dc90ff33.png", + "bbox": [93, 74, 86, 132], + "question": "view the previous photo", + "data_type": "icon", + "data_source": "shop" +} +""" + +SYSTEM_PROMPT = """You are a GUI agent. You are given a task and a screenshot of the screen. You need to perform pyautogui click/moveTo action to complete the task. The answer format is `pyautogui.click(x=?, y=?), x and y is necessary`""" # noqa: E501 + +USER_INSTRUCTION = """Please complete the following tasks by clicking using `pyautogui.click`:\n{instruction}""" + +SYSTEM_PROMPT_V2 = """You are a GUI agent. You are given a screenshot of the screen and the description of a target element. You need to click the target element using `pyautogui.click`. The answer format is `pyautogui.click(x=?, y=?), x and y is necessary`""" # noqa: E501 +USER_INSTRUCTION_V2 = """Please click the following target element using `pyautogui.click`:\n{description}""" + + +def parse_bbox_aguvis(response): + match = re.search(r"x=([\d.]+), y=([\d.]+)", response) + if match: + click_point = [float(match.group(1)), float(match.group(2))] + else: + click_point = [0.0, 0.0] + return click_point + + +def compute_iou(box1, box2): + """ + Compute the Intersection over Union (IoU) of two bounding boxes. + + Parameters: + - box1 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + - box2 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + + Returns: + - float: IoU of box1 and box2. + """ + # Determine the coordinates of the intersection rectangle + x_left = max(box1[0], box2[0]) + y_top = max(box1[1], box2[1]) + x_right = min(box1[2], box2[2]) + y_bottom = min(box1[3], box2[3]) + + # Compute the area of intersection + intersection_area = max(0, x_right - x_left) * max(0, y_bottom - y_top) + + # Compute the area of both bounding boxes + box1_area = (box1[2] - box1[0]) * (box1[3] - box1[1]) + box2_area = (box2[2] - box2[0]) * (box2[3] - box2[1]) + + # Compute the area of the union + union_area = box1_area + box2_area - intersection_area + + # Compute the Intersection over Union + iou = intersection_area / union_area + + return iou + + +def compute_accuracy(box1, box2, threshold=0.5): + """ + Compute the accuracy of two bounding boxes based on a specified threshold. + + Parameters: + - box1 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + - box2 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + - threshold (float): Threshold for the IoU to consider the prediction correct. + + Returns: + - float: Accuracy of the prediction based on the IoU threshold. + """ + iou = compute_iou(box1, box2) + return iou >= threshold + + +def compute_center_accuracy(box1, box2): + """ + Compute if the center point of box 2 is within box 1. + + Parameters: + - box1 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + - box2 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + + Returns: + - bool: True if the center point of box 2 is within box 1, False otherwise. + """ + # Compute the center point of box 2 + center_x = (box2[0] + box2[2]) / 2 + center_y = (box2[1] + box2[3]) / 2 + + # Check if the center point is within box 1 + return box1[0] <= center_x <= box1[2] and box1[1] <= center_y <= box1[3] + + +def convert_bbox(bbox, image_path): + new_bbox = bbox if isinstance(bbox, list) else ast.literal_eval(bbox) + new_bbox = [ + new_bbox[0], + new_bbox[1], + new_bbox[0] + new_bbox[2], + new_bbox[1] + new_bbox[3], + ] + image = Image.open(image_path) + img_size = image.size + new_bbox = [ + new_bbox[0] / img_size[0], + new_bbox[1] / img_size[1], + new_bbox[2] / img_size[0], + new_bbox[3] / img_size[1], + ] + return new_bbox + + +class ScreenSpot(ImageBaseDataset): + MODALITY = "IMAGE" + TYPE = "GUI" + DATASET_URL = { + "ScreenSpot_Mobile": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot/ScreenSpot_Mobile.tsv", # noqa + "ScreenSpot_Desktop": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot/ScreenSpot_Desktop.tsv", # noqa + "ScreenSpot_Web": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot/ScreenSpot_Web.tsv", # noqa + "ScreenSpot_v2_Mobile": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot_v2/ScreenSpot_v2_Mobile.tsv", # noqa + "ScreenSpot_v2_Desktop": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot_v2/ScreenSpot_v2_Desktop.tsv", # noqa + "ScreenSpot_v2_Web": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot_v2/ScreenSpot_v2_Web.tsv", # noqa + } # path + DATASET_URL_V2 = { + "ScreenSpot_Mobile": "$WORK_DIR/screenspot_mobile_ug.json", + "ScreenSpot_Desktop": "$WORK_DIR/screenspot_desktop_ug.json", + "ScreenSpot_Web": "$WORK_DIR/screenspot_web_ug.json", + } # path + DATASET_MD5 = { + "ScreenSpot_Mobile": "a5b5299843a75c9b9574c47bc13b2c53", + "ScreenSpot_Desktop": "e6e7bac21b6b2475276404fce2458132", + "ScreenSpot_Web": "e51d168c14b8582427cf3107d236cfc5", + "ScreenSpot_v2_Mobile": "234c858ab4f0e787e8388a73df65a4b7", + "ScreenSpot_v2_Desktop": "5f2aa2a497327bd33b2512a0c75cf994", + "ScreenSpot_v2_Web": "01cd0877ee1b735a6d5190b053ba9482", + } + EVAL_TYPE = "point" # point or rectangle + RE_TYPE = "functional" # type of referring expressions: functional or composite + + def __init__( + self, + dataset="ScreenSpot_Mobile", + skip_noimg=True, + skeleton=False, + re_type="functional", + ): + # st() + ROOT = LMUDataRoot() + # You can override this variable to save image files to a different directory + self.dataset_name = dataset + self.img_root = osp.join(ROOT, "images", self.dataset_name) + self.RE_TYPE = re_type + if skeleton: + return + + data = self.load_data(dataset) + self.skip_noimg = skip_noimg + if skip_noimg and "image" in data: + data = data[~pd.isna(data["image"])] + + self.meta_only = True + self.parse_response_func = parse_bbox_aguvis # TODO: parse function can be specified through kwargs when initializing the dataset # noqa: E501 + + # The image field can store the base64 encoded image or another question index (for saving space) + if "image" in data: + data["image"] = [str(x) for x in data["image"]] + image_map = {x: y for x, y in zip(data["index"], data["image"])} + for k in image_map: + if len(image_map[k]) <= 64: + idx = image_map[k] + assert idx in image_map and len(image_map[idx]) > 64 + image_map[k] = image_map[idx] + + images = [toliststr(image_map[k]) for k in data["index"]] + data["image"] = [x[0] if len(x) == 1 else x for x in images] + self.meta_only = False + + self.data = data + + def prepare_tsv(self, url, file_md5=None): + # st() + if self.RE_TYPE == "functional": + return super().prepare_tsv(url=url, file_md5=file_md5) + else: + data_path = self.DATASET_URL_V2[self.dataset_name] + return pd.DataFrame(load(data_path)) + + @classmethod + def get_action_space(self): + return "" + + @classmethod + def get_trajectory(self, line): + traj_dict = {} + if self.RE_TYPE == "functional": + traj_dict["task"] = line["question"] + else: + traj_dict["task"] = line["description"] + return traj_dict + + def build_prompt(self, line): + # st() + if isinstance(line, int): + line = self.data.iloc[line] + tgt_path = self.dump_image(line) + + if self.RE_TYPE == "functional": + user_instruction = USER_INSTRUCTION.format(instruction=line["question"]) + else: + user_instruction = USER_INSTRUCTION_V2.format( + description=line["description"] + ) + + msgs = [] + # add system prompt + if self.RE_TYPE == "functional": + msgs.append(dict(role="system", type="text", value=SYSTEM_PROMPT)) + else: + msgs.append(dict(role="system", type="text", value=SYSTEM_PROMPT_V2)) + if isinstance(tgt_path, list): + msgs.extend([dict(type="image", value=p) for p in tgt_path]) + else: + msgs = [dict(type="image", value=tgt_path)] + msgs.append(dict(type="text", value=user_instruction)) + return msgs + + def evaluate(self, eval_file, **judge_kwargs): + # st() + if self.EVAL_TYPE == "point": + return self.evaluate_point(eval_file, **judge_kwargs) + + elif self.EVAL_TYPE == "rectangle": + return self.evaluate_rectangle(eval_file, **judge_kwargs) + + def evaluate_rectangle(self, eval_file, **judge_kwargs): + scorers = { + "IoU": compute_iou, + "ACC@0.1": lambda x, y: compute_accuracy(x, y, 0.1), + "ACC@0.3": lambda x, y: compute_accuracy(x, y, 0.3), + "ACC@0.5": lambda x, y: compute_accuracy(x, y, 0.5), + "ACC@0.7": lambda x, y: compute_accuracy(x, y, 0.7), + "ACC@0.9": lambda x, y: compute_accuracy(x, y, 0.9), + "Center_ACC": compute_center_accuracy, + } + results_dict = {} + for key in scorers.keys(): + results_dict.update( + { + key: [], + key + "_text": [], + key + "_icon": [], + } + ) + + result = [] + data = load(eval_file) + + assert "bbox" in data and "prediction" in data + lt = len(data) + lines = [data.iloc[i] for i in range(lt)] + for i in tqdm(range(len(lines))): + line = lines[i] + bbox = convert_bbox( + line["bbox"], os.path.join(self.img_root, line["image_path"]) + ) + prediction = str(line["prediction"]) + try: + click_point = parse_bbox_aguvis(prediction) + + match = {} + for score_key, score_value in scorers.items(): + score = score_value(bbox, click_point) + if score_key != "IoU": + match[score_key.replace("ACC", "match")] = score + results_dict[score_key].append(score) + if line["data_type"] == "text": + results_dict[score_key + "_text"].append(score) + else: + results_dict[score_key + "_icon"].append(score) + except: + click_point = None + match = {score_key: False for score_key in scorers.keys() if score_key != "IoU"} + result.append( + { + "img_path": os.path.join(self.img_root, line["image_path"]), + "text": line["question"], + "bbox": line["bbox"], + "parsed_bbox": bbox, + "type": line["data_type"], + "source": line["data_source"], + "pred": click_point, + "num_matched": sum(match.values()), + **match, + } + ) + for key in results_dict: + if len(results_dict[key]) == 0: + results_dict[key] = str(0) + else: + results_dict[key] = str(sum(results_dict[key]) / len(results_dict[key])) + score_pth = get_intermediate_file_path(eval_file, '_score', 'json') + dump(results_dict, score_pth) + + failure_cases_path = os.environ.get("FAILURE_CASES_PATH", None) + if failure_cases_path is not None: + failure_cases = [res for res in result if not res["match"] and res["is_wrong_format"]] + failure_cases.sort(key=lambda r: r["num_matched"], reverse=True) + + with open(failure_cases_path, "w") as f: + json.dump(failure_cases, f, indent=4, ensure_ascii=False) + return results_dict + + def evaluate_point(self, eval_file, **judge_kwargs): + # -1: format_err, 0: wrong, 1: correct + stats = defaultdict(list) + # Will include instance-level results + result = [] + + data = load(eval_file) + assert "bbox" in data and "prediction" in data + lt = len(data) + lines = [data.iloc[i] for i in range(lt)] + for i in tqdm(range(len(lines))): + line = lines[i] + bbox = ( + line["bbox"] + if isinstance(line["bbox"], list) + else ast.literal_eval(line["bbox"]) + ) + # The format of bbox is (x1, y1, w, h) + x1, y1, w, h = bbox + bbox = (x1, y1, x1 + w - 1, y1 + h - 1) + + image = Image.open(os.path.join(self.img_root, line["image_path"])) + img_size = image.size + + def make_safe(value): + if value == -1: + # we can tolerate -1 as a special value and nomalize it to 0 + return 0 + else: + return value + + bbox = [ + make_safe(bbox[0]) / img_size[0], + make_safe(bbox[1]) / img_size[1], + make_safe(bbox[2]) / img_size[0], + make_safe(bbox[3]) / img_size[1], + ] + + if any([x < 0 or x > 1 for x in bbox]): + raise ValueError(f"bbox out of range: {bbox} | {line['bbox']} | {img_size}") + + key = line['data_type'] if 'category' not in line else line['category'] + ":" + line['data_type'] + prediction = str(line["prediction"]) + try: + click_point = parse_bbox_aguvis(prediction) + # Do Normalization By Default + if click_point[0] > 1 or click_point[1] > 1: + click_point = (click_point[0] / img_size[0], click_point[1] / img_size[1]) + + match = (bbox[0] <= click_point[0] <= bbox[2]) and \ + (bbox[1] <= click_point[1] <= bbox[3]) + + if match: + stats[key].append(1) + else: + stats[key].append(0) + is_wrong_format = False + + except Exception as e: + logger.warning(f"exception in screenspot eval:{e}") + stats[key].append(-1) + match, is_wrong_format, click_point = False, True, None + + result.append( + { + "img_path": os.path.join(self.img_root, line["image_path"]), + "text": line["question"], + "bbox": line["bbox"], + "parsed_bbox": bbox, + "type": line["data_type"], + "source": line["data_source"], + "match": match, + "is_wrong_format": is_wrong_format, + "pred": click_point, + } + ) + + final_score_dict = {} + # Record the number of each category + final_score_dict.update({k + ':cnt': len(stats[k]) for k in stats}) + # Calculate the Overall stats + full_stats = [] + for v in stats.values(): + full_stats.extend(v) + final_score_dict['Overall_Accuracy'] = np.mean([x > 0 for x in full_stats]) * 100 + final_score_dict['Format_Err_Rate'] = np.mean([x < 0 for x in full_stats]) * 100 + # Calculate the Accuracy of Text / Icon + text_stats = [v for k, v in stats.items() if k.endswith('text') for x in v] + text_stats = itertools.chain(*text_stats) + final_score_dict['Text_Accuracy'] = np.mean([x > 0 for x in text_stats]) * 100 + icon_stats = [v for k, v in stats.items() if k.endswith('icon') for x in v] + icon_stats = itertools.chain(*icon_stats) + final_score_dict['Icon_Accuracy'] = np.mean([x > 0 for x in icon_stats]) * 100 + # Calculate the Accuracy of Each Category + if 'category' in data: + cates = list(set(data['category'])) + for c in cates: + sub_stats = [v for k, v in stats.items() if k.split(":")[0] == c for x in v] + sub_stats = itertools.chain(*sub_stats) + final_score_dict[c + '_Accuracy'] = np.mean([x > 0 for x in sub_stats]) * 100 + + score_pth = get_intermediate_file_path(eval_file, '_score', 'json') + dump(final_score_dict, score_pth) + + failure_cases_path = os.environ.get("FAILURE_CASES_PATH", None) + if failure_cases_path is not None: + def click_distance(bbox, click_point): + x, y = click_point + x1, y1, x2, y2 = bbox + xc, yc = (x1 + x2) / 2, (y1 + y2) / 2 + w, h = x2 - x1, y2 - y1 + abs_shift_to_center = [abs(x - xc), abs(y - yc)] # noqa: E501 + width_outside, height_outside = [max(0, abs_shift_to_center[0] - w / 2), max(0, abs_shift_to_center[1] - h / 2)] # noqa: E501 + return (width_outside ** 2 + height_outside ** 2) ** 0.5 # noqa: E501 + + wrong_format_result = [res for res in result if res["is_wrong_format"]] + missed_result = [res for res in result if not res["match"] and not res["is_wrong_format"]] + missed_result.sort(key=lambda r: click_distance(r["parsed_bbox"], r["pred"]), reverse=True) + failure_cases = wrong_format_result + missed_result + + with open(failure_cases_path, "w") as f: + json.dump(failure_cases, f, indent=4, ensure_ascii=False) + return final_score_dict diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/GUI/screenspot_pro.py b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/screenspot_pro.py new file mode 100644 index 0000000000000000000000000000000000000000..c926a29c28b3c6053017d330873e4fb790ad5138 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/GUI/screenspot_pro.py @@ -0,0 +1,460 @@ +import os +import re +import tempfile +import itertools +from functools import partial + +import pandas as pd +import ast + +from ..image_base import ImageBaseDataset, img_root_map +from ..utils import build_judge, DEBUG_MESSAGE +from ...smp import * +from ...utils import track_progress_rich +from ipdb import set_trace as st + +logger = get_logger("RUN") + +""" +{ + "img_filename": "web_3b0ad239-da6b-4f6f-8f12-f674dc90ff33.png", + "bbox": [42, 1102, 197, 70], + "question": "view the details of the item", + "data_type": "text", + "data_source": "shop" +}, +{ + "img_filename": "web_3b0ad239-da6b-4f6f-8f12-f674dc90ff33.png", + "bbox": [93, 74, 86, 132], + "question": "view the previous photo", + "data_type": "icon", + "data_source": "shop" +} +""" + +SYSTEM_PROMPT = """You are a GUI agent. You are given a task and a screenshot of the screen. You need to perform pyautogui click/moveTo action to complete the task. The answer format is `pyautogui.click(x=?, y=?), x and y is necessary`""" # noqa: E501 + +USER_INSTRUCTION = """Please complete the following tasks by clicking using `pyautogui.click`:\n{instruction}""" # noqa: E501 + +SYSTEM_PROMPT_V2 = """You are a GUI agent. You are given a screenshot of the screen and the description of a target element. You need to click the target element using `pyautogui.click`. The answer format is `pyautogui.click(x=?, y=?), x and y is necessary`""" # noqa: E501 +USER_INSTRUCTION_V2 = """Please click the following target element using `pyautogui.click`:\n{description}""" + + +def parse_bbox_aguvis(response): + match = re.search(r"x=([\d.]+), y=([\d.]+)", response) + if match: + click_point = [float(match.group(1)), float(match.group(2))] + else: + click_point = [0.0, 0.0] + return click_point + + +def compute_iou(box1, box2): + """ + Compute the Intersection over Union (IoU) of two bounding boxes. + + Parameters: + - box1 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + - box2 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + + Returns: + - float: IoU of box1 and box2. + """ + # Determine the coordinates of the intersection rectangle + x_left = max(box1[0], box2[0]) + y_top = max(box1[1], box2[1]) + x_right = min(box1[2], box2[2]) + y_bottom = min(box1[3], box2[3]) + + # Compute the area of intersection + intersection_area = max(0, x_right - x_left) * max(0, y_bottom - y_top) + + # Compute the area of both bounding boxes + box1_area = (box1[2] - box1[0]) * (box1[3] - box1[1]) + box2_area = (box2[2] - box2[0]) * (box2[3] - box2[1]) + + # Compute the area of the union + union_area = box1_area + box2_area - intersection_area + + # Compute the Intersection over Union + iou = intersection_area / union_area + + return iou + + +def compute_accuracy(box1, box2, threshold=0.5): + """ + Compute the accuracy of two bounding boxes based on a specified threshold. + + Parameters: + - box1 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + - box2 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + - threshold (float): Threshold for the IoU to consider the prediction correct. + + Returns: + - float: Accuracy of the prediction based on the IoU threshold. + """ + iou = compute_iou(box1, box2) + return iou >= threshold + + +def compute_center_accuracy(box1, box2): + """ + Compute if the center point of box 2 is within box 1. + + Parameters: + - box1 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + - box2 (list of float): Bounding box [x_min, y_min, x_max, y_max]. + + Returns: + - bool: True if the center point of box 2 is within box 1, False otherwise. + """ + # Compute the center point of box 2 + center_x = (box2[0] + box2[2]) / 2 + center_y = (box2[1] + box2[3]) / 2 + + # Check if the center point is within box 1 + return box1[0] <= center_x <= box1[2] and box1[1] <= center_y <= box1[3] + + +def convert_bbox(bbox, image_path, convert_xywh_to_x1y1x2y2=True): + new_bbox = bbox if isinstance(bbox, list) else ast.literal_eval(bbox) + if convert_xywh_to_x1y1x2y2: + new_bbox = [ + new_bbox[0], + new_bbox[1], + new_bbox[0] + new_bbox[2], + new_bbox[1] + new_bbox[3], + ] + image = Image.open(image_path) + img_size = image.size + new_bbox = [ + new_bbox[0] / img_size[0], + new_bbox[1] / img_size[1], + new_bbox[2] / img_size[0], + new_bbox[3] / img_size[1], + ] + return new_bbox + + +class ScreenSpot_Pro(ImageBaseDataset): + MODALITY = "IMAGE" + TYPE = "GUI" + DATASET_URL = { + "ScreenSpot_Pro_Development": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot_Pro/ScreenSpot_Pro_Development.tsv", # noqa + "ScreenSpot_Pro_Creative": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot_Pro/ScreenSpot_Pro_Creative.tsv", # noqa + "ScreenSpot_Pro_CAD": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot_Pro/ScreenSpot_Pro_CAD.tsv", # noqa + "ScreenSpot_Pro_Scientific": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot_Pro/ScreenSpot_Pro_Scientific.tsv", # noqa + "ScreenSpot_Pro_Office": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot_Pro/ScreenSpot_Pro_Office.tsv", # noqa + "ScreenSpot_Pro_OS": "http://opencompass.openxlab.space/utils/benchmarks/GUI/ScreenSpot_Pro/ScreenSpot_Pro_OS.tsv", # noqa + } # path + DATASET_MD5 = { + 'ScreenSpot_Pro_Development': '45b93df1d5814885011d682fe1b0f959', + 'ScreenSpot_Pro_Creative': 'a15867fee82ba8cd95581895c55f03cd', + 'ScreenSpot_Pro_CAD': '0faa3bc29eba359766c3a7ca2c4d8917', + 'ScreenSpot_Pro_Scientific': 'edc2e1f2b53af5fff6480b77c4986b81', + 'ScreenSpot_Pro_Office': '8756c128cf567274c2647423ccc4eaf0', + 'ScreenSpot_Pro_OS': '49c3eaaa7df6d22475c39120fe8f1c06' + } + EVAL_TYPE = "point" # point or rectangle + RE_TYPE = "functional" # type of referring expressions: functional or composite + + def __init__( + self, + dataset="ScreenSpot_Pro_Development", + skip_noimg=True, + skeleton=False, + re_type="functional", + ): + # st() + ROOT = LMUDataRoot() + # You can override this variable to save image files to a different directory + self.dataset_name = dataset + self.img_root = osp.join(ROOT, "images", self.dataset_name) + self.RE_TYPE = re_type + if skeleton: + return + + data = self.load_data(dataset) + self.skip_noimg = skip_noimg + if skip_noimg and "image" in data: + data = data[~pd.isna(data["image"])] + + data["index"] = [str(idx + 1) for idx, x in enumerate(data["bbox"])] + + self.meta_only = True + self.parse_response_func = parse_bbox_aguvis # TODO: parse function can be specified through kwargs when initializing the dataset # noqa: E501 + + # The image field can store the base64 encoded image or another question index (for saving space) # noqa: E501 + if "image" in data: + data["image"] = [str(x) for x in data["image"]] + image_map = {x: y for x, y in zip(data["index"], data["image"])} + for k in image_map: + if len(image_map[k]) <= 64: + idx = image_map[k] + assert idx in image_map and len(image_map[idx]) > 64 + image_map[k] = image_map[idx] + + images = [toliststr(image_map[k]) for k in data["index"]] + data["image"] = [x[0] if len(x) == 1 else x for x in images] + self.meta_only = False + + self.data = data + + @classmethod + def get_action_space(self): + return "" + + @classmethod + def get_trajectory(self, line): + traj_dict = {} + if self.RE_TYPE == "functional": + traj_dict["task"] = line["question"] + else: + traj_dict["task"] = line["description"] + return traj_dict + + def build_prompt(self, line): + if isinstance(line, int): + line = self.data.iloc[line] + tgt_path = self.dump_image(line) + + if self.RE_TYPE == "functional": + user_instruction = USER_INSTRUCTION.format(instruction=line["question"]) + else: + user_instruction = USER_INSTRUCTION_V2.format( + description=line["description"] + ) + + msgs = [] + # add system prompt + if self.RE_TYPE == "functional": + msgs.append(dict(role="system", type="text", value=SYSTEM_PROMPT)) + else: + msgs.append(dict(role="system", type="text", value=SYSTEM_PROMPT_V2)) + if isinstance(tgt_path, list): + msgs.extend([dict(type="image", value=p) for p in tgt_path]) + else: + msgs = [dict(type="image", value=tgt_path)] + msgs.append(dict(type="text", value=user_instruction)) + return msgs + + def evaluate(self, eval_file, **judge_kwargs): + # st() + if self.EVAL_TYPE == "point": + return self.evaluate_point(eval_file, **judge_kwargs) + + elif self.EVAL_TYPE == "rectangle": + return self.evaluate_rectangle(eval_file, **judge_kwargs) + + def evaluate_rectangle(self, eval_file, **judge_kwargs): + scorers = { + "IoU": compute_iou, + "ACC@0.1": lambda x, y: compute_accuracy(x, y, 0.1), + "ACC@0.3": lambda x, y: compute_accuracy(x, y, 0.3), + "ACC@0.5": lambda x, y: compute_accuracy(x, y, 0.5), + "ACC@0.7": lambda x, y: compute_accuracy(x, y, 0.7), + "ACC@0.9": lambda x, y: compute_accuracy(x, y, 0.9), + "Center_ACC": compute_center_accuracy, + } + results_dict = {} + for key in scorers.keys(): + results_dict.update( + { + key: [], + key + "_text": [], + key + "_icon": [], + } + ) + + result = [] + data = load(eval_file) + assert "bbox" in data and "prediction" in data + lt = len(data) + lines = [data.iloc[i] for i in range(lt)] + for i in tqdm(range(len(lines))): + line = lines[i] + bbox = convert_bbox( + line["bbox"], os.path.join(self.img_root, line["image_path"]), convert_xywh_to_x1y1x2y2=False + ) + prediction = str(line["prediction"]) + try: + click_point = parse_bbox_aguvis(prediction) + + match = {} + for score_key, score_value in scorers.items(): + score = score_value(bbox, click_point) + if score_key != "IoU": + match[score_key.replace("ACC", "match")] = score + results_dict[score_key].append(score) + if line["ui_type"] == "text": + results_dict[score_key + "_text"].append(score) + else: + results_dict[score_key + "_icon"].append(score) + except: + click_point = None + match = {score_key: False for score_key in scorers.keys() if score_key != "IoU"} + result.append( + { + "img_path": os.path.join(self.img_root, line["image_path"]), + "text": line["question"], + "bbox": line["bbox"], + "parsed_bbox": bbox, + "type": line["ui_type"], + "source": line["application"], + "pred": click_point, + "num_matched": sum(match.values()), + **match, + } + ) + for key in results_dict: + if len(results_dict[key]) == 0: + results_dict[key] = str(0) + else: + results_dict[key] = str(sum(results_dict[key]) / len(results_dict[key])) + score_pth = get_intermediate_file_path(eval_file, '_score', 'json') + dump(results_dict, score_pth) + + failure_cases_path = os.environ.get("FAILURE_CASES_PATH", None) + if failure_cases_path is not None: + failure_cases = [res for res in result if not res["match"] and res["is_wrong_format"]] + failure_cases.sort(key=lambda r: r["num_matched"], reverse=True) + + with open(failure_cases_path, "w") as f: + json.dump(failure_cases, f, indent=4, ensure_ascii=False) + return results_dict + + def evaluate_point(self, eval_file, **judge_kwargs): + # -1: format_err, 0: wrong, 1: correct + stats = defaultdict(list) + # Will include instance-level results + result = [] + + data = load(eval_file) + assert "bbox" in data and "prediction" in data + lt = len(data) + lines = [data.iloc[i] for i in range(lt)] + for i in tqdm(range(len(lines))): + line = lines[i] + bbox = ( + line["bbox"] + if isinstance(line["bbox"], list) + else ast.literal_eval(line["bbox"]) + ) + # The format of bbox is (x1, y1, x2, y2) + + image = Image.open(os.path.join(self.img_root, line["image_path"])) + img_size = image.size + + def make_safe(value): + if value == -1: + # we can tolerate -1 as a special value and nomalize it to 0 + return 0 + else: + return value + + bbox = [ + make_safe(bbox[0]) / img_size[0], + make_safe(bbox[1]) / img_size[1], + make_safe(bbox[2]) / img_size[0], + make_safe(bbox[3]) / img_size[1], + ] + + if any([x < 0 or x > 1 for x in bbox]): + raise ValueError(f"bbox out of range: {bbox} | {line['bbox']} | {img_size}") + + key = line["category"] + ":" + line['ui_type'] + prediction = str(line["prediction"]) + try: + click_point = self.parse_response_func(prediction) + # Do Normalization By Default + if click_point[0] > 1 or click_point[1] > 1: + click_point = (click_point[0] / img_size[0], click_point[1] / img_size[1]) + + match = (bbox[0] <= click_point[0] <= bbox[2]) and \ + (bbox[1] <= click_point[1] <= bbox[3]) + + if match: + stats[key].append(1) + else: + stats[key].append(0) + is_wrong_format = False + + except Exception as e: + logger.warning(f"exception in screenspot eval:{e}") + stats[key].append(-1) + match, is_wrong_format, click_point = False, True, None + + result.append( + { + "img_path": os.path.join(self.img_root, line["image_path"]), + "text": line["question"], + "bbox": line["bbox"], + "parsed_bbox": bbox, + "type": line["ui_type"], + "source": line["application"], + "match": match, + "is_wrong_format": is_wrong_format, + "pred": click_point, + } + ) + + final_score_dict = {} + # Record the number of each category + final_score_dict.update({k + ':cnt': len(stats[k]) for k in stats}) + # Calculate the Overall stats + full_stats = [] + for v in stats.values(): + full_stats.extend(v) + final_score_dict['Overall_Accuracy'] = np.mean([x > 0 for x in full_stats]) * 100 + final_score_dict['Format_Err_Rate'] = np.mean([x < 0 for x in full_stats]) * 100 + # Calculate the Accuracy of Text / Icon + text_stats = [v for k, v in stats.items() if k.split(":")[1] == "text" for x in v] + text_stats = itertools.chain(*text_stats) + final_score_dict['Text_Accuracy'] = np.mean([x > 0 for x in text_stats]) * 100 + icon_stats = [v for k, v in stats.items() if k.split(":")[1] == "icon" for x in v] + icon_stats = itertools.chain(*icon_stats) + final_score_dict['Icon_Accuracy'] = np.mean([x > 0 for x in icon_stats]) * 100 + # Calculate the Accuracy of Each Category + cates = list(set(data['category'])) + for c in cates: + sub_stats = [v for k, v in stats.items() if k.split(":")[0] == c for x in v] + sub_stats = itertools.chain(*sub_stats) + final_score_dict[c + '_Accuracy'] = np.mean([x > 0 for x in sub_stats]) * 100 + + score_pth = get_intermediate_file_path(eval_file, '_score', 'json') + dump(final_score_dict, score_pth) + + failure_cases_path = os.environ.get("FAILURE_CASES_PATH", None) + if failure_cases_path is not None: + def click_distance(bbox, click_point): + x, y = click_point + x1, y1, x2, y2 = bbox + xc, yc = (x1 + x2) / 2, (y1 + y2) / 2 + w, h = x2 - x1, y2 - y1 + abs_shift_to_center = [abs(x - xc), abs(y - yc)] # noqa: E501 + width_outside, height_outside = [max(0, abs_shift_to_center[0] - w / 2), max(0, abs_shift_to_center[1] - h / 2)] # noqa: E501 + return (width_outside ** 2 + height_outside ** 2) ** 0.5 # noqa: E501 + + wrong_format_result = [res for res in result if res["is_wrong_format"]] + missed_result = [res for res in result if not res["match"] and not res["is_wrong_format"]] + missed_result.sort(key=lambda r: click_distance(r["parsed_bbox"], r["pred"]), reverse=True) + failure_cases = wrong_format_result + missed_result + + with open(failure_cases_path, "w") as f: + json.dump(failure_cases, f, indent=4, ensure_ascii=False) + + successful_cases_path = os.environ.get("SUCCESSFUL_CASES_PATH", None) + if successful_cases_path is not None: + def _click_distance(bbox, click_point): + x, y = click_point + x1, y1, x2, y2 = bbox + xc, yc = (x1 + x2) / 2, (y1 + y2) / 2 + x_shift, y_shift = x - xc, y - yc + return (x_shift ** 2 + y_shift ** 2) ** 0.5 + + successful_cases = [res for res in result if res["match"]] + successful_cases.sort(key=lambda r: _click_distance(r["parsed_bbox"], r["pred"]), reverse=True) + with open(successful_cases_path, "w") as f: + json.dump(successful_cases, f, indent=4, ensure_ascii=False) + return final_score_dict diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/__pycache__/__init__.cpython-310.pyc b/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20789741aeeccb393de62d7450a0446ef459e126 Binary files /dev/null and b/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/__pycache__/__init__.cpython-310.pyc differ diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/data_preprocess.py b/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/data_preprocess.py new file mode 100644 index 0000000000000000000000000000000000000000..2281e2613f7b84cc8e8c8fb41e37456a7c3a2c10 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/data_preprocess.py @@ -0,0 +1,447 @@ +import re +import unicodedata +from pylatexenc.latex2text import LatexNodes2Text +from bs4 import BeautifulSoup +import subprocess +import shutil +import uuid +import html +import os + +def remove_markdown_fences(content): + content = re.sub(r'^```markdown\n?', '', content, flags=re.MULTILINE) + content = re.sub(r'```\n?$', '', content, flags=re.MULTILINE) + return content + +# Standardize all consecutive characters +def replace_repeated_chars(input_str): + input_str = re.sub(r'_{4,}', '____', input_str) # Replace more than 4 consecutive underscores with 4 underscores + input_str = re.sub(r' {4,}', ' ', input_str) # Replace more than 4 consecutive spaces with 4 spaces + return re.sub(r'([^a-zA-Z0-9])\1{10,}', r'\1\1\1\1', input_str) # For other consecutive symbols (except numbers and letters), replace more than 10 occurrences with 4 + +# Special Unicode handling +def fullwidth_to_halfwidth(s): + result = [] + for char in s: + code = ord(char) + # Convert full-width space to half-width space + if code == 0x3000: + code = 0x0020 + # Convert other full-width characters to half-width + elif 0xFF01 <= code <= 0xFF5E: + code -= 0xFEE0 + result.append(chr(code)) + return ''.join(result) + +def find_special_unicode(s): + special_chars = {} + for char in s: + if ord(char) > 127: # Non-ASCII characters + # unicode_name = unicodedata.name(char, None) + unicode_name = unicodedata.category(char) + special_chars[char] = f'U+{ord(char):04X} ({unicode_name})' + return special_chars + +# # Define dictionary for Unicode character replacements +# unicode_replacements = { +# "\u00A9": r"$\copyright$", # Copyright symbol © to latex +# "\u00AE": r"$^\circledR$", # Registered trademark ® to latex +# "\u2122": r"$^\text{TM}$", # Trademark ™ to latex +# "\u2018": "'", # Left single quote to straight quote +# "\u2019": "'", # Right single quote to straight quote +# "\u201C": "\"", # Left double quote to straight quote +# "\u201D": "\"", # Right double quote to straight quote +# "\u2013": "-", # En dash to hyphen +# "\u2014": "-", # Em dash to hyphen +# "\u2026": "...", # Unicode ellipsis to three dots +# "\u2103": r"$\textdegree C$", # ℃ +# "\u03B1": r"$\alpha$", # α +# "\u03B2": r"$\beta$", # β +# "\u03A3": r"$\Sigma$", # Σ +# } + +# # Use regex to replace Unicode characters +# def replace_unicode(match): +# char = match.group(0) +# return unicode_replacements.get(char, char) + +inline_reg = re.compile( + r'\$(.*?)\$|' + r'\\\((.*?)\\\)', +) + +def textblock2unicode(text): + inline_matches = inline_reg.finditer(text) + removal_positions = [] + for match in inline_matches: + position = [match.start(), match.end()] + content = match.group(1) if match.group(1) is not None else match.group(2) + # print('-------- content-------', content) + # Remove escape characters \ + clean_content = re.sub(r'\\([\\_&%^])', '', content) + + try: + if any(char in clean_content for char in r'\^_'): + if clean_content.endswith('\\'): + clean_content += ' ' + # inline_array.append(match.group(0)) + unicode_content = LatexNodes2Text().latex_to_text(clean_content) + removal_positions.append((position[0], position[1], unicode_content)) + except: + continue + + # Remove inline formulas from original text + for start, end, unicode_content in sorted(removal_positions, reverse=True): + text = text[:start] + unicode_content.strip() + text[end:] + + return text + +def normalized_formula(text): + # Normalize math formulas before matching + filter_list = ['\\mathbf', '\\mathrm', '\\mathnormal', '\\mathit', '\\mathbb', '\\mathcal', '\\mathscr', '\\mathfrak', '\\mathsf', '\\mathtt', + '\\textbf', '\\text', '\\boldmath', '\\boldsymbol', '\\operatorname', '\\bm', + '\\symbfit', '\\mathbfcal', '\\symbf', '\\scriptscriptstyle', '\\notag', + '\\setlength', '\\coloneqq', '\\space', '\\thickspace', '\\thinspace', '\\medspace', '\\nobreakspace', '\\negmedspace', + '\\quad', '\\qquad', '\\enspace', '\\substackw', ' '] + # '\\left', '\\right', '{', '}', ' '] + + # delimiter_filter + pattern = re.compile(r"\\\[(.+?)(?]*>(.*)' + tables = re.findall(pattern, table_res, re.DOTALL | re.IGNORECASE) + table_res = ''.join(tables) + # table_res = re.sub('','',table_res) + table_res = re.sub('( style=".*?")', "", table_res) + table_res = re.sub('( height=".*?")', "", table_res) + table_res = re.sub('( width=".*?")', "", table_res) + table_res = re.sub('( align=".*?")', "", table_res) + table_res = re.sub('( class=".*?")', "", table_res) + table_res = re.sub('',"",table_res) + + table_res = re.sub(r'\s+', " ", table_res) + table_res_no_space = '' + table_res.replace(' ','') + '
' + # table_res_no_space = re.sub(' (style=".*?")',"",table_res_no_space) + # table_res_no_space = re.sub(r'[ ]', " ", table_res_no_space) + table_res_no_space = re.sub('colspan="', ' colspan="', table_res_no_space) + table_res_no_space = re.sub('rowspan="', ' rowspan="', table_res_no_space) + table_res_no_space = re.sub('border="', ' border="', table_res_no_space) + + table_res = '' + table_res + '
' + # table_flow.append(table_res) + # table_flow_no_space.append(table_res_no_space) + + return table_res, table_res_no_space + + def clean_table(input_str,flag=True): + if flag: + input_str = input_str.replace('', '').replace('', '') + input_str = input_str.replace('', '').replace('', '') + input_str = input_str.replace('', '').replace('', '') + input_str = input_str.replace('
', '').replace('
', '') + input_str = input_str.replace('

', '').replace('

', '') + input_str = input_str.replace('', '') + input_str = re.sub('.*?','',input_str) + return input_str + + norm_text, _ = process_table_html(text) + norm_text = clean_table(norm_text) + return norm_text + +def normalized_latex_table(text): + def latex_template(latex_code): + template = r''' + \documentclass[border=20pt]{article} + \usepackage{subcaption} + \usepackage{url} + \usepackage{graphicx} + \usepackage{caption} + \usepackage{multirow} + \usepackage{booktabs} + \usepackage{color} + \usepackage{colortbl} + \usepackage{xcolor,soul,framed} + \usepackage{fontspec} + \usepackage{amsmath,amssymb,mathtools,bm,mathrsfs,textcomp} + \setlength{\parindent}{0pt}''' + \ + r''' + \begin{document} + ''' + \ + latex_code + \ + r''' + \end{document}''' + + return template + + def process_table_latex(latex_code): + SPECIAL_STRINGS= [ + ['\\\\vspace\\{.*?\\}', ''], + ['\\\\hspace\\{.*?\\}', ''], + ['\\\\rule\{.*?\\}\\{.*?\\}', ''], + ['\\\\addlinespace\\[.*?\\]', ''], + ['\\\\addlinespace', ''], + ['\\\\renewcommand\\{\\\\arraystretch\\}\\{.*?\\}', ''], + ['\\\\arraystretch\\{.*?\\}', ''], + ['\\\\(row|column)?colors?\\{[^}]*\\}(\\{[^}]*\\}){0,2}', ''], + ['\\\\color\\{.*?\\}', ''], + ['\\\\textcolor\\{.*?\\}', ''], + ['\\\\rowcolor(\\[.*?\\])?\\{.*?\\}', ''], + ['\\\\columncolor(\\[.*?\\])?\\{.*?\\}', ''], + ['\\\\cellcolor(\\[.*?\\])?\\{.*?\\}', ''], + ['\\\\colorbox\\{.*?\\}', ''], + ['\\\\(tiny|scriptsize|footnotesize|small|normalsize|large|Large|LARGE|huge|Huge)', ''], + [r'\s+', ' '], + ['\\\\centering', ''], + ['\\\\begin\\{table\\}\\[.*?\\]', '\\\\begin{table}'], + ['\t', ''], + ['@{}', ''], + ['\\\\toprule(\\[.*?\\])?', '\\\\hline'], + ['\\\\bottomrule(\\[.*?\\])?', '\\\\hline'], + ['\\\\midrule(\\[.*?\\])?', '\\\\hline'], + ['p\\{[^}]*\\}', 'l'], + ['m\\{[^}]*\\}', 'c'], + ['\\\\scalebox\\{[^}]*\\}\\{([^}]*)\\}', '\\1'], + ['\\\\textbf\\{([^}]*)\\}', '\\1'], + ['\\\\textit\\{([^}]*)\\}', '\\1'], + ['\\\\cmidrule(\\[.*?\\])?\\(.*?\\)\\{([0-9]-[0-9])\\}', '\\\\cline{\\2}'], + ['\\\\hline', ''], + [r'\\multicolumn\{1\}\{[^}]*\}\{((?:[^{}]|(?:\{[^{}]*\}))*)\}', r'\1'] + ] + pattern = r'\\begin\{tabular\}.*\\end\{tabular\}' # 注意这里不用 .*? + matches = re.findall(pattern, latex_code, re.DOTALL) + latex_code = ' '.join(matches) + + for special_str in SPECIAL_STRINGS: + latex_code = re.sub(fr'{special_str[0]}', fr'{special_str[1]}', latex_code) + + return latex_code + + def convert_latex_to_html(latex_content, cache_dir='./temp'): + if not os.path.exists(cache_dir): + os.makedirs(cache_dir) + + uuid_str = str(uuid.uuid1()) + with open(f'{cache_dir}/{uuid_str}.tex', 'w') as f: + f.write(latex_template(latex_content)) + + cmd = ['latexmlc', '--quiet', '--nocomments', f'--log={cache_dir}/{uuid_str}.log', + f'{cache_dir}/{uuid_str}.tex', f'--dest={cache_dir}/{uuid_str}.html'] + try: + subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + with open(f'{cache_dir}/{uuid_str}.html', 'r') as f: + html_content = f.read() + + pattern = r']*>(.*)' + tables = re.findall(pattern, html_content, re.DOTALL | re.IGNORECASE) + tables = [f'{table}
' for table in tables] + html_content = '\n'.join(tables) + + except Exception as e: + html_content = '' + + shutil.rmtree(cache_dir) + return html_content + + html_text = convert_latex_to_html(text) + normlized_tables = normalized_html_table(html_text) + return normlized_tables + + +def normalized_table(text, format='html'): + if format not in ['html', 'latex']: + raise ValueError('Invalid format: {}'.format(format)) + else: + return globals()['normalized_{}_table'.format(format)](text) + + +def textblock_with_norm_formula(text): + inline_matches = inline_reg.finditer(text) + removal_positions = [] + for match in inline_matches: + position = [match.start(), match.end()] + content = match.group(1) if match.group(1) is not None else match.group(2) + # print('-------- content-------', content) + + norm_content = normalized_formula(content) + removal_positions.append((position[0], position[1], norm_content)) + + # Remove inline formulas from original text + for start, end, norm_content in sorted(removal_positions, reverse=True): + text = text[:start] + norm_content.strip() + text[end:] + + return text + +# def inline_filter_unicode(text): +# # Ensure text is string type +# if not isinstance(text, str): +# text = str(text) + +# # Convert LaTeX content to Unicode representation +# text = LatexNodes2Text().latex_to_text(text) + +# inline_array = [] +# inline_matches = inline_reg.finditer(text) + +# for match in inline_matches: +# position = [match.start(), match.end()] +# content = match.group(1) if match.group(1) is not None else match.group(2) + +# # Remove escape characters \ +# clean_content = re.sub(r'\\([\\_&%^])', '', content) + +# if any(char in clean_content for char in r'\^_'): +# # inline_array.append(match.group(0)) +# inline_array.append({ +# 'category_type': 'equation_inline', +# 'position': position, +# 'content': match.group(0), +# }) +# text = text.replace(match.group(0), '') +# # print('-----Found inline formula: ', match.group(0)) +# else: +# text = text.replace(match.group(0), content) +# # # Add to inline_array +# # inline_array.append({ +# # 'category_type': 'equation_inline', +# # 'position': position, +# # 'content': content, +# # }) + +# # # Remove matched formula from original text, can choose to replace with spaces or remove directly +# # text = text[:position[0]] + ' '*(position[1]-position[0]) + text[position[1]:] + +# return text, inline_array + +def inline_filter_unicode(text): + # Ensure text is string type + if not isinstance(text, str): + text = str(text) + + # Replace inline formula boundary markers + #print('--------text-------',text) + placeholder = '__INLINE_FORMULA_BOUNDARY__' + text_copy = text.replace('$', placeholder).replace('\\(', placeholder).replace('\\)', placeholder) + #print('--------text_copy-------',text_copy) + # Convert LaTeX content to Unicode representation + text_copy = LatexNodes2Text().latex_to_text(text_copy) + #print('--------text_copy---unicode----',text_copy) + # Restore boundary markers + text_copy = text_copy.replace(placeholder, '$') + + inline_array = [] + inline_matches = inline_reg.finditer(text_copy) + # Record positions of inline formulas to be removed + removal_positions = [] + + for match in inline_matches: + position = [match.start(), match.end()] + content = match.group(1) if match.group(1) is not None else match.group(2) + print('-------- content-------', content) + # Remove escape characters \ + clean_content = re.sub(r'\\([\\_&%^])', '', content) + + if any(char in clean_content for char in r'\^_'): + # inline_array.append(match.group(0)) + inline_array.append({ + 'category_type': 'equation_inline', + 'position': position, + 'content': content, + }) + removal_positions.append((position[0], position[1])) + + # Remove inline formulas from original text + for start, end in sorted(removal_positions, reverse=True): + text = text[:start] + text[end:] + + return text, inline_array + +def inline_filter(text): + # Ensure text is string type + if not isinstance(text, str): + text = str(text) + + inline_array = [] + inline_matches = inline_reg.finditer(text) + + for match in inline_matches: + position = [match.start(), match.end()] + content = match.group(1) if match.group(1) is not None else match.group(2) + # print('inline_content: ', content) + + # Remove escape characters \ + clean_content = re.sub(r'\\([\\_&%^])', '', content) + + if any(char in clean_content for char in r'\^_'): + # inline_array.append(match.group(0)) + inline_array.append({ + 'category_type': 'equation_inline', + 'position': position, + 'content': match.group(0), + }) + text = text.replace(match.group(0), '') + # print('-----Found inline formula: ', match.group(0)) + else: + text = text.replace(match.group(0), content) + + return text, inline_array + +# Text OCR quality check processing: +def clean_string(input_string): + # Use regex to keep Chinese characters, English letters and numbers + input_string = input_string.replace('\\t', '').replace('\\n', '').replace('\t', '').replace('\n', '').replace('/t', '').replace('/n', '') + cleaned_string = re.sub(r'[^\w\u4e00-\u9fff]', '', input_string) + return cleaned_string diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/requirements.txt b/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fe248debd3144e7513d507ac4c9ca88fdd2d3e94 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/requirements.txt @@ -0,0 +1,13 @@ +accelerate>=0.26.0 +apted +BeautifulSoup4 +evaluate +func_timeout +jmespath +Levenshtein +lxml +nltk +pylatexenc +qwen_vl_utils +scipy +torchvision diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/utils.py b/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..30b65a6c412c9a5aeb7db301a2cd436ecbfae293 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/OmniDocBench/utils.py @@ -0,0 +1,1916 @@ +import re +import unicodedata +import subprocess +import shutil +import uuid +import html +import os +import sys +import pdb +import json +import copy +import unicodedata + +import Levenshtein +import numpy as np +from bs4 import BeautifulSoup +from pylatexenc.latex2text import LatexNodes2Text +from scipy.optimize import linear_sum_assignment +from pylatexenc.latexencode import unicode_to_latex +from pylatexenc.latex2text import LatexNodes2Text +from pylatexenc.latexwalker import LatexWalker, LatexEnvironmentNode, LatexCharsNode, LatexGroupNode, LatexMacroNode, LatexSpecialsNode +from collections import defaultdict + + +def read_md_file(filepath): + with open(filepath, 'r', encoding='utf-8') as file: + content = file.read() + + return content + +def save_paired_result(preds, gts, save_path): + save_result = [] + formula_id = 0 + for gt, pred in zip(gts, preds): + save_result.append({ + "gt": gt, + "pred": pred, + "img_id": formula_id + }) + formula_id += 1 + with open(save_path, 'w', encoding='utf-8') as f: + json.dump(save_result, f, indent=4, ensure_ascii=False) + +def remove_markdown_fences(content): + content = re.sub(r'^```markdown\n?', '', content, flags=re.MULTILINE) + content = re.sub(r'```\n?$', '', content, flags=re.MULTILINE) + return content + +# Standardize all consecutive characters +def replace_repeated_chars(input_str): + input_str = re.sub(r'_{4,}', '____', input_str) # Replace more than 4 consecutive underscores with 4 underscores + input_str = re.sub(r' {4,}', ' ', input_str) # Replace more than 4 consecutive spaces with 4 spaces + return re.sub(r'([^a-zA-Z0-9])\1{10,}', r'\1\1\1\1', input_str) # For other consecutive symbols (except numbers and letters), replace more than 10 occurrences with 4 + +# Special Unicode handling +def fullwidth_to_halfwidth(s): + result = [] + for char in s: + code = ord(char) + # Convert full-width space to half-width space + if code == 0x3000: + code = 0x0020 + # Convert other full-width characters to half-width + elif 0xFF01 <= code <= 0xFF5E: + code -= 0xFEE0 + result.append(chr(code)) + return ''.join(result) + +def find_special_unicode(s): + special_chars = {} + for char in s: + if ord(char) > 127: # Non-ASCII characters + # unicode_name = unicodedata.name(char, None) + unicode_name = unicodedata.category(char) + special_chars[char] = f'U+{ord(char):04X} ({unicode_name})' + return special_chars + + +inline_reg = re.compile( + r'\$(.*?)\$|' + r'\\\((.*?)\\\)', +) + +def textblock2unicode(text): + inline_matches = inline_reg.finditer(text) + removal_positions = [] + for match in inline_matches: + position = [match.start(), match.end()] + content = match.group(1) if match.group(1) is not None else match.group(2) + # print('-------- content-------', content) + # Remove escape characters \ + clean_content = re.sub(r'\\([\\_&%^])', '', content) + + try: + if any(char in clean_content for char in r'\^_'): + if clean_content.endswith('\\'): + clean_content += ' ' + # inline_array.append(match.group(0)) + unicode_content = LatexNodes2Text().latex_to_text(clean_content) + removal_positions.append((position[0], position[1], unicode_content)) + except: + continue + + # Remove inline formulas from original text + for start, end, unicode_content in sorted(removal_positions, reverse=True): + text = text[:start] + unicode_content.strip() + text[end:] + + return text + +def normalized_formula(text): + # Normalize math formulas before matching + filter_list = ['\\mathbf', '\\mathrm', '\\mathnormal', '\\mathit', '\\mathbb', '\\mathcal', '\\mathscr', '\\mathfrak', '\\mathsf', '\\mathtt', + '\\textbf', '\\text', '\\boldmath', '\\boldsymbol', '\\operatorname', '\\bm', + '\\symbfit', '\\mathbfcal', '\\symbf', '\\scriptscriptstyle', '\\notag', + '\\setlength', '\\coloneqq', '\\space', '\\thickspace', '\\thinspace', '\\medspace', '\\nobreakspace', '\\negmedspace', + '\\quad', '\\qquad', '\\enspace', '\\substackw', ' '] + # '\\left', '\\right', '{', '}', ' '] + + # delimiter_filter + pattern = re.compile(r"\\\[(.+?)(?]*>(.*)' + tables = re.findall(pattern, table_res, re.DOTALL | re.IGNORECASE) + table_res = ''.join(tables) + # table_res = re.sub('','',table_res) + table_res = re.sub('( style=".*?")', "", table_res) + table_res = re.sub('( height=".*?")', "", table_res) + table_res = re.sub('( width=".*?")', "", table_res) + table_res = re.sub('( align=".*?")', "", table_res) + table_res = re.sub('( class=".*?")', "", table_res) + table_res = re.sub('',"",table_res) + + table_res = re.sub(r'\s+', " ", table_res) + table_res_no_space = '' + table_res.replace(' ','') + '
' + # table_res_no_space = re.sub(' (style=".*?")',"",table_res_no_space) + # table_res_no_space = re.sub(r'[ ]', " ", table_res_no_space) + table_res_no_space = re.sub('colspan="', ' colspan="', table_res_no_space) + table_res_no_space = re.sub('rowspan="', ' rowspan="', table_res_no_space) + table_res_no_space = re.sub('border="', ' border="', table_res_no_space) + + table_res = '' + table_res + '
' + # table_flow.append(table_res) + # table_flow_no_space.append(table_res_no_space) + + return table_res, table_res_no_space + + def clean_table(input_str,flag=True): + if flag: + input_str = input_str.replace('', '').replace('', '') + input_str = input_str.replace('', '').replace('', '') + input_str = input_str.replace('', '').replace('', '') + input_str = input_str.replace('
', '').replace('
', '') + input_str = input_str.replace('

', '').replace('

', '') + input_str = input_str.replace('', '') + input_str = re.sub('.*?','',input_str) + return input_str + + norm_text, _ = process_table_html(text) + norm_text = clean_table(norm_text) + return norm_text + +def normalized_latex_table(text): + def latex_template(latex_code): + template = r''' + \documentclass[border=20pt]{article} + \usepackage{subcaption} + \usepackage{url} + \usepackage{graphicx} + \usepackage{caption} + \usepackage{multirow} + \usepackage{booktabs} + \usepackage{color} + \usepackage{colortbl} + \usepackage{xcolor,soul,framed} + \usepackage{fontspec} + \usepackage{amsmath,amssymb,mathtools,bm,mathrsfs,textcomp} + \setlength{\parindent}{0pt}''' + \ + r''' + \begin{document} + ''' + \ + latex_code + \ + r''' + \end{document}''' + + return template + + def process_table_latex(latex_code): + SPECIAL_STRINGS= [ + ['\\\\vspace\\{.*?\\}', ''], + ['\\\\hspace\\{.*?\\}', ''], + ['\\\\rule\{.*?\\}\\{.*?\\}', ''], + ['\\\\addlinespace\\[.*?\\]', ''], + ['\\\\addlinespace', ''], + ['\\\\renewcommand\\{\\\\arraystretch\\}\\{.*?\\}', ''], + ['\\\\arraystretch\\{.*?\\}', ''], + ['\\\\(row|column)?colors?\\{[^}]*\\}(\\{[^}]*\\}){0,2}', ''], + ['\\\\color\\{.*?\\}', ''], + ['\\\\textcolor\\{.*?\\}', ''], + ['\\\\rowcolor(\\[.*?\\])?\\{.*?\\}', ''], + ['\\\\columncolor(\\[.*?\\])?\\{.*?\\}', ''], + ['\\\\cellcolor(\\[.*?\\])?\\{.*?\\}', ''], + ['\\\\colorbox\\{.*?\\}', ''], + ['\\\\(tiny|scriptsize|footnotesize|small|normalsize|large|Large|LARGE|huge|Huge)', ''], + [r'\s+', ' '], + ['\\\\centering', ''], + ['\\\\begin\\{table\\}\\[.*?\\]', '\\\\begin{table}'], + ['\t', ''], + ['@{}', ''], + ['\\\\toprule(\\[.*?\\])?', '\\\\hline'], + ['\\\\bottomrule(\\[.*?\\])?', '\\\\hline'], + ['\\\\midrule(\\[.*?\\])?', '\\\\hline'], + ['p\\{[^}]*\\}', 'l'], + ['m\\{[^}]*\\}', 'c'], + ['\\\\scalebox\\{[^}]*\\}\\{([^}]*)\\}', '\\1'], + ['\\\\textbf\\{([^}]*)\\}', '\\1'], + ['\\\\textit\\{([^}]*)\\}', '\\1'], + ['\\\\cmidrule(\\[.*?\\])?\\(.*?\\)\\{([0-9]-[0-9])\\}', '\\\\cline{\\2}'], + ['\\\\hline', ''], + [r'\\multicolumn\{1\}\{[^}]*\}\{((?:[^{}]|(?:\{[^{}]*\}))*)\}', r'\1'] + ] + pattern = r'\\begin\{tabular\}.*\\end\{tabular\}' # 注意这里不用 .*? + matches = re.findall(pattern, latex_code, re.DOTALL) + latex_code = ' '.join(matches) + + for special_str in SPECIAL_STRINGS: + latex_code = re.sub(fr'{special_str[0]}', fr'{special_str[1]}', latex_code) + + return latex_code + + def convert_latex_to_html(latex_content, cache_dir='./temp'): + if not os.path.exists(cache_dir): + os.makedirs(cache_dir) + + uuid_str = str(uuid.uuid1()) + with open(f'{cache_dir}/{uuid_str}.tex', 'w') as f: + f.write(latex_template(latex_content)) + + cmd = ['latexmlc', '--quiet', '--nocomments', f'--log={cache_dir}/{uuid_str}.log', + f'{cache_dir}/{uuid_str}.tex', f'--dest={cache_dir}/{uuid_str}.html'] + try: + subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + with open(f'{cache_dir}/{uuid_str}.html', 'r') as f: + html_content = f.read() + + pattern = r']*>(.*)' + tables = re.findall(pattern, html_content, re.DOTALL | re.IGNORECASE) + tables = [f'{table}
' for table in tables] + html_content = '\n'.join(tables) + + except Exception as e: + html_content = '' + + shutil.rmtree(cache_dir) + return html_content + + html_text = convert_latex_to_html(text) + normlized_tables = normalized_html_table(html_text) + return normlized_tables + + +def normalized_table(text, format='html'): + if format not in ['html', 'latex']: + raise ValueError('Invalid format: {}'.format(format)) + else: + return globals()['normalized_{}_table'.format(format)](text) + + +def textblock_with_norm_formula(text): + inline_matches = inline_reg.finditer(text) + removal_positions = [] + for match in inline_matches: + position = [match.start(), match.end()] + content = match.group(1) if match.group(1) is not None else match.group(2) + # print('-------- content-------', content) + + norm_content = normalized_formula(content) + removal_positions.append((position[0], position[1], norm_content)) + + # Remove inline formulas from original text + for start, end, norm_content in sorted(removal_positions, reverse=True): + text = text[:start] + norm_content.strip() + text[end:] + + return text + + +def inline_filter_unicode(text): + # Ensure text is string type + if not isinstance(text, str): + text = str(text) + + # Replace inline formula boundary markers + #print('--------text-------',text) + placeholder = '__INLINE_FORMULA_BOUNDARY__' + text_copy = text.replace('$', placeholder).replace('\\(', placeholder).replace('\\)', placeholder) + #print('--------text_copy-------',text_copy) + # Convert LaTeX content to Unicode representation + text_copy = LatexNodes2Text().latex_to_text(text_copy) + #print('--------text_copy---unicode----',text_copy) + # Restore boundary markers + text_copy = text_copy.replace(placeholder, '$') + + inline_array = [] + inline_matches = inline_reg.finditer(text_copy) + # Record positions of inline formulas to be removed + removal_positions = [] + + for match in inline_matches: + position = [match.start(), match.end()] + content = match.group(1) if match.group(1) is not None else match.group(2) + print('-------- content-------', content) + # Remove escape characters \ + clean_content = re.sub(r'\\([\\_&%^])', '', content) + + if any(char in clean_content for char in r'\^_'): + # inline_array.append(match.group(0)) + inline_array.append({ + 'category_type': 'equation_inline', + 'position': position, + 'content': content, + }) + removal_positions.append((position[0], position[1])) + + # Remove inline formulas from original text + for start, end in sorted(removal_positions, reverse=True): + text = text[:start] + text[end:] + + return text, inline_array + +def inline_filter(text): + # Ensure text is string type + if not isinstance(text, str): + text = str(text) + + inline_array = [] + inline_matches = inline_reg.finditer(text) + + for match in inline_matches: + position = [match.start(), match.end()] + content = match.group(1) if match.group(1) is not None else match.group(2) + # print('inline_content: ', content) + + # Remove escape characters \ + clean_content = re.sub(r'\\([\\_&%^])', '', content) + + if any(char in clean_content for char in r'\^_'): + # inline_array.append(match.group(0)) + inline_array.append({ + 'category_type': 'equation_inline', + 'position': position, + 'content': match.group(0), + }) + text = text.replace(match.group(0), '') + # print('-----Found inline formula: ', match.group(0)) + else: + text = text.replace(match.group(0), content) + + return text, inline_array + +# Text OCR quality check processing: +def clean_string(input_string): + # Use regex to keep Chinese characters, English letters and numbers + input_string = input_string.replace('\\t', '').replace('\\n', '').replace('\t', '').replace('\n', '').replace('/t', '').replace('/n', '') + cleaned_string = re.sub(r'[^\w\u4e00-\u9fff]', '', input_string) + return cleaned_string + +def extract_tabular(text): + begin_pattern = r'\\begin{tabular}' + end_pattern = r'\\end{tabular}' + + tabulars = [] + positions = [] + current_pos = 0 + stack = [] + + while current_pos < len(text): + begin_match = re.search(begin_pattern, text[current_pos:]) + end_match = re.search(end_pattern, text[current_pos:]) + + if not begin_match and not end_match: + break + + if begin_match and (not end_match or begin_match.start() < end_match.start()): + stack.append(current_pos + begin_match.start()) + current_pos += begin_match.start() + len(end_pattern) + elif end_match: + if stack: + start_pos = stack.pop() + if not stack: + end_pos = current_pos + end_match.start() + len(end_pattern) + tabular_code = text[start_pos:end_pos] + tabulars.append(tabular_code) + positions.append((start_pos, end_pos)) + current_pos += end_match.start() + len(end_pattern) + else: + current_pos += 1 + + if stack: + new_start = stack[0] + len(begin_pattern) + new_tabulars, new_positions = extract_tabular(text[new_start:]) + new_positions = [(start + new_start, end + new_start) for start, end in new_positions] + tabulars.extend(new_tabulars) + positions.extend(new_positions) + + return tabulars, positions + +# math reg + # r'\\begin{equation\*?}(.*?)\\end{equation\*?}|' + # r'\\begin{align\*?}(.*?)\\end{align\*?}|' + # r'\\begin{gather\*?}(.*?)\\end{gather\*?}|' +display_reg = re.compile( + r'\$\$(.*?)\$\$|' + r'\\\[(.*?)\\\]|' + r'\$(.*?)\$|' + r'\\\((.*?)\\\)', + re.DOTALL +) + +# inline_reg = re.compile( +# r'(?)', + re.DOTALL +) + +# title +title_reg = re.compile( + r'^\s*#.*$', + re.MULTILINE) + +# img +img_pattern = r'!\[.*?\]\(.*?\)' + +# code block +code_block_reg = re.compile( + r'```(\w+)\n(.*?)```', + re.DOTALL +) + + +def md_tex_filter(content): + ''' + Input: 1 page md or tex content - String + Output: text, display, inline, table, title, code - list + ''' + content = re.sub(img_pattern, '', content) # remove image + content = remove_markdown_fences(content) # remove markdown fences + content = replace_repeated_chars(content) # replace all consecutive characters + + + + pred_all = [] + latex_table_array, table_positions = extract_tex_table(content) + for latex_table, position in zip(latex_table_array, table_positions): + position = [position[0], position[0]+len(latex_table)] # !!! + pred_all.append({ + 'category_type': 'latex_table', + 'position': position, + 'content': latex_table + }) + content = content[:position[0]] + ' '*(position[1]-position[0]) + content[position[1]:] # replace latex table with space + + + # extract html table + html_table_array, table_positions = extract_html_table(content) + for html_table, position in zip(html_table_array, table_positions): + position = [position[0], position[0]+len(html_table)] + pred_all.append({ + 'category_type': 'html_table', + 'position': position, + 'content': html_table + }) + content = content[:position[0]] + ' '*(position[1]-position[0]) + content[position[1]:] # replace html table with space + + # extract interline formula + display_matches = display_reg.finditer(content) + for match in display_matches: + matched = match.group(0) + if matched: + single_line = ''.join(matched.split()) + position = [match.start(), match.end()] + # replace $$ with \[\] + dollar_pattern = re.compile(r'\$\$(.*?)\$\$|\$(.*?)\$|\\\((.*?)\\\)', re.DOTALL) + sub_match = dollar_pattern.search(single_line) + if sub_match is None: + # pass + content = content[:position[0]] + ' '*(position[1]-position[0]) + content[position[1]:] + pred_all.append({ + 'category_type': 'equation_isolated', + 'position': position, + 'content': single_line + }) + elif sub_match.group(1): + single_line = re.sub(dollar_pattern, r'\\[\1\\]', single_line) + content = content[:position[0]] + ' '*(position[1]-position[0]) + content[position[1]:] # replace equation with space + pred_all.append({ + 'category_type': 'equation_isolated', + 'position': position, + 'content': single_line + }) + else: + single_line = re.sub(dollar_pattern, r'\\[\2\3\\]', single_line) + pred_all.append({ + 'category_type': 'equation_isolated', + 'position': position, + 'content': single_line, + 'fine_category_type': 'equation_inline' + }) + + + # extract md table with || + md_table_mathces = md_table_reg.findall(content+'\n') + if len(md_table_mathces) >= 2: + # print("md table found!") + # print("content:", content) + content = convert_markdown_to_html(content) + # print('----------content after converting md table to html:', content) + html_table_matches = html_table_reg.finditer(content) + if html_table_matches: + for match in html_table_matches: + matched = match.group(0) + position = [match.start(), match.end()] + # content = content.replace(match, '') + # print('content after removing the md table:', content) + content = content[:position[0]] + ' '*(position[1]-position[0]) + content[position[1]:] # replace md table with space + pred_all.append({ + 'category_type': 'html_table', + 'position': position, + 'content': matched.strip(), + 'fine_category_type': 'md2html_table' + }) + # print('---------After md table: \n', content) + + # extract code blocks + code_matches = code_block_reg.finditer(content) + if code_matches: + for match in code_matches: + position = [match.start(), match.end()] + language = match.group(1) + code = match.group(2).strip() + # content = content.replace(match.group(0), '') + content = content[:position[0]] + ' '*(position[1]-position[0]) + content[position[1]:] # replace code block with space + pred_all.append({ + 'category_type': 'text_all', + 'position': position, + 'content': code, + 'language': language, + 'fine_category_type': 'code' + }) + + + # Remove latex style + content = re.sub(r'\\title\{(.*?)\}', r'\1', content) + content = re.sub(r'\\title\s*\{\s*(.*?)\s*\}', r'\1', content, flags=re.DOTALL) + content = re.sub(r'\\text\s*\{\s*(.*?)\s*\}', r'\1', content, flags=re.DOTALL) + content = re.sub(r'\\section\*?\{(.*?)\}', r'\1', content) + content = re.sub(r'\\section\*?\{\s*(.*?)\s*\}', r'\1', content, flags=re.DOTALL) + + # extract texts + res = content.split('\n\n') + if len(res) == 1: + res = content.split('\n') # some models do not use double newlines, so use single newlines to split + + content_position = 0 + for text in res: + position = [content_position, content_position+len(text)] + content_position += len(text) + text = text.strip() + text = text.strip('\n') + # print('ori_text: ', text) + text = '\n'.join([_.strip() for _ in text.split('\n') if _.strip()]) # avoid some single newline content with many spaces + # print('after strip text: ', text) + + if text: # Check if the stripped text is not empty + if text.startswith(''): + pred_all.append({ + 'category_type': 'html_table', + 'position': position, + 'content': text, + }) + + elif text.startswith('$') and text.endswith('$'): + if text.replace('$', '').strip(): + pred_all.append({ + 'category_type': 'equation_isolated', + 'position': position, + 'content': text.strip(), + }) + else: + text = text.strip() + if text: + pred_all.append({ + 'category_type': 'text_all', + 'position': position, + 'content': text, + 'fine_category_type': 'text_block' + }) + + pred_dataset = defaultdict(list) + pred_all = sorted(pred_all, key=lambda x: x['position'][0]) + for item in pred_all: + pred_dataset[item['category_type']].append(item) + # pdb.set_trace() + return pred_dataset + + +def extract_tex_table(content): + tables = [] + tables_positions = [] + + pattern = r'\\begin{table}(.*?)\\end{table}' + for match in re.finditer(pattern, content, re.DOTALL): + start_pos = match.start() + end_pos = match.end() + table_content = match.group(0) + tables.append(table_content) + tables_positions.append((start_pos, end_pos)) + content = content[:start_pos] + ' '*(end_pos-start_pos) + content[end_pos:] + + tabulars, tabular_positions = extract_tabular(content) + all_tables = tables + tabulars + all_positions = tables_positions + tabular_positions + + all_result = sorted([[pos, table]for pos, table in zip(all_positions, all_tables)], key=lambda x: x[0][0]) + all_tables = [x[1] for x in all_result] + all_positions = [x[0] for x in all_result] + + return all_tables, all_positions + + +def extract_html_table(text): + begin_pattern = r']*)>' + end_pattern = r'' + + tabulars = [] + positions = [] + current_pos = 0 + stack = [] + + while current_pos < len(text): + begin_match = re.search(begin_pattern, text[current_pos:]) + end_match = re.search(end_pattern, text[current_pos:]) + + if not begin_match and not end_match: + break + + if begin_match and (not end_match or begin_match.start() < end_match.start()): + stack.append(current_pos + begin_match.start()) + current_pos += begin_match.start() + len(end_pattern) + elif end_match: + if stack: + start_pos = stack.pop() + if not stack: + end_pos = current_pos + end_match.start() + len(end_pattern) + tabular_code = text[start_pos:end_pos] + tabulars.append(tabular_code) + positions.append((start_pos, end_pos)) + current_pos += end_match.start() + len(end_pattern) + else: + current_pos += 1 + + if stack: + new_start = stack[0] + len(begin_pattern) + new_tabulars, new_positions = extract_html_table(text[new_start:]) + new_positions = [(start + new_start, end + new_start) for start, end in new_positions] + tabulars.extend(new_tabulars) + positions.extend(new_positions) + + return tabulars, positions + + +def extract_node_content(node): + """ Recursively extract content from LatexEnvironmentNode and rebuild LaTeX table representation """ + if isinstance(node, LatexCharsNode): + return node.chars # Use chars attribute + elif isinstance(node, LatexGroupNode): + return "{" + "".join(extract_node_content(n) for n in node.nodelist) + "}" + elif isinstance(node, LatexMacroNode): + # Extract macro command and its arguments + macro_content = "\\" + node.macroname + if node.nodeargs: + macro_content += "".join([extract_node_content(arg) for arg in node.nodeargs]) + return macro_content + elif isinstance(node, LatexEnvironmentNode): + # Extract environment, preserve environment name and arguments + content = "\\begin{" + node.environmentname + "}" + if node.nodeargd and node.nodeargd.argnlist: + # content += "".join("{" + extract_node_content(arg) + "}" for arg in node.nodeargd) + # content += "".join("{" + extract_node_content(node.nodeargd) + "}") + content += "{" + extract_node_content(node.nodeargd.argnlist[0]) + "}" + if node.nodelist: + content += "".join(extract_node_content(n) for n in node.nodelist) + content += "\\end{" + node.environmentname + "}" + return content + elif isinstance(node, LatexSpecialsNode): # Changed to LatexSpecialsNode + return node.specials_chars + else: + return "" + +def get_node_end_pos(node): + """Recursively determine the end position of a node""" + if hasattr(node, 'nodelist') and node.nodelist: + # If the node has child nodes, recursively find the end position of the last child node + return get_node_end_pos(node.nodelist[-1]) + elif hasattr(node, 'pos_end'): + # If the node has pos_end attribute, return it directly + return node.pos_end + else: + # If there are no child nodes, assume the node ends at the last character of its content + return node.pos + len(str(node)) + +def remove_tex_table(content): + tables, positions = extract_tex_table(content) + + # Delete in reverse order by position to avoid affecting unprocessed start positions + for start, end in sorted(positions, reverse=True): + content = content[:start] + content[end:] # Remove table content + + return content + + + +def get_pred_category_type(pred_idx, pred_items): + # if pred_idx: + if pred_items[pred_idx].get('fine_category_type'): + pred_pred_category_type = pred_items[pred_idx]['fine_category_type'] + else: + pred_pred_category_type = pred_items[pred_idx]['category_type'] + # else: + # pred_pred_category_type = "" + return pred_pred_category_type + + +def compute_edit_distance_matrix_new(gt_lines, matched_lines): + try: + distance_matrix = np.zeros((len(gt_lines), len(matched_lines))) + for i, gt_line in enumerate(gt_lines): + for j, matched_line in enumerate(matched_lines): + if len(gt_line) == 0 and len(matched_line) == 0: + distance_matrix[i][j] = 0 + else: + distance_matrix[i][j] = Levenshtein.distance(gt_line, matched_line) / max(len(matched_line), len(gt_line)) + return distance_matrix + except ZeroDivisionError: + #print("ZeroDivisionError occurred. Outputting norm_gt_lines and norm_pred_lines:") + # print("norm_gt_lines:", gt_lines) + # print("norm_pred_lines:", matched_lines) + raise + +def get_gt_pred_lines(gt_items, pred_items, line_type): + norm_html_lines = [] + gt_lines = [] + gt_cat_list = [] + for item in gt_items: + if item.get('fine_category_type'): + gt_cat_list.append(item['fine_category_type']) + else: + gt_cat_list.append(item['category_type']) + if item.get('content'): + gt_lines.append(str(item['content'])) + norm_html_lines.append(str(item['content'])) + elif line_type == 'text': + gt_lines.append(str(item['text'])) + elif line_type == 'html_table': + gt_lines.append(str(item['html'])) + elif line_type == 'formula': + gt_lines.append(str(item['latex'])) + elif line_type == 'latex_table': + gt_lines.append(str(item['latex'])) + norm_html_lines.append(str(item['html'])) + + pred_lines = [str(item['content']) for item in pred_items] + + + if line_type == 'formula': + norm_gt_lines = [normalized_formula(_) for _ in gt_lines] + norm_pred_lines = [normalized_formula(_) for _ in pred_lines] + elif line_type == 'text': + # norm_gt_lines = [textblock_with_norm_formula(_) for _ in gt_lines] + # norm_pred_lines = [textblock_with_norm_formula(_) for _ in pred_lines] + norm_gt_lines = [clean_string(textblock2unicode(_)) for _ in gt_lines] + norm_pred_lines = [clean_string(textblock2unicode(_)) for _ in pred_lines] + # norm_gt_lines = get_norm_text_lines(gt_lines) + # norm_pred_lines = get_norm_text_lines(pred_lines) + else: + norm_gt_lines = gt_lines + norm_pred_lines = pred_lines + + if line_type == 'latex_table': + gt_lines = norm_html_lines + + + filtered_lists = [(a, b, c) for a, b, c in zip(gt_lines, norm_gt_lines, gt_cat_list) if a and b] + + # decompress to three lists + if filtered_lists: + gt_lines_c, norm_gt_lines_c, gt_cat_list_c = zip(*filtered_lists) + + # convert to lists + gt_lines_c = list(gt_lines_c) + norm_gt_lines_c = list(norm_gt_lines_c) + gt_cat_list_c = list(gt_cat_list_c) + else: + gt_lines_c = [] + norm_gt_lines_c = [] + gt_cat_list_c = [] + + # pred's empty values + filtered_lists = [(a, b) for a, b in zip(pred_lines, norm_pred_lines) if a and b] + + # decompress to two lists + if filtered_lists: + pred_lines_c, norm_pred_lines_c = zip(*filtered_lists) + + # convert to lists + pred_lines_c = list(pred_lines_c) + norm_pred_lines_c = list(norm_pred_lines_c) + else: + pred_lines_c = [] + norm_pred_lines_c = [] + + return gt_lines_c, norm_gt_lines_c, gt_cat_list_c, pred_lines_c, norm_pred_lines_c + # return gt_lines, norm_gt_lines, gt_cat_list, pred_lines, norm_pred_lines + + +def match_gt2pred_simple(gt_items, pred_items, line_type, img_name): + + gt_lines, norm_gt_lines, gt_cat_list, pred_lines, norm_pred_lines = get_gt_pred_lines(gt_items, pred_items, line_type) + + match_list = [] + if not norm_gt_lines: # not matched pred should be concatenated + # print("One of the lists is empty. Returning an empty gt result.") + # for pred_idx in range(len(norm_pred_lines)): + pred_idx_list = range(len(norm_pred_lines)) + match_list.append({ + 'gt_idx': [""], + 'gt': "", + 'pred_idx': pred_idx_list, + 'pred': ''.join(pred_lines[_] for _ in pred_idx_list), + 'gt_position': [""], + 'pred_position': pred_items[pred_idx_list[0]]['position'][0], # get the first pred's position + 'norm_gt': "", + 'norm_pred': ''.join(norm_pred_lines[_] for _ in pred_idx_list), + 'gt_category_type': "", + 'pred_category_type': get_pred_category_type(pred_idx_list[0], pred_items), # get the first pred's category + 'gt_attribute': [{}], + 'edit': 1, + 'img_id': img_name + }) + return match_list + elif not norm_pred_lines: # not matched gt should be separated + # print("One of the lists is empty. Returning an empty pred result.") + for gt_idx in range(len(norm_gt_lines)): + match_list.append({ + 'gt_idx': [gt_idx], + 'gt': gt_lines[gt_idx], + 'pred_idx': [""], + 'pred': "", + 'gt_position': [gt_items[gt_idx].get('order') if gt_items[gt_idx].get('order') else gt_items[gt_idx].get('position', [""])[0]], + 'pred_position': "", + 'norm_gt': norm_gt_lines[gt_idx], + 'norm_pred': "", + 'gt_category_type': gt_cat_list[gt_idx], + 'pred_category_type': "", + 'gt_attribute': [gt_items[gt_idx].get("attribute", {})], + 'edit': 1, + 'img_id': img_name + }) + return match_list + + cost_matrix = compute_edit_distance_matrix_new(norm_gt_lines, norm_pred_lines) + + row_ind, col_ind = linear_sum_assignment(cost_matrix) + + + for gt_idx in range(len(norm_gt_lines)): + if gt_idx in row_ind: + row_i = list(row_ind).index(gt_idx) + pred_idx = int(col_ind[row_i]) + pred_line = pred_lines[pred_idx] + norm_pred_line = norm_pred_lines[pred_idx] + edit = cost_matrix[gt_idx][pred_idx] + # print('edit_dist', edit) + # if edit > 0.7: + # print('! Not match') + else: + # print('No match pred') + pred_idx = "" + pred_line = "" + norm_pred_line = "" + edit = 1 + + match_list.append({ + 'gt_idx': [gt_idx], + 'gt': gt_lines[gt_idx], + 'norm_gt': norm_gt_lines[gt_idx], + 'gt_category_type': gt_cat_list[gt_idx], + 'gt_position': [gt_items[gt_idx].get('order') if gt_items[gt_idx].get('order') else gt_items[gt_idx].get('position', [""])[0]], + 'gt_attribute': [gt_items[gt_idx].get("attribute", {})], + 'pred_idx': [pred_idx], + 'pred': pred_line, + 'norm_pred': norm_pred_line, + 'pred_category_type': get_pred_category_type(pred_idx, pred_items) if pred_idx else "", + 'pred_position': pred_items[pred_idx]['position'][0] if pred_idx else "", + 'edit': edit, + 'img_id': img_name + }) + # print('-'*10) + # [([0,1], 0),(2, 1), (1,2)] --> [0,2,1]/[0,1,2] + + pred_idx_list = [pred_idx for pred_idx in range(len(norm_pred_lines)) if pred_idx not in col_ind] # get not matched preds + if pred_idx_list: # if there are still remaining pred_idx, concatenate all preds + match_list.append({ + 'gt_idx': [""], + 'gt': "", + 'pred_idx': pred_idx_list, + 'pred': ''.join(pred_lines[_] for _ in pred_idx_list), + 'gt_position': [""], + 'pred_position': pred_items[pred_idx_list[0]]['position'][0], # get the first pred's position + 'norm_gt': "", + 'norm_pred': ''.join(norm_pred_lines[_] for _ in pred_idx_list), + 'gt_category_type': "", + 'pred_category_type': get_pred_category_type(pred_idx_list[0], pred_items), # get the first pred's category + 'gt_attribute': [{}], + 'edit': 1, + 'img_id': img_name + }) + return match_list + + +def match_gt2pred_no_split(gt_items, pred_items, line_type, img_name): + # directly concatenate gt and pred by position + gt_lines, norm_gt_lines, gt_cat_list, pred_lines, norm_pred_lines = get_gt_pred_lines(gt_items, pred_items, line_type) + gt_line_with_position = [] + for gt_line, norm_gt_line, gt_item in zip(gt_lines, norm_gt_lines, gt_items): + gt_position = gt_item['order'] if gt_item.get('order') else gt_item.get('position', [""])[0] + if gt_position: + gt_line_with_position.append((gt_position, gt_line, norm_gt_line)) + sorted_gt_lines = sorted(gt_line_with_position, key=lambda x: x[0]) + gt = '\n\n'.join([_[1] for _ in sorted_gt_lines]) + norm_gt = '\n\n'.join([_[2] for _ in sorted_gt_lines]) + pred_line_with_position = [(pred_item['position'], pred_line, pred_norm_line) for pred_line, pred_norm_line, pred_item in zip(pred_lines, norm_pred_lines, pred_items)] + sorted_pred_lines = sorted(pred_line_with_position, key=lambda x: x[0]) + pred = '\n\n'.join([_[1] for _ in sorted_pred_lines]) + norm_pred = '\n\n'.join([_[2] for _ in sorted_pred_lines]) + # edit = Levenshtein.distance(norm_gt, norm_pred)/max(len(norm_gt), len(norm_pred)) + if norm_gt or norm_pred: + return [{ + 'gt_idx': [0], + 'gt': gt, + 'norm_gt': norm_gt, + 'gt_category_type': "text_merge", + 'gt_position': [""], + 'gt_attribute': [{}], + 'pred_idx': [0], + 'pred': pred, + 'norm_pred': norm_pred, + 'pred_category_type': "text_merge", + 'pred_position': "", + # 'edit': edit, + 'img_id': img_name + }] + else: + return [] + + +from scipy.optimize import linear_sum_assignment +# from rapidfuzz.distance import Levenshtein +import Levenshtein +from collections import defaultdict +import copy +import pdb +import numpy as np +import evaluate +from collections import Counter +from Levenshtein import distance as Levenshtein_distance + + +def match_gt2pred_quick(gt_items, pred_items, line_type, img_name): + + gt_lines, norm_gt_lines, gt_cat_list, pred_lines, norm_pred_lines= get_gt_pred_lines(gt_items, pred_items, line_type) + all_gt_indices = set(range(len(norm_gt_lines))) + all_pred_indices = set(range(len(norm_pred_lines))) + + if not norm_gt_lines: + match_list = [] + for pred_idx in range(len(norm_pred_lines)): + match_list.append({ + 'gt_idx': [""], + 'gt': "", + 'pred_idx': [pred_idx], + 'pred': pred_lines[pred_idx], + 'gt_position': "", + 'pred_position': pred_items[pred_idx]['position'][0], + 'norm_gt': "", + 'norm_pred': norm_pred_lines[pred_idx], + 'gt_category_type': "", + 'pred_category_type': get_pred_category_type(pred_idx, pred_items), + 'gt_attribute': [{}], + 'edit': 1, + 'img_id': img_name + }) + return match_list + elif not norm_pred_lines: + match_list = [] + for gt_idx in range(len(norm_gt_lines)): + match_list.append({ + 'gt_idx': [gt_idx], + 'gt': gt_lines[gt_idx], + 'pred_idx': [""], + 'pred': "", + 'gt_position': [gt_items[gt_idx].get('order') if gt_items[gt_idx].get('order') else gt_items[gt_idx].get('position', [""])[0]], + 'pred_position': "", + 'norm_gt': norm_gt_lines[gt_idx], + 'norm_pred': "", + 'gt_category_type': gt_cat_list[gt_idx], + 'pred_category_type': "", + 'gt_attribute': [gt_items[gt_idx].get("attribute", {})], + 'edit': 1, + 'img_id': img_name + }) + return match_list + elif len(norm_gt_lines) == 1 and len(norm_pred_lines) == 1: + edit_distance = Levenshtein_distance(norm_gt_lines[0], norm_pred_lines[0]) + normalized_edit_distance = edit_distance / max(len(norm_gt_lines[0]), len(norm_pred_lines[0])) + return [{ + 'gt_idx': [0], + 'gt': gt_lines[0], + 'pred_idx': [0], + 'pred': pred_lines[0], + 'gt_position': [gt_items[0].get('order') if gt_items[0].get('order') else gt_items[0].get('position', [""])[0]], + 'pred_position': pred_items[0]['position'][0], + 'norm_gt': norm_gt_lines[0], + 'norm_pred': norm_pred_lines[0], + 'gt_category_type': gt_cat_list[0], + 'pred_category_type': get_pred_category_type(0, pred_items), + 'gt_attribute': [gt_items[0].get("attribute", {})], + 'edit': normalized_edit_distance, + 'img_id': img_name + }] + + cost_matrix = compute_edit_distance_matrix_new(norm_gt_lines, norm_pred_lines) + + matched_col_idx, row_ind, cost_list = cal_final_match(cost_matrix, norm_gt_lines, norm_pred_lines) + + gt_lens_dict, pred_lens_dict = initialize_indices(norm_gt_lines, norm_pred_lines) + + matches, unmatched_gt_indices, unmatched_pred_indices = process_matches(matched_col_idx, row_ind, cost_list, norm_gt_lines, norm_pred_lines, pred_lines) + + matching_dict = fuzzy_match_unmatched_items(unmatched_gt_indices, norm_gt_lines, norm_pred_lines) + + final_matches = merge_matches(matches, matching_dict) + + recalculate_edit_distances(final_matches, gt_lens_dict, norm_gt_lines, norm_pred_lines) + + converted_results = convert_final_matches(final_matches, norm_gt_lines, norm_pred_lines) + + merged_results = merge_duplicates_add_unmatched(converted_results, norm_gt_lines, norm_pred_lines, gt_lines, pred_lines, all_gt_indices, all_pred_indices) + + for entry in merged_results: + entry['gt_idx'] = [entry['gt_idx']] if not isinstance(entry['gt_idx'], list) else entry['gt_idx'] + entry['pred_idx'] = [entry['pred_idx']] if not isinstance(entry['pred_idx'], list) else entry['pred_idx'] + entry['gt_position'] = [gt_items[_].get('order') if gt_items[_].get('order') else gt_items[_].get('position', [""])[0] for _ in entry['gt_idx']] if entry['gt_idx'] != [""] else [""] + entry['pred_position'] = pred_items[entry['pred_idx'][0]]['position'][0] if entry['pred_idx'] != [""] else "" + entry['gt'] = ''.join([gt_lines[_] for _ in entry['gt_idx']]) if entry['gt_idx'] != [""] else "" + entry['pred'] = ''.join([pred_lines[_] for _ in entry['pred_idx']]) if entry['pred_idx'] != [""] else "" + entry['norm_gt'] = ''.join([norm_gt_lines[_] for _ in entry['gt_idx']]) if entry['gt_idx'] != [""] else "" + entry['norm_pred'] = ''.join([norm_pred_lines[_] for _ in entry['pred_idx']]) if entry['pred_idx'] != [""] else "" + + if entry['gt_idx'] != [""]: + ignore_type = ['figure_caption', 'figure_footnote', 'table_caption', 'table_footnote', 'code_algorithm', 'code_algorithm_caption', 'header', 'footer', 'page_footnote', 'page_number', 'equation_caption'] + gt_cagegory_clean = [gt_cat_list[_] for _ in entry['gt_idx'] if gt_cat_list[_] not in ignore_type] + if gt_cagegory_clean: + entry['gt_category_type'] = Counter(gt_cagegory_clean).most_common(1)[0][0] + else: + entry['gt_category_type'] = Counter([gt_cat_list[_] for _ in entry['gt_idx']]).most_common(1)[0][0] + else: + entry['gt_category_type'] = "" + entry['pred_category_type'] = get_pred_category_type(entry['pred_idx'][0], pred_items) if entry['pred_idx'] != [""] else "" + entry['gt_attribute'] = [gt_items[_].get("attribute", {}) for _ in entry['gt_idx']] if entry['gt_idx'] != [""] else [{}] + entry['img_id'] = img_name + + return merged_results + + +def merge_duplicates_add_unmatched(converted_results, norm_gt_lines, norm_pred_lines, gt_lines, pred_lines, all_gt_indices, all_pred_indices): + merged_results = [] + processed_pred = set() + processed_gt = set() + + for entry in converted_results: + pred_idx = tuple(entry['pred_idx']) if isinstance(entry['pred_idx'], list) else (entry['pred_idx'],) + if pred_idx not in processed_pred and pred_idx != ("",): + merged_entry = { + 'gt_idx': [entry['gt_idx']], + 'gt': entry['gt'], + 'pred_idx': entry['pred_idx'], + 'pred': entry['pred'], + 'edit': entry['edit'] + } + for other_entry in converted_results: + other_pred_idx = tuple(other_entry['pred_idx']) if isinstance(other_entry['pred_idx'], list) else (other_entry['pred_idx'],) + if other_pred_idx == pred_idx and other_entry is not entry: + merged_entry['gt_idx'].append(other_entry['gt_idx']) + merged_entry['gt'] += other_entry['gt'] + processed_gt.add(other_entry['gt_idx']) + merged_results.append(merged_entry) + processed_pred.add(pred_idx) + processed_gt.add(entry['gt_idx']) + + for entry in converted_results: + if entry['gt_idx'] not in processed_gt: + merged_results.append(entry) + + for gt_idx in range(len(norm_gt_lines)): + if gt_idx not in processed_gt: + merged_results.append({ + 'gt_idx': [gt_idx], + 'gt': gt_lines[gt_idx], + 'pred_idx': [""], + 'pred': "", + 'edit': 1 + }) + return merged_results + + + + +def formula_format(formula_matches, img_name): + return [ + { + "gt": item["gt"], + "pred": item["pred"], + "img_id": f"{img_name}_{i}" + } + for i, item in enumerate(formula_matches) + ] + + +def merge_lists_with_sublists(main_list, sub_lists): + main_list_final = list(copy.deepcopy(main_list)) + for sub_list in sub_lists: + pop_idx = main_list_final.index(sub_list[0]) + for _ in sub_list: + main_list_final.pop(pop_idx) + main_list_final.insert(pop_idx, sub_list) + return main_list_final + + +def sub_pred_fuzzy_matching(gt, pred): + + min_d = float('inf') + # pos = -1 + + gt_len = len(gt) + pred_len = len(pred) + + if gt_len >= pred_len and pred_len > 0: + for i in range(gt_len - pred_len + 1): + sub = gt[i:i + pred_len] + dist = Levenshtein_distance(sub, pred)/pred_len + if dist < min_d: + min_d = dist + pos = i + + return min_d + else: + return False + +def sub_gt_fuzzy_matching(pred, gt): + + min_d = float('inf') + pos = "" + matched_sub = "" + gt_len = len(gt) + pred_len = len(pred) + + if pred_len >= gt_len and gt_len > 0: + for i in range(pred_len - gt_len + 1): + sub = pred[i:i + gt_len] + dist = Levenshtein.distance(sub, gt) /gt_len + if dist < min_d: + min_d = dist + pos = i + matched_sub = sub + return min_d, pos, gt_len, matched_sub + else: + return 1, "", gt_len, "" + + +def get_final_subset(subset_certain, subset_certain_cost): + if not subset_certain or not subset_certain_cost: + return [] + + subset_turple = sorted([(a, b) for a, b in zip(subset_certain, subset_certain_cost)], key=lambda x: x[0][0]) + + group_list = defaultdict(list) + group_idx = 0 + group_list[group_idx].append(subset_turple[0]) + + for item in subset_turple[1:]: + overlap_flag = False + for subset in group_list[group_idx]: + for idx in item[0]: + if idx in subset[0]: + overlap_flag = True + break + if overlap_flag: + break + if overlap_flag: + group_list[group_idx].append(item) + else: + group_idx += 1 + group_list[group_idx].append(item) + + final_subset = [] + for _, group in group_list.items(): + if len(group) == 1: + final_subset.append(group[0][0]) + else: + path_dict = defaultdict(list) + path_idx = 0 + path_dict[path_idx].append(group[0]) + + for subset in group[1:]: + new_path = True + for path_idx_s, path_items in path_dict.items(): + is_dup = False + is_same = False + for path_item in path_items: + if path_item[0] == subset[0]: + is_dup = True + is_same = True + if path_item[1] > subset[1]: + path_dict[path_idx_s].pop(path_dict[path_idx_s].index(path_item)) + path_dict[path_idx_s].append(subset) + else: + for num_1 in path_item[0]: + for num_2 in subset[0]: + if num_1 == num_2: + is_dup = True + if not is_dup: + path_dict[path_idx_s].append(subset) + new_path = False + if is_same: + new_path = False + if new_path: + path_idx = len(path_dict.keys()) + path_dict[path_idx].append(subset) + + saved_cost = float('inf') + saved_subset = [] + for path_idx, path in path_dict.items(): + avg_cost = sum([i[1] for i in path]) / len(path) + if avg_cost < saved_cost: + saved_subset = [i[0] for i in path] + saved_cost = avg_cost + + final_subset.extend(saved_subset) + + return final_subset + +def judge_pred_merge(gt_list, pred_list, threshold=0.6): + if len(pred_list) == 1: + return False, False + + cur_pred = ' '.join(pred_list[:-1]) + merged_pred = ' '.join(pred_list) + + cur_dist = Levenshtein.distance(gt_list[0], cur_pred) / max(len(gt_list[0]), len(cur_pred)) + merged_dist = Levenshtein.distance(gt_list[0], merged_pred) / max(len(gt_list[0]), len(merged_pred)) + + if merged_dist > cur_dist: + return False, False + + cur_fuzzy_dists = [sub_pred_fuzzy_matching(gt_list[0], cur_pred) for cur_pred in pred_list[:-1]] + if any(dist is False or dist > threshold for dist in cur_fuzzy_dists): + return False, False + + add_fuzzy_dist = sub_pred_fuzzy_matching(gt_list[0], pred_list[-1]) + if add_fuzzy_dist is False: + return False, False + + merged_pred_flag = add_fuzzy_dist < threshold + continue_flag = len(merged_pred) <= len(gt_list[0]) + + return merged_pred_flag, continue_flag + +def deal_with_truncated(cost_matrix, norm_gt_lines, norm_pred_lines): + matched_first = np.argwhere(cost_matrix < 0.25) + masked_gt_idx = [i[0] for i in matched_first] + unmasked_gt_idx = [i for i in range(cost_matrix.shape[0]) if i not in masked_gt_idx] + masked_pred_idx = [i[1] for i in matched_first] + unmasked_pred_idx = [i for i in range(cost_matrix.shape[1]) if i not in masked_pred_idx] + + merges_gt_dict = {} + merges_pred_dict = {} + merged_gt_subsets = [] + + for gt_idx in unmasked_gt_idx: + check_merge_subset = [] + merged_dist = [] + + for pred_idx in unmasked_pred_idx: + step = 1 + merged_pred = [norm_pred_lines[pred_idx]] + + while True: + if pred_idx + step in masked_pred_idx or pred_idx + step >= len(norm_pred_lines): + break + else: + merged_pred.append(norm_pred_lines[pred_idx + step]) + merged_pred_flag, continue_flag = judge_pred_merge([norm_gt_lines[gt_idx]], merged_pred) + if not merged_pred_flag: + break + else: + step += 1 + if not continue_flag: + break + + check_merge_subset.append(list(range(pred_idx, pred_idx + step))) + matched_line = ' '.join([norm_pred_lines[i] for i in range(pred_idx, pred_idx + step)]) + dist = Levenshtein_distance(norm_gt_lines[gt_idx], matched_line) / max(len(matched_line), len(norm_gt_lines[gt_idx])) + merged_dist.append(dist) + + if not merged_dist: + subset_certain = [] + min_cost_idx = "" + min_cost = float('inf') + else: + min_cost = min(merged_dist) + min_cost_idx = merged_dist.index(min_cost) + subset_certain = check_merge_subset[min_cost_idx] + + merges_gt_dict[gt_idx] = { + 'merge_subset': check_merge_subset, + 'merged_cost': merged_dist, + 'min_cost_idx': min_cost_idx, + 'subset_certain': subset_certain, + 'min_cost': min_cost + } + + subset_certain = [merges_gt_dict[gt_idx]['subset_certain'] for gt_idx in unmasked_gt_idx if merges_gt_dict[gt_idx]['subset_certain']] + subset_certain_cost = [merges_gt_dict[gt_idx]['min_cost'] for gt_idx in unmasked_gt_idx if merges_gt_dict[gt_idx]['subset_certain']] + + subset_certain_final = get_final_subset(subset_certain, subset_certain_cost) + + if not subset_certain_final: + return cost_matrix, norm_pred_lines, range(len(norm_pred_lines)) + + final_pred_idx_list = merge_lists_with_sublists(range(len(norm_pred_lines)), subset_certain_final) + final_norm_pred_lines = [' '.join(norm_pred_lines[idx_list[0]:idx_list[-1]+1]) if isinstance(idx_list, list) else norm_pred_lines[idx_list] for idx_list in final_pred_idx_list] + + new_cost_matrix = compute_edit_distance_matrix_new(norm_gt_lines, final_norm_pred_lines) + + return new_cost_matrix, final_norm_pred_lines, final_pred_idx_list + +def cal_move_dist(gt, pred): + assert len(gt) == len(pred), 'Not right length' + step = 0 + for i, gt_c in enumerate(gt): + if gt_c != pred[i]: + step += abs(i - pred.index(gt_c)) + pred[i], pred[pred.index(gt_c)] = pred[pred.index(gt_c)], pred[i] + return step / len(gt) + +def cal_final_match(cost_matrix, norm_gt_lines, norm_pred_lines): + min_indice = cost_matrix.argmax(axis=1) + + new_cost_matrix, final_norm_pred_lines, final_pred_idx_list = deal_with_truncated(cost_matrix, norm_gt_lines, norm_pred_lines) + + row_ind, col_ind = linear_sum_assignment(new_cost_matrix) + + cost_list = [new_cost_matrix[r][c] for r, c in zip(row_ind, col_ind)] + matched_col_idx = [final_pred_idx_list[i] for i in col_ind] + + return matched_col_idx, row_ind, cost_list + +def initialize_indices(norm_gt_lines, norm_pred_lines): + gt_lens_dict = {idx: len(gt_line) for idx, gt_line in enumerate(norm_gt_lines)} + pred_lens_dict = {idx: len(pred_line) for idx, pred_line in enumerate(norm_pred_lines)} + return gt_lens_dict, pred_lens_dict + +def process_matches(matched_col_idx, row_ind, cost_list, norm_gt_lines, norm_pred_lines, pred_lines): + matches = {} + unmatched_gt_indices = [] + unmatched_pred_indices = [] + + for i in range(len(norm_gt_lines)): + if i in row_ind: + idx = list(row_ind).index(i) + pred_idx = matched_col_idx[idx] + + if pred_idx is None or (isinstance(pred_idx, list) and None in pred_idx): + unmatched_pred_indices.append(pred_idx) + continue + + if isinstance(pred_idx, list): + pred_line = ' | '.join(norm_pred_lines[pred_idx[0]:pred_idx[-1]+1]) + ori_pred_line = ' | '.join(pred_lines[pred_idx[0]:pred_idx[-1]+1]) + matched_pred_indices_range = list(range(pred_idx[0], pred_idx[-1]+1)) + else: + pred_line = norm_pred_lines[pred_idx] + ori_pred_line = pred_lines[pred_idx] + matched_pred_indices_range = [pred_idx] + + edit = cost_list[idx] + + if edit > 0.7: + unmatched_pred_indices.extend(matched_pred_indices_range) + unmatched_gt_indices.append(i) + else: + matches[i] = { + 'pred_indices': matched_pred_indices_range, + 'edit_distance': edit, + } + for matched_pred_idx in matched_pred_indices_range: + if matched_pred_idx in unmatched_pred_indices: + unmatched_pred_indices.remove(matched_pred_idx) + else: + unmatched_gt_indices.append(i) + + return matches, unmatched_gt_indices, unmatched_pred_indices + +def fuzzy_match_unmatched_items(unmatched_gt_indices, norm_gt_lines, norm_pred_lines): + matching_dict = {} + + for pred_idx, pred_content in enumerate(norm_pred_lines): + if isinstance(pred_idx, list): + continue + + matching_indices = [] + + for unmatched_gt_idx in unmatched_gt_indices: + gt_content = norm_gt_lines[unmatched_gt_idx] + cur_fuzzy_dist_unmatch, cur_pos, gt_lens, matched_field = sub_gt_fuzzy_matching(pred_content, gt_content) + if cur_fuzzy_dist_unmatch < 0.4: + matching_indices.append(unmatched_gt_idx) + + if matching_indices: + matching_dict[pred_idx] = matching_indices + + return matching_dict + +def merge_matches(matches, matching_dict): + final_matches = {} + processed_gt_indices = set() + + for gt_idx, match_info in matches.items(): + pred_indices = match_info['pred_indices'] + edit_distance = match_info['edit_distance'] + + pred_key = tuple(sorted(pred_indices)) + + if pred_key in final_matches: + if gt_idx not in processed_gt_indices: + final_matches[pred_key]['gt_indices'].append(gt_idx) + processed_gt_indices.add(gt_idx) + else: + final_matches[pred_key] = { + 'gt_indices': [gt_idx], + 'edit_distance': edit_distance + } + processed_gt_indices.add(gt_idx) + + for pred_idx, gt_indices in matching_dict.items(): + pred_key = (pred_idx,) if not isinstance(pred_idx, (list, tuple)) else tuple(sorted(pred_idx)) + + if pred_key in final_matches: + for gt_idx in gt_indices: + if gt_idx not in processed_gt_indices: + final_matches[pred_key]['gt_indices'].append(gt_idx) + processed_gt_indices.add(gt_idx) + else: + final_matches[pred_key] = { + 'gt_indices': [gt_idx for gt_idx in gt_indices if gt_idx not in processed_gt_indices], + 'edit_distance': None + } + processed_gt_indices.update(final_matches[pred_key]['gt_indices']) + + return final_matches + + + +def recalculate_edit_distances(final_matches, gt_lens_dict, norm_gt_lines, norm_pred_lines): + for pred_key, info in final_matches.items(): + gt_indices = sorted(set(info['gt_indices'])) + + if not gt_indices: + info['edit_distance'] = 1 + continue + + if len(gt_indices) > 1: + merged_gt_content = ''.join(norm_gt_lines[gt_idx] for gt_idx in gt_indices) + pred_content = norm_pred_lines[pred_key[0]] if isinstance(pred_key[0], int) else '' + + try: + edit_distance = Levenshtein_distance(merged_gt_content, pred_content) + normalized_edit_distance = edit_distance / max(len(merged_gt_content), len(pred_content)) + except ZeroDivisionError: + normalized_edit_distance = 1 + + info['edit_distance'] = normalized_edit_distance + else: + gt_idx = gt_indices[0] + pred_content = ' '.join(norm_pred_lines[pred_idx] for pred_idx in pred_key if isinstance(pred_idx, int)) + + try: + edit_distance = Levenshtein_distance(norm_gt_lines[gt_idx], pred_content) + normalized_edit_distance = edit_distance / max(len(norm_gt_lines[gt_idx]), len(pred_content)) + except ZeroDivisionError: + normalized_edit_distance = 1 + + info['edit_distance'] = normalized_edit_distance + info['pred_content'] = pred_content + + +def convert_final_matches(final_matches, norm_gt_lines, norm_pred_lines): + converted_results = [] + + all_gt_indices = set(range(len(norm_gt_lines))) + all_pred_indices = set(range(len(norm_pred_lines))) + + for pred_key, info in final_matches.items(): + pred_content = ' '.join(norm_pred_lines[pred_idx] for pred_idx in pred_key if isinstance(pred_idx, int)) + + for gt_idx in sorted(set(info['gt_indices'])): + result_entry = { + 'gt_idx': int(gt_idx), + 'gt': norm_gt_lines[gt_idx], + 'pred_idx': list(pred_key), + 'pred': pred_content, + 'edit': info['edit_distance'] + } + converted_results.append(result_entry) + + matched_gt_indices = set().union(*[set(info['gt_indices']) for info in final_matches.values()]) + unmatched_gt_indices = all_gt_indices - matched_gt_indices + matched_pred_indices = set(idx for pred_key in final_matches.keys() for idx in pred_key if isinstance(idx, int)) + unmatched_pred_indices = all_pred_indices - matched_pred_indices + + if unmatched_pred_indices: + if unmatched_gt_indices: + distance_matrix = [ + [Levenshtein_distance(norm_gt_lines[gt_idx], norm_pred_lines[pred_idx]) for pred_idx in unmatched_pred_indices] + for gt_idx in unmatched_gt_indices + ] + + row_ind, col_ind = linear_sum_assignment(distance_matrix) + + for i, j in zip(row_ind, col_ind): + gt_idx = list(unmatched_gt_indices)[i] + pred_idx = list(unmatched_pred_indices)[j] + result_entry = { + 'gt_idx': int(gt_idx), + 'gt': norm_gt_lines[gt_idx], + 'pred_idx': [pred_idx], + 'pred': norm_pred_lines[pred_idx], + 'edit': 1 + } + converted_results.append(result_entry) + + matched_gt_indices.update(list(unmatched_gt_indices)[i] for i in row_ind) + else: + result_entry = { + 'gt_idx': "", + 'gt': '', + 'pred_idx': list(unmatched_pred_indices), + 'pred': ' '.join(norm_pred_lines[pred_idx] for pred_idx in unmatched_pred_indices), + 'edit': 1 + } + converted_results.append(result_entry) + else: + for gt_idx in unmatched_gt_indices: + result_entry = { + 'gt_idx': int(gt_idx), + 'gt': norm_gt_lines[gt_idx], + 'pred_idx': "", + 'pred': '', + 'edit': 1 + } + converted_results.append(result_entry) + + return converted_results + +import json + +def read_md_file(filepath): + with open(filepath, 'r', encoding='utf-8') as file: + content = file.read() + + return content + +def save_paired_result(preds, gts, save_path): + save_result = [] + formula_id = 0 + for gt, pred in zip(gts, preds): + save_result.append({ + "gt": gt, + "pred": pred, + "img_id": formula_id + }) + formula_id += 1 + with open(save_path, 'w', encoding='utf-8') as f: + json.dump(save_result, f, indent=4, ensure_ascii=False) + + +import matplotlib.pyplot as plt +import numpy as np +import os +import re +import matplotlib.font_manager as fm +font = fm.FontProperties(fname=r'font/SimHei.ttf') + + +def print_aligned_dict(data): + # Find the maximum length of all keys + max_key_length = max(len(key) for key in data['testcase1']) + + # Print header + print(f"{' ' * (max_key_length + 4)}", end="") + for key in data: + print(f"{key:>{max_key_length}}", end="") + print() + + # Print dictionary content + for subkey in data['testcase1']: + print(f"{subkey:<{max_key_length + 4}}", end="") + for key in data: + print(f"{data[key][subkey]:>{max_key_length}}", end="") + print() +def create_dict_from_folders(directory): + body = {} + for folder_name in os.listdir(directory): + folder_path = os.path.join(directory, folder_name) + if os.path.isdir(folder_path): + body[folder_name] = {} + return body + + +def create_radar_chart(df, title, filename): + labels = df.columns + + # Calculate angles + angles = np.linspace(0, 2 * np.pi, len(labels), endpoint=False).tolist() + angles += angles[:1] + + # Initialize radar chart + fig, ax = plt.subplots(figsize=(10, 6), subplot_kw=dict(polar=True), dpi=200) + # ax.spines['polar'].set_visible(False) + + # Draw radar chart for each dataset + for index, row in df.iterrows(): + values = row.tolist() + values += values[:1] + ax.fill(angles, values, alpha=0.1) + ax.plot(angles, values, label=index) + + # Add percentage labels next to each data point + for angle, value in zip(angles, values): + ax.text(angle, value, '{:.1%}'.format(value), ha='center', va='center', fontsize=7, alpha=0.7) + + # Set labels + ax.set_yticklabels([]) + ax.set_xticks(angles[:-1]) + ax.set_xticklabels(labels, fontproperties=font) + ax.spines['polar'].set_visible(False) # Hide the outermost circle + ax.grid(False) + for j in np.arange(0, 1.2, 0.2): + ax.plot(angles, len(values) * [j], '-.', lw=0.5, color='black', alpha=0.5) + for j in range(len(values)): + ax.plot([angles[j], angles[j]], [0, 1], '-.', lw=0.5, color='black', alpha=0.5) + + # Add title and legend + plt.legend(loc='upper right', bbox_to_anchor=(0.1, 0.1)) + + ax.tick_params(pad=30) + ax.set_theta_zero_location('N') + # Save chart to file + plt.savefig(filename) + +# The function is from https://github.com/intsig-textin/markdown_tester +def markdown_to_html(markdown_table): + rows = [row.strip() for row in markdown_table.strip().split('\n')] + num_columns = len(rows[0].split('|')) - 2 + + html_table = '\n \n \n' + + header_cells = [cell.strip() for cell in rows[0].split('|')[1:-1]] + for cell in header_cells: + html_table += f' \n' + html_table += ' \n \n \n' + + for row in rows[2:]: + cells = [cell.strip() for cell in row.split('|')[1:-1]] + html_table += ' \n' + for cell in cells: + html_table += f' \n' + html_table += ' \n' + + html_table += ' \n
{cell}
{cell}
\n' + return html_table +def convert_markdown_to_html(self, markdown_content, md_type): + # Define a regex pattern to find Markdown tables with newlines + markdown_content = markdown_content.replace('\r', '') + pattern = re.compile(r'\|\s*.*?\s*\|\n', re.DOTALL) + + # Find all matches in the Markdown content + matches = pattern.findall(markdown_content) + for match in matches: + html_table = markdown_to_html(match) + markdown_content = markdown_content.replace(match, html_table, 1) # Only replace the first occurrence + res_html = convert_table(replace_table_with_placeholder(markdown_content)) + + return res_html +def convert_table_str(s): + s = re.sub(r'','',s) + s = re.sub(r'','',s) + # s = re.sub(r'
',lambda x:f'',s) + # s = re.sub(r'',lambda x:f'',s) + res = '' + res += '\n\n' + temp_item = '' + for c in s: + temp_item += c + if c == '>' and not re.search(r'\$',temp_item): + res += temp_item+'\n' + temp_item = '' + return res+'\n' +def merge_table(md): + table_temp = '' + for line in md: + table_temp += line + return convert_table_str(table_temp) +def find_md_table_mode(line): + if re.search(r'-*?:',line) or re.search(r'---',line) or re.search(r':-*?',line): + return True + return False +def delete_table_and_body(input_list): + res = [] + for line in input_list: + if not re.search(r'',line): + res.append(line) + return res +def merge_tables(input_str): + # Delete HTML comments + input_str = re.sub(r'', '', input_str) + + # Use regex to find each block + table_blocks = re.findall(r'
[\s\S]*?
', input_str) + + # Process each block, replace ') + final_tr = delete_table_and_body(block_lines) + if len(final_tr) > 2: + output_lines.extend(final_tr) # Ignore
with + output_lines = [] + for block in table_blocks: + block_lines = block.split('\n') + for i, line in enumerate(block_lines): + if '' in line: + block_lines[i] = line.replace('', '').replace('', '
and
tags, keep only table content + + # Rejoin the processed strings + merged_output = '\n{}\n
'.format('\n'.join(output_lines)) + + return "\n\n" + merged_output + "\n\n" + +def replace_table_with_placeholder(input_string): + lines = input_string.split('\n') + output_lines = [] + + in_table_block = False + temp_block = "" + last_line = "" + + org_table_list = [] + in_org_table = False + + for idx, line in enumerate(lines): + # if not in_org_table: + # if "" not in last_line and in_table_block == False and temp_block != "": + # output_lines.append(merge_tables(temp_block)) + # temp_block = "" + if "
" in line: + # if "
" not in last_line: + temp_block += "\n" + last_line + if "
" in last_line: + if "" not in line: + in_table_block = False + output_lines.append(merge_tables(temp_block)) + temp_block = "" + else: + output_lines.append(last_line) + + last_line = line + # else: + # org_table_list.append(line) + # if "" in last_line: + temp_block += "\n" + last_line + output_lines.append(merge_tables(temp_block)) + else: + output_lines.append(last_line) + # if "
" in last_line: + # output_lines.append(merge_tables(temp_block)) + + return '\n'.join(output_lines) + +def convert_table(input_str): + # Replace + output_str = input_str.replace("
", "
") + + # Replace
+ output_str = output_str.replace("", "") + + return output_str + +def convert_markdown_to_html(markdown_content): + # Define a regex pattern to find Markdown tables with newlines + markdown_content = markdown_content.replace('\r', '')+'\n' + pattern = re.compile(r'\|\s*.*?\s*\|\n', re.DOTALL) + + # Find all matches in the Markdown content + matches = pattern.findall(markdown_content) + + for match in matches: + html_table = markdown_to_html(match) + markdown_content = markdown_content.replace(match, html_table, 1) # Only replace the first occurrence + + res_html = convert_table(replace_table_with_placeholder(markdown_content)) + + return res_html diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/IoUscore_metric.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/IoUscore_metric.py new file mode 100644 index 0000000000000000000000000000000000000000..8db4362b783d988058c9afc3bcf87304f82f364c --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/IoUscore_metric.py @@ -0,0 +1,87 @@ +# flake8: noqa +import os +import re +import ast +import ipdb +from vlmeval.dataset.utils.Ocrbench_v2.vqa_metric import vqa_evaluation + + +def calculate_iou(box1, box2): + + try: + box1 = [int(coordinate) for coordinate in box1] + box2 = [int(coordinate) for coordinate in box2] + except: + return 0 + + x1_inter = max(box1[0], box2[0]) + y1_inter = max(box1[1], box2[1]) + x2_inter = min(box1[2], box2[2]) + y2_inter = min(box1[3], box2[3]) + inter_area = max(0, x2_inter - x1_inter) * max(0, y2_inter - y1_inter) + box1_area = (box1[2] - box1[0]) * (box1[3] - box1[1]) + box2_area = (box2[2] - box2[0]) * (box2[3] - box2[1]) + union_area = box1_area + box2_area - inter_area + iou = inter_area / union_area if union_area != 0 else 0 + return iou + + +def vqa_with_position_evaluation(predict, img_metas): + + score_content, score_bbox = .0, .0 + if "answer" in predict.keys(): + score_content = vqa_evaluation(predict["answer"], img_metas["answers"]) + if "bbox" in predict.keys(): + gt_bbox = img_metas["bbox"] + try: + predict_bbox_list = ast.literal_eval(predict["bbox"]) + score_bbox = calculate_iou(predict_bbox_list, gt_bbox) + except: + score_bbox = 0 + return 0.5 * score_content + 0.5 * score_bbox + + +def extract_coordinates(text): + # Regex pattern to match coordinates in either (x1, y1, x2, y2) or [x1, y1, x2, y2] format + + pattern = r'[\(\[]\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*[\)\]]' + + matches = list(re.finditer(pattern, text)) + coords_list = [] + coords_set = set() + for match in matches: + + x1, y1, x2, y2 = map(int, match.groups()) + + if all(0 <= n <= 1000 for n in [x1, y1, x2, y2]): + coords = (x1, y1, x2, y2) + + if coords in coords_set: + coords_list = [c for c in coords_list if c != coords] + + coords_list.append(coords) + coords_set.add(coords) + if coords_list: + last_coords = coords_list[-1] + return list(last_coords) + else: + return None + + +if __name__ == "__main__": + + print("Example for Text Grounding task.") + box1 = [50, 50, 150, 150] + box2 = [60, 60, 140, 140] + iou_score = calculate_iou(box1, box2) + print(f"IoU score: {iou_score}") + + print("Example for VQA with position task.") + pred = {"content": "The content is Hello Buddies", "bbox": box1} + gt = {"content": "Hello Buddies", "bbox": box2} + + vqa_score = vqa_evaluation(pred["content"], gt["content"]) + iou_score = calculate_iou(pred["bbox"], gt["bbox"]) + + print(f"VQA score: {vqa_score}") + print(f"IoU score: {iou_score}") diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/TEDS_metric.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/TEDS_metric.py new file mode 100644 index 0000000000000000000000000000000000000000..4c2680d02d59277f6bb0cec60b56ae033d20440d --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/TEDS_metric.py @@ -0,0 +1,930 @@ +# flake8: noqa +# Copyright 2020 IBM +# Author: peter.zhong@au1.ibm.com +# +# This is free software; you can redistribute it and/or modify +# it under the terms of the Apache 2.0 License. +# +# This software is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# Apache 2.0 License for more details. + +import re +import ast +import json +import ipdb +import distance +from apted import APTED, Config +from itertools import product +from apted.helpers import Tree +from lxml import etree, html +from collections import deque +from vlmeval.dataset.utils.Ocrbench_v2.parallel import parallel_process +from tqdm import tqdm +from zss import simple_distance, Node +import string +from typing import Any, Callable, Optional, Sequence +import numpy as np +import Levenshtein +import editdistance + + +class TableTree(Tree): + def __init__(self, tag, colspan=None, rowspan=None, content=None, *children): + self.tag = tag + self.colspan = colspan + self.rowspan = rowspan + self.content = content + self.children = list(children) + + def bracket(self): + """Show tree using brackets notation""" + if self.tag == 'td': + result = '"tag": %s, "colspan": %d, "rowspan": %d, "text": %s' % \ + (self.tag, self.colspan, self.rowspan, self.content) + else: + result = '"tag": %s' % self.tag + for child in self.children: + result += child.bracket() + return "{{{}}}".format(result) + + +class CustomConfig(Config): + @staticmethod + def maximum(*sequences): + """Get maximum possible value + """ + return max(map(len, sequences)) + + def normalized_distance(self, *sequences): + """Get distance from 0 to 1 + """ + return float(distance.levenshtein(*sequences)) / self.maximum(*sequences) + + def rename(self, node1, node2): + """Compares attributes of trees""" + if (node1.tag != node2.tag) or (node1.colspan != node2.colspan) or (node1.rowspan != node2.rowspan): + return 1. + if node1.tag == 'td': + if node1.content or node2.content: + return self.normalized_distance(node1.content, node2.content) + return 0. + + +class TEDS(object): + ''' Tree Edit Distance basead Similarity + ''' + def __init__(self, structure_only=False, n_jobs=1, ignore_nodes=None): + assert isinstance(n_jobs, int) and (n_jobs >= 1), 'n_jobs must be an integer greather than 1' + self.structure_only = structure_only + self.n_jobs = n_jobs + self.ignore_nodes = ignore_nodes + self.__tokens__ = [] + + def tokenize(self, node): + ''' Tokenizes table cells + ''' + self.__tokens__.append('<%s>' % node.tag) + if node.text is not None: + self.__tokens__ += list(node.text) + for n in node.getchildren(): + self.tokenize(n) + if node.tag != 'unk': + self.__tokens__.append('' % node.tag) + if node.tag != 'td' and node.tail is not None: + self.__tokens__ += list(node.tail) + + def load_html_tree(self, node, parent=None): + ''' Converts HTML tree to the format required by apted + ''' + global __tokens__ + if node.tag == 'td': + if self.structure_only: + cell = [] + else: + self.__tokens__ = [] + self.tokenize(node) + cell = self.__tokens__[1:-1].copy() + new_node = TableTree(node.tag, + int(node.attrib.get('colspan', '1')), + int(node.attrib.get('rowspan', '1')), + cell, *deque()) + else: + new_node = TableTree(node.tag, None, None, None, *deque()) + if parent is not None: + parent.children.append(new_node) + if node.tag != 'td': + for n in node.getchildren(): + self.load_html_tree(n, new_node) + if parent is None: + return new_node + + def evaluate(self, pred, true): + ''' Computes TEDS score between the prediction and the ground truth of a + given sample + ''' + if (not pred) or (not true): + return 0.0 + parser = html.HTMLParser(remove_comments=True, encoding='utf-8') + pred = html.fromstring(pred, parser=parser) + true = html.fromstring(true, parser=parser) + if pred.xpath('body/table') and true.xpath('body/table'): + pred = pred.xpath('body/table')[0] + true = true.xpath('body/table')[0] + if self.ignore_nodes: + etree.strip_tags(pred, *self.ignore_nodes) + etree.strip_tags(true, *self.ignore_nodes) + n_nodes_pred = len(pred.xpath(".//*")) + n_nodes_true = len(true.xpath(".//*")) + n_nodes = max(n_nodes_pred, n_nodes_true) + tree_pred = self.load_html_tree(pred) + tree_true = self.load_html_tree(true) + distance = APTED(tree_pred, tree_true, CustomConfig()).compute_edit_distance() + return 1.0 - (float(distance) / n_nodes) + else: + return 0.0 + + def batch_evaluate(self, pred_json, true_json): + ''' Computes TEDS score between the prediction and the ground truth of + a batch of samples + @params pred_json: {'FILENAME': 'HTML CODE', ...} + @params true_json: {'FILENAME': {'html': 'HTML CODE'}, ...} + @output: {'FILENAME': 'TEDS SCORE', ...} + ''' + samples = true_json.keys() + if self.n_jobs == 1: + scores = [self.evaluate(pred_json.get(filename, ''), true_json[filename]['html']) for filename in tqdm(samples)] + else: + #inputs = [{'pred': pred_json.get(filename, ''), 'true': true_json[filename]['html']} for filename in samples] + inputs = [{'pred': pred_json.get(filename, ''), 'true': true_json[filename]} for filename in samples] + scores = parallel_process(inputs, self.evaluate, use_kwargs=True, n_jobs=self.n_jobs, front_num=1) + scores = dict(zip(samples, scores)) + return scores + + +def convert_table_to_html_str(table_row_list=[]): + """ + Given a list of table rows, build the corresponding html string, which is used to compute the TEDS score. + We use the official code of PubTabNet to compute TEDS score, it does not consider '' label. + We also remove unneccessary spaces within a table cell and extra '\n' as they will influence the TEDS score. + """ + html_table_str = "" + '\n' + for data_row in table_row_list: + html_table_str += "" + for cell_str in data_row: + html_table_str += f"" + html_table_str += "" + html_table_str += '\n' + html_table_str += "
{cell_str}
" + html_table_str = html_table_str.replace('\n','') + return html_table_str + + +def convert_markdown_table_to_html(markdown_table): + """ + Converts a markdown table to the corresponding html string for TEDS computation. + """ + # remove extra code block tokens like '```markdown' and '``` + markdown_table = markdown_table.strip('```markdown').strip('```').strip() + row_str_list = markdown_table.split('\n') + # extra the first header row and other data rows + valid_row_str_list = [row_str_list[0]]+row_str_list[2:] + table_rows = [] + for row_str in valid_row_str_list: + one_row = [] + for cell in row_str.strip().split('|')[1:-1]: + if set(cell) != set(' '): + one_row.append(cell.strip()) + else: + one_row.append(' ') + table_rows.append(one_row) + # build html string based on table rows + html_str = convert_table_to_html_str(table_rows) + return html_str + + +def dict_to_html(data): + html = "\n" + for key, value in data.items(): + if not isinstance(value, str): + value = str(value) + value_str = ' '.join(value) + + html += f" \n" + html += "
{key}{value_str}
" + return html + + +def convert_str_to_dict(predict_str: str): + """ + Parses the 'predict' string and returns a dictionary. + Missing or unparseable content is handled gracefully. + + Parameters: + - predict_str (str): The prediction string containing the output dict. + + Returns: + - dict: A dictionary extracted from the predict string. + """ + # Remove code fences like ```python\n...\n``` + code_fence_pattern = r'```(?:python|json)?\n(.*?)\n```' + match = re.search(code_fence_pattern, predict_str, re.DOTALL | re.IGNORECASE) + if match: + content = match.group(1) + else: + content = predict_str.strip() + + data = {} + success = False + + # try parsing with JSON + try: + data = json.loads(content) + success = True + except json.JSONDecodeError: + pass + + # try parsing with ast.literal_eval + if not success: + try: + data = ast.literal_eval(content) + if isinstance(data, dict): + success = True + except (ValueError, SyntaxError): + pass + + # try parsing with regex + if not success: + key_value_pattern = r'["\']?([\w\s]+)["\']?\s*[:=]\s*["\']?([^\n,"\'{}]+)["\']?' + matches = re.findall(key_value_pattern, content) + try: + for key, value in matches: + data[key.strip()] = value.strip() + except: + return {} + + if not data: + return {} + + try: + result = {k.strip(): str(v).strip() for k, v in data.items()} + except: + return {} + return result + + +def convert_str_to_multi_dict(predict_str: str): + """ + Parses the 'predict' string and returns a dictionary. + Handles nested dictionaries and missing or unparseable content gracefully. + + Parameters: + - predict_str (str): The prediction string containing the output dict. + + Returns: + - dict: A dictionary extracted from the predict string. + """ + # Remove code fences like ```python\n...\n``` + code_fence_pattern = r'```(?:python|json)?\n(.*?)\n```' + matches = re.findall(code_fence_pattern, predict_str, re.DOTALL | re.IGNORECASE) + if matches: + content = max(matches, key=len) + else: + content = predict_str.strip() + + def strip_variable_assignment(s): + variable_assignment_pattern = r'^\s*\w+\s*=\s*' + return re.sub(variable_assignment_pattern, '', s.strip(), count=1) + + content = strip_variable_assignment(content) + + def remove_comments(s): + return re.sub(r'#.*', '', s) + + content = remove_comments(content) + + last_brace_pos = content.rfind('}') + if last_brace_pos != -1: + content = content[:last_brace_pos+1] + + data = {} + success = False + + # try parsing with ast.literal_eval + try: + data = ast.literal_eval(content) + if isinstance(data, dict): + success = True + except (ValueError, SyntaxError, TypeError): + pass + + if not success: + return {} + + def process_data(obj): + if isinstance(obj, dict): + return {k: process_data(v) for k, v in obj.items()} + elif isinstance(obj, list): + return [process_data(elem) for elem in obj] + else: + return obj + + data = process_data(data) + + return data + + +def generate_combinations(input_dict): + """ + Function to generate all possible combinations of values from a dictionary. + """ + kie_answer = input_dict + if not isinstance(kie_answer, dict): + kie_answer = kie_answer.strip('"') + try: + kie_answer = json.loads(kie_answer) + except json.JSONDecodeError: + try: + kie_answer = ast.literal_eval(kie_answer) + if not isinstance(kie_answer, dict): + kie_answer = ast.literal_eval(kie_answer) + except (ValueError, SyntaxError): + print(f"Unable to parse 'answers' field: {kie_answer}") + return {} + + # Ensure the parsed result is a dictionary. + if not isinstance(kie_answer, dict): + print("Parsed 'answers' is still not a dictionary.") + raise ValueError("Input could not be parsed into a dictionary.") + + keys = list(kie_answer.keys()) + + value_lists = [] + for single_key in keys: + sinlge_value = kie_answer[single_key] + if not isinstance(sinlge_value, list): + sinlge_value = [sinlge_value] + value_lists.append(sinlge_value) + + # Compute the Cartesian product of the value lists. + combinations = list(product(*value_lists)) + + # Create a dictionary for each combination of values. + result = [dict(zip(keys, values)) for values in combinations] + + return result + + else: + keys = list(input_dict.keys()) + value_lists = [input_dict[key] for key in keys] + + # Compute the Cartesian product of the value lists. + combinations = list(product(*value_lists)) + + # Create a dictionary for each combination of values. + result = [dict(zip(keys, values)) for values in combinations] + + return result + + +def compute_f1_score(preds, gts, ignores=[]): + """Compute the F1-score for KIE task between predicted and ground truth dictionaries. + + Args: + preds (dict): The predicted key-value pairs. + gts (dict): The ground truth key-value pairs. + ignores (list): The list of keys to ignore during evaluation. + + Returns: + dict: A dictionary where keys are field names and values are their corresponding F1-scores. + """ + # Optionally remove ignored keys from predictions and ground truths + keys = set(preds.keys()).union(set(gts.keys())) - set(ignores) + f1_scores = {} + + for key in keys: + pred_value = preds.get(key, None) + gt_value = gts.get(key, None) + + if pred_value: + pred_value = pred_value.lower().strip().replace("\n"," ").replace(" ", "") + if gt_value: + gt_value = gt_value.lower().strip().replace("\n"," ").replace(" ", "") + + if pred_value is None and gt_value is None: + continue + elif pred_value is None: + precision = 0.0 + recall = 0.0 + elif gt_value is None: + # false positive + precision = 0.0 + recall = 0.0 + else: + if pred_value == gt_value: + # True positive + precision = 1.0 + recall = 1.0 + else: + precision = 0.0 + recall = 0.0 + + # Compute F1-score + f1_score = 2 * precision * recall / (precision + recall) if (precision + recall) > 0 else 0.0 + f1_scores[key] = f1_score + + if len(f1_scores) == 0: + return 0 + average_f1 = sum(f1_scores.values()) / len(f1_scores) + + return average_f1 + + +def pre_clean(text): + text = re.sub(r'|||', '', text) + text = re.sub(r'\s##(\S)', r'\1', text) + text = re.sub(r'\\\s', r'\\', text) + text = re.sub(r'\s\*\s\*\s', r'**', text) + text = re.sub(r'{\s', r'{', text) + text = re.sub(r'\s}', r'}', text) + text = re.sub(r'\s}', r'}', text) + text = re.sub(r'\\begin\s', r'\\begin', text) + text = re.sub(r'\\end\s', r'\\end', text) + text = re.sub(r'\\end{table}', r'\\end{table} \n\n', text) + text = text.replace('\n', ' ') + text = text.replace('*', ' ') + text = text.replace('_', ' ') + return text + + +def get_tree(input_str): + tree = (Node('ROOT').addkid(Node('TITLE'))) + + lines = input_str.split("\n") + lines = [pre_clean(line) for line in lines] + last_title = '' + for line in lines: + if line.startswith('#'): + child = tree.get('ROOT') + line = line.replace('#', '') + child.addkid(Node(line)) + last_title = line + else: + if last_title == '': + child = tree.get('TITLE') + child.addkid(Node(line)) + else: + child = tree.get(last_title) + child.addkid(Node(line)) + return tree + +def STEDS(pred_tree, ref_tree): + def my_distance(pred, ref): + if len(pred.split()) == 0 or len(ref.split()) == 0: + return 1 + else: + return 0 + total_distance = simple_distance(pred_tree, ref_tree, label_dist=my_distance) + num_of_nodes = max(len(list(pred_tree.iter())), len(list(ref_tree.iter()))) + return 1-total_distance/num_of_nodes + + +def doc_parsing_evaluation(pred, gt): + score = 0 + if not isinstance(pred, str): + return 0 + pred_tree = get_tree(pred) + gt_tree = get_tree(gt) + score = STEDS(pred_tree, gt_tree) + + return score + + +def wrap_html_table(html_table): + """ + The TEDS computation from PubTabNet code requires that the input html table should have , , and tags. + Add them if they are missing. + """ + html_table = html_table.replace('\n','') + # add missing
tag if missing + if "" not in html_table: + html_table = html_table + "
" + elif "" in html_table: + html_table = "" + html_table + elif "" not in html_table: + html_table = "
" + html_table + "
" + else: + pass + # add and tags if missing + if '' not in html_table: + html_table = '' + html_table + '' + if '' not in html_table: + html_table = '' + html_table + '' + return html_table + + +def get_anls(s1, s2): + try: + s1 = s1.lower() + s2 = s2.lower() + except: + pass + if s1 == s2: + return 1.0 + iou = 1 - editdistance.eval(s1, s2) / max(len(s1), len(s2)) + anls = iou + return anls + + +def ocr_eval(references,predictions): + socre_=0.0 + None_num=0 + for idx,ref_value in enumerate(references): + pred_value = predictions[idx] + pred_values, ref_values = [], [] + if isinstance(pred_value, str): + pred_values.append(pred_value) + else: + pred_values = pred_value + if isinstance(ref_value, str): + ref_values.append(ref_value) + else: + ref_values = ref_value + + temp_score = 0.0 + temp_num = len(ref_values) + + for tmpidx, tmpref in enumerate(ref_values): + tmppred = pred_values[tmpidx] if tmpidx < len(pred_values) else pred_values[0] + if len(pred_values) == 1 and tmppred != "None" and "None" not in ref_values: # pred 1, and not None + temp_score = max(temp_score, get_anls(tmppred, tmpref)) + temp_num = len(ref_values) + else: + if tmppred=='None' and tmpref!='None': + temp_score += 0.0 + elif tmpref=='None': + temp_num -= 1 + else: + temp_score += get_anls(tmppred, tmpref) + if temp_num == 0: + ocr_score = 0.0 + None_num += 1 + else: + ocr_score = temp_score / (temp_num) + socre_ += ocr_score + if None_num == len(references): + return 9999 + else: + return round(socre_ / (len(references)-None_num), 5) + + +def csv_eval(predictions,references,easy, pred_type='json'): + predictions = predictions + labels = references + def is_int(val): + try: + int(val) + return True + except ValueError: + return False + + def is_float(val): + try: + float(val) + return True + except ValueError: + return False + + def convert_dict_to_list(data): + """ + Convert a dictionary to a list of tuples, handling both simple and nested dictionaries. + + Args: + data (dict): The input dictionary, which might be nested or simple. + + Returns: + list: A list of tuples generated from the input dictionary. + """ + # print(data) + converted_list = [] + for key, value in data.items(): + # Check if the value is a dictionary (indicating a nested structure) + if isinstance(value, dict): + # Handle nested dictionary + for subkey, subvalue in value.items(): + # converted_list.append((key, subkey, subvalue)) + converted_list.append((key, subkey, re.sub(r'[^\d.-]', '', str(subvalue)))) + + else: + # Handle simple key-value pair + # converted_list.append((key, "value", value)) + converted_list.append((key, "value", re.sub(r'[^\d.-]', '', str(value)))) + return converted_list + + + def csv2triples(csv, separator='\\t', delimiter='\\n'): + lines = csv.strip().split(delimiter) + header = lines[0].split(separator) + triples = [] + for line in lines[1:]: + if not line: + continue + values = line.split(separator) + entity = values[0] + for i in range(1, len(values)): + if i >= len(header): + break + #--------------------------------------------------------- + temp = [entity.strip(), header[i].strip()] + temp = [x if len(x)==0 or x[-1] != ':' else x[:-1] for x in temp] + value = values[i].strip() + value = re.sub(r'[^\d.-]', '', str(value)) + # value = value.replace("%","") + # value = value.replace("$","") + triples.append((temp[0], temp[1], value)) + #--------------------------------------------------------- + return triples + + def csv2triples_noheader(csv, separator='\\t', delimiter='\\n'): + lines = csv.strip().split(delimiter) + maybe_header = [x.strip() for x in lines[0].split(separator)] + not_header = False + if len(maybe_header) > 2: + for c in maybe_header[1:]: + try: + num = float(c) + not_header = True + except: + continue + if not_header: + break + header = None if not_header else maybe_header + data_start = 0 if not_header and separator in lines[0] else 1 + triples = [] + for line in lines[data_start:]: + if not line: + continue + values = [x.strip() for x in line.split(separator)] + entity = values[0] + for i in range(1, len(values)): + try: + temp = [entity if entity[-1]!=':' else entity[:-1], ""] + except: + temp = [entity, ""] + if header is not None: + try: + this_header = header[i] + temp = [entity, this_header] + temp = [x if x[-1] != ':' else x[:-1] for x in temp] + except: + this_header = entity.strip() + value = values[i].strip() + value = re.sub(r'[^\d.-]', '', str(value)) + # value = value.replace("%","") + # value = value.replace("$","") + triples.append((temp[0], temp[1], value)) + #--------------------------------------------------------- + return triples + + def process_triplets(triplets): + new_triplets = [] + for triplet in triplets: + new_triplet = [] + triplet_temp = [] + if len(triplet) > 2: + if is_int(triplet[2]) or is_float(triplet[2]): + triplet_temp = (triplet[0].lower(), triplet[1].lower(), float(triplet[2])) + else: + triplet_temp = (triplet[0].lower(), triplet[1].lower(), triplet[2].lower()) + else: + triplet_temp = (triplet[0].lower(), triplet[1].lower(), "no meaning") + new_triplets.append(triplet_temp) + return new_triplets + + def intersection_with_tolerance(a, b, tol_word, tol_num): + a = set(a) + b = set(b) + c = set() + for elem1 in a: + for elem2 in b: + if is_float(elem1[-1]) and is_float(elem2[-1]): + if ((Levenshtein.distance(''.join(elem1[:-1]),''.join(elem2[:-1])) <= tol_word) and (abs(elem1[-1] - elem2[-1]) / (abs(elem2[-1])+0.000001) <= tol_num))or \ + ((''.join(elem1[:-1]) in ''.join(elem2[:-1])) and (abs(elem1[-1] - elem2[-1]) / (abs(elem2[-1])+0.000001) <= tol_num)) or \ + ((''.join(elem2[:-1]) in ''.join(elem1[:-1])) and (abs(elem1[-1] - elem2[-1]) / (abs(elem2[-1])+0.000001) <= tol_num)): + c.add(elem1) + else: + if (Levenshtein.distance(''.join([str(i) for i in elem1]),''.join([str(j) for j in elem2])) <= tol_word): + c.add(elem1) + return list(c) + + def union_with_tolerance(a, b, tol_word, tol_num): + c = set(a) | set(b) + d = set(a) & set(b) + e = intersection_with_tolerance(a, b, tol_word, tol_num) + f = set(e) + g = c-(f-d) + return list(g) + + def get_eval_list(pred_csv, label_csv, separator='\\t', delimiter='\\n', tol_word=3, tol_num=0.05, pred_type='json'): + + if pred_type == 'json': + pred_triple_list=[] + for it in pred_csv: + pred_triple_temp = convert_dict_to_list(it) + pred_triple_pre = process_triplets(pred_triple_temp) + pred_triple_list.append(pred_triple_pre) + else: + pred_triple_list=[] + for it in pred_csv: + pred_triple_temp = csv2triples(it, separator=separator, delimiter=delimiter) + # pred_triple_temp = csv2triples_noheader(it, separator=separator, delimiter=delimiter) + pred_triple_pre = process_triplets(pred_triple_temp) + pred_triple_list.append(pred_triple_pre) + + label_triple_list=[] + for it in label_csv: + label_triple_temp = convert_dict_to_list(it) + label_triple_pre = process_triplets(label_triple_temp) + label_triple_list.append(label_triple_pre) + + + intersection_list=[] + union_list=[] + sim_list=[] + # for each chart image + for pred,label in zip(pred_triple_list, label_triple_list): + for idx in range(len(pred)): + try: + if label[idx][1] == "value" and "value" not in pred[idx][:2]: + pred[idx] = (pred[idx][0], "value", pred[idx][2]) + temp_pred_head = sorted(pred[idx][:2]) + temp_gt_head = sorted(label[idx][:2]) + pred[idx] = (temp_pred_head[0], temp_pred_head[1], pred[idx][2]) + label[idx] = (temp_gt_head[0], temp_gt_head[1], label[idx][2]) + except: + continue + intersection = intersection_with_tolerance(pred, label, tol_word = tol_word, tol_num=tol_num) + union = union_with_tolerance(pred, label, tol_word = tol_word, tol_num=tol_num) + sim = len(intersection)/len(union) + intersection_list.append(intersection) + union_list.append(union) + sim_list.append(sim) + return intersection_list, union_list, sim_list + + def get_ap(predictions, labels, sim_threhold, tolerance, separator='\\t', delimiter='\\n', easy=1): + if tolerance == 'strict': + tol_word=0 + if easy == 1: + tol_num=0 + else: + tol_num=0.1 + + elif tolerance == 'slight': + tol_word=2 + if easy == 1: + tol_num=0.05 + else: + tol_num=0.3 + + elif tolerance == 'high': + tol_word= 5 + if easy == 1: + tol_num=0.1 + else: + tol_num=0.5 + intersection_list, union_list, sim_list = get_eval_list(predictions, labels, separator=separator, delimiter=delimiter, tol_word=tol_word, tol_num=tol_num, pred_type=pred_type) + ap = len([num for num in sim_list if num >= sim_threhold])/(len(sim_list)+1e-16) + return ap + + map_strict = 0 + map_slight = 0 + map_high = 0 + s="\\t" + d="\\n" + + for sim_threhold in np.arange (0.5, 1, 0.05): + map_temp_strict = get_ap(predictions, labels, sim_threhold=sim_threhold, tolerance='strict', separator=s, delimiter=d, easy=easy) + map_temp_slight = get_ap(predictions, labels, sim_threhold=sim_threhold, tolerance='slight', separator=s, delimiter=d, easy=easy) + map_temp_high = get_ap(predictions, labels, sim_threhold=sim_threhold, tolerance='high', separator=s, delimiter=d, easy=easy) + map_strict += map_temp_strict/10 + map_slight += map_temp_slight/10 + map_high += map_temp_high/10 + + em = get_ap(predictions, labels, sim_threhold=1, tolerance='strict', separator=s, delimiter=d, easy=easy) + ap_50_strict = get_ap(predictions, labels, sim_threhold=0.5, tolerance='strict', separator=s, delimiter=d, easy=easy) + ap_75_strict = get_ap(predictions, labels, sim_threhold=0.75, tolerance='strict', separator=s, delimiter=d, easy=easy) + ap_90_strict = get_ap(predictions, labels, sim_threhold=0.90, tolerance='strict', separator=s, delimiter=d, easy=easy) + ap_50_slight = get_ap(predictions, labels, sim_threhold=0.5, tolerance='slight', separator=s, delimiter=d, easy=easy) + ap_75_slight = get_ap(predictions, labels, sim_threhold=0.75, tolerance='slight', separator=s, delimiter=d, easy=easy) + ap_90_slight = get_ap(predictions, labels, sim_threhold=0.90, tolerance='slight', separator=s, delimiter=d, easy=easy) + ap_50_high = get_ap(predictions, labels, sim_threhold=0.5, tolerance='high', separator=s, delimiter=d, easy=easy) + ap_75_high = get_ap(predictions, labels, sim_threhold=0.75, tolerance='high', separator=s, delimiter=d, easy=easy) + ap_90_high = get_ap(predictions, labels, sim_threhold=0.90, tolerance='high', separator=s, delimiter=d, easy=easy) + + + return em, map_strict, map_slight, map_high, ap_50_strict, ap_75_strict, ap_90_strict, ap_50_slight, ap_75_slight, ap_90_slight, ap_50_high, ap_75_high, ap_90_high + +def draw_SCRM_table(em, map_strict, map_slight, map_high, ap_50_strict, ap_75_strict, ap_90_strict, ap_50_slight, ap_75_slight, ap_90_slight, ap_50_high, ap_75_high, ap_90_high,title_ocr_socre,source_ocr_socre,x_title_ocr_socre,y_title_ocr_socre,structure_accuracy): + + result=f''' + -----------------------------------------------------------\n + | Metrics | Sim_threshold | Tolerance | Value |\n + -----------------------------------------------------------\n + | | | strict | {'%.4f' % map_strict} | \n + | | ----------------------------\n + | mPrecison | 0.5:0.05:0.95 | slight | {'%.4f' % map_slight} |\n + | | ---------------------------\n + | | | high | {'%.4f' % map_high} |\n + -----------------------------------------------------------\n + | | | strict | {'%.4f' % ap_50_strict} |\n + | | ---------------------------\n + | Precison | 0.5 | slight | {'%.4f' % ap_50_slight } |\n + | | ---------------------------\n + | | | high | {'%.4f' % ap_50_high } |\n + -----------------------------------------------------------\n + | | | strict | {'%.4f' % ap_75_strict} |\n + | | ---------------------------\n + | Precison | 0.75 | slight | {'%.4f' % ap_75_slight} |\n + | | ---------------------------\n + | | | high | {'%.4f' % ap_75_high} |\n + -----------------------------------------------------------\n + | | | strict | {'%.4f' % ap_90_strict} |\n + | | ---------------------------\n + | Precison | 0.9 | slight | {'%.4f' % ap_90_slight } |\n + | | ---------------------------\n + | | | high | {'%.4f' % ap_90_high} |\n + -----------------------------------------------------------\n + |Precison(EM) | {'%.4f' % em} |\n + -----------------------------------------------------------\n + |Title(EM) | {'%.4f' % title_ocr_socre} |\n + -----------------------------------------------------------\n + |Source(EM) | {'%.4f' % source_ocr_socre} |\n + -----------------------------------------------------------\n + |X_title(EM) | {'%.4f' % x_title_ocr_socre} |\n + -----------------------------------------------------------\n + |Y_title(EM) | {'%.4f' % y_title_ocr_socre} |\n + -----------------------------------------------------------\n + |structure_acc| {'%.4f' % structure_accuracy} |\n + -----------------------------------------------------------\n + + + ''' + return result + + +if __name__ == '__main__': + import json + import pprint + + # markdown structure for Table Parsing task + pred_markdown = "| 1 | august 5 , 1972 | detroit lions | l 23 - 31 | 0 - 1 |\n| 2 | august 12 , 1972 | green bay packers | l 13 - 14 | 0 - 2 |\n| 3 | august 19 , 1972 | cincinnati bengals | w 35 - 17 | 1 - 2 |\n| 4 | august 25 , 1972 | atlanta falcons | w 24 - 10 | 2 - 2 |\n| 5 | august 31 , 1972 | washington redskins | l 24 - 27 | 2 - 3 |\n| 6 | september 10 , 1972 | minnesota vikings | w 21 - 19 | 3 - 3 |" + true_markdown = "| week | date | opponent | result | record |\n| --- | --- | --- | --- | --- |\n| 1 | august 5 , 1972 | detroit lions | l 23 - 31 | 0 - 1 |\n| 2 | august 12 , 1972 | green bay packers | l 13 - 14 | 0 - 2 |\n| 3 | august 19 , 1972 | cincinnati bengals | w 35 - 17 | 1 - 2 |\n| 4 | august 25 , 1972 | atlanta falcons | w 24 - 10 | 2 - 2 |\n| 5 | august 31 , 1972 | washington redskins | l 24 - 27 | 2 - 3 |\n| 6 | september 10 , 1972 | minnesota vikings | w 21 - 19 | 3 - 3 |" + teds = TEDS(n_jobs=4) + pred_table_html = convert_markdown_table_to_html(pred_markdown) + true_table_html = convert_markdown_table_to_html(true_markdown) + + scores = teds.evaluate(pred_table_html, true_table_html) + + pp = pprint.PrettyPrinter() + pp.pprint(scores) + + # dict structure for Key Information Extraction task + pred_dict = { + "company": [ + "OLD TOWN " + ], + "date": [ + "2024" + ], + "address": [ + "SRI RAMPAI" + ], + "total": [ + "30" + ] + } + true_dict = { + "company": [ + "OLD TOWN KOPITAM SND BHD" + ], + "date": [ + "2024/9/27" + ], + "address": [ + "SRI RAMPAI" + ], + "total": [ + "30" + ] + } + teds = TEDS(n_jobs=4) + pred_dict_html = dict_to_html(pred_dict) + true_dict_html = dict_to_html(true_dict) + print(pred_dict_html) + print(true_dict_html) + + scores = teds.evaluate(pred_dict_html, true_dict_html) + + pp = pprint.PrettyPrinter() + pp.pprint(scores) diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/spotting_eval/__pycache__/rrc_evaluation_funcs_1_1.cpython-310.pyc b/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/spotting_eval/__pycache__/rrc_evaluation_funcs_1_1.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e01c07f93ff0e30203df1c2a79a5033e144a373 Binary files /dev/null and b/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/spotting_eval/__pycache__/rrc_evaluation_funcs_1_1.cpython-310.pyc differ diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/spotting_eval/__pycache__/script.cpython-310.pyc b/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/spotting_eval/__pycache__/script.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4fb78722f0773fa7736a08b868a425717f8b1f38 Binary files /dev/null and b/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/spotting_eval/__pycache__/script.cpython-310.pyc differ diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/spotting_eval/rrc_evaluation_funcs_1_1.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/spotting_eval/rrc_evaluation_funcs_1_1.py new file mode 100644 index 0000000000000000000000000000000000000000..3c45fd5d05a2327a83fdfa1b2aa9d37407094143 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/utils/Ocrbench_v2/spotting_eval/rrc_evaluation_funcs_1_1.py @@ -0,0 +1,456 @@ +# flake8: noqa +#!/usr/bin/env python3 + +#File: rrc_evaluation_funcs_1_1.py +#Version: 1.1 +#Version info: changes for Python 3 +#Date: 2019-12-29 +#Description: File with useful functions to use by the evaluation scripts in the RRC website. + +import json +import sys; +sys.path.append('./') +import zipfile +import re +import os +import importlib + +def print_help(): + sys.stdout.write('Usage: python %s.py -g= -s= [-o= -p=]' %sys.argv[0]) + sys.exit(2) + + +def load_zip_file_keys(file,fileNameRegExp=''): + """ + Returns an array with the entries of the ZIP file that match with the regular expression. + The key's are the names or the file or the capturing group definied in the fileNameRegExp + """ + try: + archive=zipfile.ZipFile(file, mode='r', allowZip64=True) + except : + raise Exception('Error loading the ZIP archive.') + + pairs = [] + + for name in archive.namelist(): + addFile = True + keyName = name + if fileNameRegExp!="": + m = re.match(fileNameRegExp,name) + if m == None: + addFile = False + else: + if len(m.groups())>0: + keyName = m.group(1) + + if addFile: + pairs.append( keyName ) + + return pairs + + +def load_zip_file(file,fileNameRegExp='',allEntries=False): + """ + Returns an array with the contents (filtered by fileNameRegExp) of a ZIP file. + The key's are the names or the file or the capturing group definied in the fileNameRegExp + allEntries validates that all entries in the ZIP file pass the fileNameRegExp + """ + try: + archive=zipfile.ZipFile(file, mode='r', allowZip64=True) + except : + raise Exception('Error loading the ZIP archive') + + pairs = [] + for name in archive.namelist(): + addFile = True + keyName = name + if fileNameRegExp!="": + m = re.match(fileNameRegExp,name) + if m == None: + addFile = False + else: + if len(m.groups())>0: + keyName = m.group(1) + + if addFile: + pairs.append( [ keyName , archive.read(name)] ) + else: + if allEntries: + raise Exception('ZIP entry not valid: %s' %name) + + return dict(pairs) + +def decode_utf8(raw): + """ + Returns a Unicode object on success, or None on failure + """ + try: + return raw.decode('utf-8-sig',errors = 'replace') + except: + return None + +def validate_lines_in_file(fileName,file_contents,CRLF=True,LTRB=True,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0): + """ + This function validates that all lines of the file calling the Line validation function for each line + """ + utf8File = decode_utf8(file_contents) + if (utf8File is None) : + raise Exception("The file %s is not UTF-8" %fileName) + + lines = utf8File.split( "\r\n" if CRLF else "\n" ) + for line in lines: + line = line.replace("\r","").replace("\n","") + if(line != ""): + try: + validate_tl_line(line,LTRB,withTranscription,withConfidence,imWidth,imHeight) + except Exception as e: + raise Exception(("Line in sample not valid. Sample: %s Line: %s Error: %s" %(fileName,line,str(e))).encode('utf-8', 'replace')) + + + +def validate_tl_line(line,LTRB=True,withTranscription=True,withConfidence=True,imWidth=0,imHeight=0): + """ + Validate the format of the line. If the line is not valid an exception will be raised. + If maxWidth and maxHeight are specified, all points must be inside the imgage bounds. + Posible values are: + LTRB=True: xmin,ymin,xmax,ymax[,confidence][,transcription] + LTRB=False: x1,y1,x2,y2,x3,y3,x4,y4[,confidence][,transcription] + """ + get_tl_line_values(line,LTRB,withTranscription,withConfidence,imWidth,imHeight) + + +def get_tl_line_values(line,LTRB=True,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0): + """ + Validate the format of the line. If the line is not valid an exception will be raised. + If maxWidth and maxHeight are specified, all points must be inside the imgage bounds. + Posible values are: + LTRB=True: xmin,ymin,xmax,ymax[,confidence][,transcription] + LTRB=False: x1,y1,x2,y2,x3,y3,x4,y4[,confidence][,transcription] + Returns values from a textline. Points , [Confidences], [Transcriptions] + """ + confidence = 0.0 + transcription = ""; + points = [] + + numPoints = 4; + + if LTRB: + + numPoints = 4; + + if withTranscription and withConfidence: + m = re.match(r'^\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-1].?[0-9]*)\s*,(.*)$',line) + if m == None : + m = re.match(r'^\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-1].?[0-9]*)\s*,(.*)$',line) + raise Exception("Format incorrect. Should be: xmin,ymin,xmax,ymax,confidence,transcription") + elif withConfidence: + m = re.match(r'^\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-1].?[0-9]*)\s*$',line) + if m == None : + raise Exception("Format incorrect. Should be: xmin,ymin,xmax,ymax,confidence") + elif withTranscription: + m = re.match(r'^\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,(.*)$',line) + if m == None : + raise Exception("Format incorrect. Should be: xmin,ymin,xmax,ymax,transcription") + else: + m = re.match(r'^\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,?\s*$',line) + if m == None : + raise Exception("Format incorrect. Should be: xmin,ymin,xmax,ymax") + + xmin = int(m.group(1)) + ymin = int(m.group(2)) + xmax = int(m.group(3)) + ymax = int(m.group(4)) + if(xmax0 and imHeight>0): + validate_point_inside_bounds(xmin,ymin,imWidth,imHeight); + validate_point_inside_bounds(xmax,ymax,imWidth,imHeight); + + else: + + numPoints = 8; + + if withTranscription and withConfidence: + m = re.match(r'^\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*([0-1].?[0-9]*)\s*,(.*)$',line) + if m == None : + raise Exception("Format incorrect. Should be: x1,y1,x2,y2,x3,y3,x4,y4,confidence,transcription") + elif withConfidence: + m = re.match(r'^\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*([0-1].?[0-9]*)\s*$',line) + if m == None : + raise Exception("Format incorrect. Should be: x1,y1,x2,y2,x3,y3,x4,y4,confidence") + elif withTranscription: + m = re.match(r'^\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,(.*)$',line) + if m == None : + raise Exception("Format incorrect. Should be: x1,y1,x2,y2,x3,y3,x4,y4,transcription") + else: + m = re.match(r'^\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*$',line) + if m == None : + raise Exception("Format incorrect. Should be: x1,y1,x2,y2,x3,y3,x4,y4") + + points = [ float(m.group(i)) for i in range(1, (numPoints+1) ) ] + + validate_clockwise_points(points) + + if (imWidth>0 and imHeight>0): + validate_point_inside_bounds(points[0],points[1],imWidth,imHeight); + validate_point_inside_bounds(points[2],points[3],imWidth,imHeight); + validate_point_inside_bounds(points[4],points[5],imWidth,imHeight); + validate_point_inside_bounds(points[6],points[7],imWidth,imHeight); + + + if withConfidence: + try: + confidence = float(m.group(numPoints+1)) + except ValueError: + raise Exception("Confidence value must be a float") + + if withTranscription: + posTranscription = numPoints + (2 if withConfidence else 1) + transcription = m.group(posTranscription) + m2 = re.match(r'^\s*\"(.*)\"\s*$',transcription) + if m2 != None : #Transcription with double quotes, we extract the value and replace escaped characters + transcription = m2.group(1).replace("\\\\", "\\").replace("\\\"", "\"") + + return points,confidence,transcription + +def get_tl_dict_values(detection,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0,validNumPoints=[],validate_cw=True): + """ + Validate the format of the dictionary. If the dictionary is not valid an exception will be raised. + If maxWidth and maxHeight are specified, all points must be inside the imgage bounds. + Posible values: + {"points":[[x1,y1],[x2,y2],[x3,x3],..,[xn,yn]]} + {"points":[[x1,y1],[x2,y2],[x3,x3],..,[xn,yn]],"transcription":"###","confidence":0.4,"illegibility":false} + {"points":[[x1,y1],[x2,y2],[x3,x3],..,[xn,yn]],"transcription":"###","confidence":0.4,"dontCare":false} + Returns values from the dictionary. Points , [Confidences], [Transcriptions] + """ + confidence = 0.0 + transcription = ""; + points = [] + + if isinstance(detection, dict) == False : + raise Exception("Incorrect format. Object has to be a dictionary") + + if not 'points' in detection: + raise Exception("Incorrect format. Object has no points key)") + + if isinstance(detection['points'], list) == False : + raise Exception("Incorrect format. Object points key have to be an array)") + + num_points = len(detection['points']) + + if num_points<3 : + raise Exception("Incorrect format. Incorrect number of points. At least 3 points are necessary. Found: " + str(num_points)) + + if(len(validNumPoints)>0 and num_points in validNumPoints == False ): + raise Exception("Incorrect format. Incorrect number of points. Only allowed 4,8 or 12 points)") + + for i in range(num_points): + if isinstance(detection['points'][i], list) == False : + raise Exception("Incorrect format. Point #" + str(i+1) + " has to be an array)") + + if len(detection['points'][i]) != 2 : + raise Exception("Incorrect format. Point #" + str(i+1) + " has to be an array with 2 objects(x,y) )") + + if isinstance(detection['points'][i][0], (int,float) ) == False or isinstance(detection['points'][i][1], (int,float) ) == False : + raise Exception("Incorrect format. Point #" + str(i+1) + " childs have to be Integers)") + + if (imWidth>0 and imHeight>0): + validate_point_inside_bounds(detection['points'][i][0],detection['points'][i][1],imWidth,imHeight); + + points.append(float(detection['points'][i][0])) + points.append(float(detection['points'][i][1])) + + if validate_cw : + validate_clockwise_points(points) + + if withConfidence: + if not 'confidence' in detection: + raise Exception("Incorrect format. No confidence key)") + + if isinstance(detection['confidence'], (int,float)) == False : + raise Exception("Incorrect format. Confidence key has to be a float)") + + if detection['confidence']<0 or detection['confidence']>1 : + raise Exception("Incorrect format. Confidence key has to be a float between 0.0 and 1.0") + + confidence = detection['confidence'] + + if withTranscription: + if not 'transcription' in detection: + raise Exception("Incorrect format. No transcription key)") + + if isinstance(detection['transcription'], str) == False : + raise Exception("Incorrect format. Transcription has to be a string. Detected: " + type(detection['transcription']).__name__ ) + + transcription = detection['transcription'] + + if 'illegibility' in detection: #Ensures that if illegibility atribute is present and is True the transcription is set to ### (don't care) + if detection['illegibility'] == True: + transcription = "###" + + if 'dontCare' in detection: #Ensures that if dontCare atribute is present and is True the transcription is set to ### (don't care) + if detection['dontCare'] == True: + transcription = "###" + + return points,confidence,transcription + +def validate_point_inside_bounds(x,y,imWidth,imHeight): + if(x<0 or x>imWidth): + raise Exception("X value (%s) not valid. Image dimensions: (%s,%s)" %(xmin,imWidth,imHeight)) + if(y<0 or y>imHeight): + raise Exception("Y value (%s) not valid. Image dimensions: (%s,%s) Sample: %s Line:%s" %(ymin,imWidth,imHeight)) + +def validate_clockwise_points(points): + """ + Validates that the points are in clockwise order. + """ + edge = [] + for i in range(len(points)//2): + edge.append( (int(points[(i+1)*2 % len(points)]) - int(points[i*2])) * (int(points[ ((i+1)*2+1) % len(points)]) + int(points[i*2+1])) ) + if sum(edge)>0: + raise Exception("Points are not clockwise. The coordinates of bounding points have to be given in clockwise order. Regarding the correct interpretation of 'clockwise' remember that the image coordinate system used is the standard one, with the image origin at the upper left, the X axis extending to the right and Y axis extending downwards.") + +def get_tl_line_values_from_file_contents(content,CRLF=True,LTRB=True,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0,sort_by_confidences=True): + """ + Returns all points, confindences and transcriptions of a file in lists. Valid line formats: + xmin,ymin,xmax,ymax,[confidence],[transcription] + x1,y1,x2,y2,x3,y3,x4,y4,[confidence],[transcription] + """ + pointsList = [] + transcriptionsList = [] + confidencesList = [] + + lines = content.split( "\r\n" if CRLF else "\n" ) + for line in lines: + line = line.replace("\r","").replace("\n","") + if(line != "") : + points, confidence, transcription = get_tl_line_values(line,LTRB,withTranscription,withConfidence,imWidth,imHeight); + pointsList.append(points) + transcriptionsList.append(transcription) + confidencesList.append(confidence) + + if withConfidence and len(confidencesList)>0 and sort_by_confidences: + import numpy as np + sorted_ind = np.argsort(-np.array(confidencesList)) + confidencesList = [confidencesList[i] for i in sorted_ind] + pointsList = [pointsList[i] for i in sorted_ind] + transcriptionsList = [transcriptionsList[i] for i in sorted_ind] + + return pointsList,confidencesList,transcriptionsList + +def get_tl_dict_values_from_array(array,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0,sort_by_confidences=True,validNumPoints=[],validate_cw=True): + """ + Returns all points, confindences and transcriptions of a file in lists. Valid dict formats: + {"points":[[x1,y1],[x2,y2],[x3,x3],..,[xn,yn]],"transcription":"###","confidence":0.4} + """ + pointsList = [] + transcriptionsList = [] + confidencesList = [] + + for n in range(len(array)): + objectDict = array[n] + points, confidence, transcription = get_tl_dict_values(objectDict,withTranscription,withConfidence,imWidth,imHeight,validNumPoints,validate_cw); + pointsList.append(points) + transcriptionsList.append(transcription) + confidencesList.append(confidence) + + if withConfidence and len(confidencesList)>0 and sort_by_confidences: + import numpy as np + sorted_ind = np.argsort(-np.array(confidencesList)) + confidencesList = [confidencesList[i] for i in sorted_ind] + pointsList = [pointsList[i] for i in sorted_ind] + transcriptionsList = [transcriptionsList[i] for i in sorted_ind] + + return pointsList,confidencesList,transcriptionsList + +def main_evaluation(p,default_evaluation_params_fn,validate_data_fn,evaluate_method_fn,show_result=True,per_sample=True): + """ + This process validates a method, evaluates it and if it succed generates a ZIP file with a JSON entry for each sample. + Params: + p: Dictionary of parmeters with the GT/submission locations. If None is passed, the parameters send by the system are used. + default_evaluation_params_fn: points to a function that returns a dictionary with the default parameters used for the evaluation + validate_data_fn: points to a method that validates the corrct format of the submission + evaluate_method_fn: points to a function that evaluated the submission and return a Dictionary with the results + """ + + if (p == None): + p = dict([s[1:].split('=') for s in sys.argv[1:]]) + if(len(sys.argv)<3): + print_help() + + evalParams = default_evaluation_params_fn() + if 'p' in p.keys(): + evalParams.update( p['p'] if isinstance(p['p'], dict) else json.loads(p['p']) ) + + resDict={'calculated':True,'Message':'','method':'{}','per_sample':'{}'} + try: + validate_data_fn(p['g'], p['s'], evalParams) + evalData = evaluate_method_fn(p['g'], p['s'], evalParams) + resDict.update(evalData) + + except Exception as e: + resDict['Message']= str(e) + resDict['calculated']=False + + if 'o' in p: + if not os.path.exists(p['o']): + os.makedirs(p['o']) + + resultsOutputname = p['o'] + '/results.zip' + outZip = zipfile.ZipFile(resultsOutputname, mode='w', allowZip64=True) + + del resDict['per_sample'] + if 'output_items' in resDict.keys(): + del resDict['output_items'] + + outZip.writestr('method.json',json.dumps(resDict)) + + if not resDict['calculated']: + if show_result: + sys.stderr.write('Error!\n'+ resDict['Message']+'\n\n') + if 'o' in p: + outZip.close() + return resDict + + if 'o' in p: + if per_sample == True: + for k,v in evalData['per_sample'].items(): + outZip.writestr( k + '.json',json.dumps(v)) + + if 'output_items' in evalData.keys(): + for k, v in evalData['output_items'].items(): + outZip.writestr( k,v) + + outZip.close() + + # if show_result: + # #sys.stdout.write("Calculated!") + # sys.stdout.write(json.dumps(resDict['method'])) + + return resDict + + +def main_validation(default_evaluation_params_fn,validate_data_fn): + """ + This process validates a method + Params: + default_evaluation_params_fn: points to a function that returns a dictionary with the default parameters used for the evaluation + validate_data_fn: points to a method that validates the corrct format of the submission + """ + try: + p = dict([s[1:].split('=') for s in sys.argv[1:]]) + evalParams = default_evaluation_params_fn() + if 'p' in p.keys(): + evalParams.update( p['p'] if isinstance(p['p'], dict) else json.loads(p['p']) ) + + validate_data_fn(p['g'], p['s'], evalParams) + print ('SUCCESS') + sys.exit(0) + except Exception as e: + print (str(e)) + sys.exit(101) diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/__init__.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c365a8b35aa340bb9072d0feb44babd9faca4512 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/utils/__init__.py @@ -0,0 +1,11 @@ +from .judge_util import build_judge, DEBUG_MESSAGE +from .multiple_choice import extract_answer_from_item, prefetch_answer +from .vqa_eval import levenshtein_distance +from .spatial457 import Spatial457_utils + + +__all__ = [ + 'build_judge', 'extract_answer_from_item', 'prefetch_answer', + 'levenshtein_distance', 'DEBUG_MESSAGE', + 'Spatial457_utils' +] diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/ccocr_evaluator/ocr_evaluator.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/ccocr_evaluator/ocr_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..5c82abccc18abe7a22e9cb7daa7ec6bdb3951f9e --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/utils/ccocr_evaluator/ocr_evaluator.py @@ -0,0 +1,106 @@ +import os +import sys +import json +import re +from collections import Counter + +# local import +from .common import BaseMetric + + +def token_normalize(token_text, is_lower=False, is_alphanum_only=False): + """ + """ + if is_lower: + token_text = token_text.lower() + if is_alphanum_only: + token_text = re.sub('[^A-Za-z0-9]+', '', token_text) + return token_text + + +def text_normalize_and_tokenize(text, is_keep_blank=True, is_lower=True, is_alphanum_only=False): + text = text.replace("\t", " ").replace("\n", " ").replace("###", "").replace("***", "") + text = re.sub(r'\s+', ' ', text) + if not is_keep_blank: + text = text.replace(" ", "") + text_tokens = text.split(" ") if is_keep_blank else list(text) + text_token_normalized = [token_normalize(t, is_lower, is_alphanum_only) for t in text_tokens] + text_token_normalized = [x for x in text_token_normalized if len(x) > 0] + return text_token_normalized + + +def evaluate_single_sample(gts, preds): + right_num = 0 + gt_counter_info = dict(Counter(gts)) + pdt_counter_info = dict(Counter(preds)) + for gt_token, gt_count in gt_counter_info.items(): + pred_count = pdt_counter_info.get(gt_token, 0) + right_num += min(gt_count, pred_count) + return right_num + + +def calculate_metrics(response_info, gt_info, is_verbose=False): + """ + """ + macro_recall_list, macro_precision_list, macro_f1_list = [], [], [] + total_gt_num, total_pred_num, total_right_num = 0, 0, 0 + for file_name, fullbox_gts in gt_info.items(): + fullbox_preds = response_info.get(file_name, []) + right_num = evaluate_single_sample(fullbox_gts, fullbox_preds) + total_right_num += right_num + total_gt_num += len(fullbox_gts) + total_pred_num += len(fullbox_preds) + + macro_recall = right_num / (len(fullbox_gts) + 1e-9) + macro_precision = right_num / (len(fullbox_preds) + 1e-9) + macro_f1 = 2 * macro_recall * macro_precision / (macro_recall + macro_precision + 1e-9) + macro_recall_list.append(macro_recall) + macro_precision_list.append(macro_precision) + macro_f1_list.append(macro_f1) + + # marco + final_macro_recall = sum(macro_recall_list) / (len(macro_recall_list) + 1e-9) + final_macro_precision = sum(macro_precision_list) / (len(macro_precision_list) + 1e-9) + final_macro_f1 = sum(macro_f1_list) / (len(macro_f1_list) + 1e-9) + + # micro + recall_acc = total_right_num / (total_gt_num + 1e-9) + preci_acc = total_right_num / (total_pred_num + 1e-9) + hmean = 2 * recall_acc * preci_acc / (recall_acc + preci_acc + 1e-9) + vbs_eval_result = { + 'macro_recall': final_macro_recall, 'macro_precision': final_macro_precision, 'macro_f1_score': final_macro_f1, + 'micro_recall': recall_acc, 'micro_precision': preci_acc, 'mirco_f1_score': hmean + } + eval_result = vbs_eval_result if is_verbose else {'macro_f1_score': final_macro_f1, 'mirco_f1_score': hmean} + return eval_result + + +class OcrEvaluator(BaseMetric): + def response_post_func(self, response_text, **kwargs): + return response_text + + def evaluate(self, response_info, gt_info, **kwargs): + # hard code here + dataset_name = kwargs['dataset'] + is_word_level, is_lower, is_alphanum_only = True, True, False + if dataset_name in ["Arabic", "Japanese", "Korean"] or "zh" in dataset_name: + is_word_level = False + if "multi_scene_ocr" in self.group_name and is_word_level: + is_alphanum_only = True + eval_config = {"word_level": is_word_level, "alphanum_only": is_alphanum_only, "lowercase": is_lower} + + image_pdt_info, image_gt_info = {}, {} + for file_name, gt_src in gt_info.items(): + pred_src = response_info.get(file_name, "") + pdt_token_list = text_normalize_and_tokenize( + str(pred_src).strip(), is_word_level, is_lower, is_alphanum_only) + gt_token_list = text_normalize_and_tokenize( + str(gt_src).strip(), is_word_level, is_lower, is_alphanum_only) + image_pdt_info[file_name] = pdt_token_list + image_gt_info[file_name] = gt_token_list + eval_result = calculate_metrics(image_pdt_info, image_gt_info, is_verbose=False) + return {"summary": eval_result, "metric_config": eval_config} + + +if __name__ == '__main__': + pass diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/mathvista.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/mathvista.py new file mode 100644 index 0000000000000000000000000000000000000000..52e138508262abd1b93bfa544120d37881d7ff5b --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/utils/mathvista.py @@ -0,0 +1,164 @@ +from ...smp import * +from ...utils import can_infer + + +FAIL_MSG = 'Failed to obtain answer via API.' + + +def get_gpt4_ICE(): + example_1 = """ +Hint: Please answer the question requiring an integer answer and provide the final value, +e.g., 1, 2, 3, at the end.\n +Question: Which number is missing?\n +Model response: The number missing in the sequence is 14.\n +Extracted answer: 14 +""" + + example_2 = """ +Hint: Please answer the question requiring a floating-point number with one decimal place and provide the final value, +e.g., 1.2, 1.3, 1.4, at the end.\n +Question: What is the fraction of females facing the camera?\n +Model response: The fraction of females facing the camera is 0.6, +which means that six out of ten females in the group are facing the camera.\n +Extracted answer: 0.6 +""" + + example_3 = """ +Hint: Please answer the question requiring a floating-point number with two decimal places and provide the final value, +e.g., 1.23, 1.34, 1.45, at the end.\n +Question: How much money does Luca need to buy a sour apple candy and a butter-scotch candy? (Unit: $)\n +Model response: Luca needs $1.45 to buy a sour apple candy and a butterscotch candy.\n +Extracted answer: 1.45 +""" + + example_4 = """ +Hint: Please answer the question requiring a Python list as an answer and provide the final list, +e.g., [1, 2, 3], [1.2, 1.3, 1.4], at the end.\n +Question: Between which two years does the line graph saw its maximum peak?\n +Model response: The line graph saw its maximum peak between 2007 and 2008.\n +Extracted answer: [2007, 2008] +""" + + example_5 = """ +Hint: Please answer the question and provide the correct option letter, e.g., A, B, C, D, at the end.\n +Question: What fraction of the shape is blue?\n +Choices: (A) 3/11 (B) 8/11 (C) 6/11 (D) 3/5\n +Model response: The correct answer is (B) 8/11.\n +Extracted answer: B +""" + + return [example_1, example_2, example_3, example_4, example_5] + + +def build_mathvista_gpt4_prompt(line): + task_description = """ +Please read the following example. +Then extract the answer from the model response and type it at the end of the prompt.\n +""" + question = line['question'] + prediction = str(line['prediction']) + prompt = task_description + examples = get_gpt4_ICE() + for example in examples: + prompt += example + '\n' + prompt += question + '\n' + prompt += 'Model respone: ' + prediction + prompt += 'Extracted answer:' + return prompt + + +def list_to_dict(lst): + return {chr(65 + i): val for i, val in enumerate(lst)} + + +def post_check(line, prefetch=False): + res = None + ans = line['answer'] + response = line['prediction'] if prefetch else line['res'] + try: + if line['question_type'] == 'multi_choice': + ans = line['answer_option'] + choices = list_to_dict(eval(line['choices'])) + res = can_infer(response, choices) + if prefetch: + return res + else: + if line['answer_type'] == 'integer': + res = int(response) + ans = int(line['answer']) + elif line['answer_type'] == 'float': + res = float(response) + ans = float(line['answer']) + else: + res = str(res) + ans = str(ans) + except ValueError: + pass + + if res == ans: + return res if prefetch else True + else: + return False + + +def MathVista_auxeval(model, line): + prompt = build_mathvista_gpt4_prompt(line) + log = '' + retry = 5 + if post_check(line, prefetch=True): + res = post_check(line, prefetch=True) + return dict(log='Prefetch succeed', res=res) + for i in range(retry): + prediction = line['prediction'] + res = model.generate(prompt, temperature=i * 0.5) + + if FAIL_MSG in res: + log += f'Try {i}: output is {prediction}, failed to parse.\n' + else: + log += 'Succeed' + return dict(log=log, res=res) + log += 'All 5 retries failed.\n' + return dict(log=log, res='') + + +def MathVista_acc(result_file): + data = load(result_file) + tot = defaultdict(lambda: 0) + fetch = defaultdict(lambda: 0) + hit = defaultdict(lambda: 0) + lt = len(data) + skill_list = [] + for i in range(lt): + item = data.iloc[i] + cate = item['task'] + tot['Overall'] += 1 + try: + skills = eval(item['skills']) + except SyntaxError: + skills = [item['skills']] + for skill in skills: + if skill not in skill_list: + skill_list.append(skill) + tot[skill] += 1 + tot[cate] += 1 + if item['log'] == 'Prefetch succeed': + fetch['Overall'] += 1 + fetch[cate] += 1 + for skill in skills: + fetch[skill] += 1 + if post_check(item, prefetch=False): + hit['Overall'] += 1 + hit[cate] += 1 + for skill in skills: + hit[skill] += 1 + + res = defaultdict(list) + for k in tot.keys(): + res['Task&Skill'].append(k) + res['tot'].append(tot[k]) + res['prefetch'].append(fetch[k]) + res['hit'].append(hit[k]) + res['prefetch_rate'].append(fetch[k] / tot[k] * 100) + res['acc'].append(hit[k] / tot[k] * 100) + res = pd.DataFrame(res) + return res diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/megabench/scoring/dict_nbbox_iou_tuple_agg_jaccard.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/megabench/scoring/dict_nbbox_iou_tuple_agg_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..9a225d44b4a6dce7c587d04c21aba6f6f0ce0b22 --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/utils/megabench/scoring/dict_nbbox_iou_tuple_agg_jaccard.py @@ -0,0 +1,27 @@ +from .nbbox_iou import NbboxIouTuple + + +class DictNbboxIouTupleAggJaccard: + """Calculates the average precision IoU across the dict. + + 1. Calculates the precision IoU for all sets with the same key, + if it appears in either pred or targets + 2. Calculates the total, then divides by the size of the union + """ + + @classmethod + def match(cls, responses, targets) -> float: + """Return the aggregated Jaccard index between targets and responses.""" + if not isinstance(responses, dict): + return 0 + all_keys = set(responses) | set(targets) + + num_keys = 0 + total_score = 0 + for key in all_keys: + total_score += NbboxIouTuple.match( + responses.get(key, []), targets.get(key, []) + ) + num_keys += 1 + + return total_score / num_keys diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/megabench/scoring/exact_str_match.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/megabench/scoring/exact_str_match.py new file mode 100644 index 0000000000000000000000000000000000000000..9cee6c9c6f9511cd2118951d89374cfe9614620c --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/utils/megabench/scoring/exact_str_match.py @@ -0,0 +1,48 @@ +import re +from ..parsing.common.utils import extract_code_block_content + + +def parse_single_letter(s): + # Regular expression to match (A)XXXXX, A . XXXXXXX, or A.XXXXXX + match = re.match(r"^\(?([A-Za-z])\)?(?:\s*\.\s*|\.)?(.*)", s) + + if match: + # Extract and return the single letter + return match.group(1) + else: + # Return the original string if no match is found + return s + + +class ExactStrMatch: + """Exact string matching.""" + + @staticmethod + def match(response: str, correct_answer: str) -> int: + """Exact match between targets and responses.""" + if not isinstance(response, str): + response = str(response) + if not isinstance(correct_answer, str): + correct_answer = str(correct_answer) + + if len(correct_answer) == 1 and correct_answer.isalpha() and len(response) > 1: + # handle special case of choice letter, + # drop the potential parenthesis + response = parse_single_letter(response) + + return 1 if response == correct_answer else 0 + + +class CodeResultExactStrMatch: + """Exact string matching, with the results from a results code block.""" + + @staticmethod + def match(response: str, correct_answer: str) -> int: + """Exact match between targets and responses.""" + correct_answer, is_code = extract_code_block_content( + correct_answer, + is_ascii_art=True, + should_remove_surrounding_whitespace=False, + ) + # assert is_code + return ExactStrMatch.match(response, correct_answer) diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/megabench/scoring/normalized_similarity_damerau_levenshtein.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/megabench/scoring/normalized_similarity_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..110ed84665d541dd9bc510b3c9faaad4bdd12ddc --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/utils/megabench/scoring/normalized_similarity_damerau_levenshtein.py @@ -0,0 +1,14 @@ +import rapidfuzz + + +class NormalizedSimilarityDamerauLevenshtein: + """Normalized Damerau-Levenshtein Similarity.""" + + @staticmethod + def match(response, correct_answer) -> int: + """Normalized indel similarityuiio do between targets and responses.""" + if not isinstance(response, str) and isinstance(correct_answer, str): + return 0 + return rapidfuzz.distance.DamerauLevenshtein.normalized_similarity( + response, correct_answer + ) diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/mmif/__init__.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/mmif/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/mmif/__pycache__/function_and_compare.cpython-310.pyc b/VLMEvalKit-sudoku/vlmeval/dataset/utils/mmif/__pycache__/function_and_compare.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2b121ed0d13d31ad855b1dd35e49736586e0979 Binary files /dev/null and b/VLMEvalKit-sudoku/vlmeval/dataset/utils/mmif/__pycache__/function_and_compare.cpython-310.pyc differ diff --git a/VLMEvalKit-sudoku/vlmeval/dataset/utils/mmif/function_and_compare.py b/VLMEvalKit-sudoku/vlmeval/dataset/utils/mmif/function_and_compare.py new file mode 100644 index 0000000000000000000000000000000000000000..2e1184b1f90e12cb98f29dc064e60ae43da80b8a --- /dev/null +++ b/VLMEvalKit-sudoku/vlmeval/dataset/utils/mmif/function_and_compare.py @@ -0,0 +1,429 @@ +# flake8: noqa +import re +from typing import List +import nltk +# from dotenv import load_dotenv + +# load_dotenv() + +# # nltk.download("punkt") +# nltk.data.path.append( +# os.environ["NLTK_DATA_PATH"] +# ) + +# HumanCheck: True + + +def check_whether_response_paragraph_number_in_range( + response: str, lower_bound: int, upper_bound: int +) -> bool: + def clean_text(text: str) -> str: + return "\n".join(line.strip() for line in text.splitlines()).strip() + + cleaned_response = clean_text(response) + + # use re to check the number of paragraphs + paragraphs = [ + p for p in re.split( + r"\n\s*\n", + cleaned_response) if p.strip()] + + actual_count = len(paragraphs) + # print(actual_count) + + return lower_bound <= actual_count <= upper_bound + +# HumanCheck: True + + +def check_whether_response_sentence_number_in_range( + response: str, lower_bound: int, upper_bound: int +) -> bool: + def clean_text(response: str) -> str: + return "\n".join(line.strip() + for line in response.splitlines()).strip() + + response = clean_text(response) + + # use nltk to split the response into sentences + sentences = nltk.sent_tokenize(response) + actual_count = len(sentences) + # print(actual_count) + + return lower_bound <= actual_count <= upper_bound + +# HumanCheck: True + + +def check_whether_each_paragraph_sentence_number_in_range( + response: str, lower_bound: int, upper_bound: int +) -> bool: + def clean_text(text: str) -> str: + return "\n".join(line.strip() for line in text.splitlines()).strip() + + cleaned_response = clean_text(response) + + # use re to check the number of paragraphs + paragraphs = [ + p for p in re.split( + r"\n\s*\n", + cleaned_response) if p.strip()] + + for i, paragraph in enumerate(paragraphs): + # use nltk to split the paragraph into sentences + sentences = nltk.sent_tokenize(paragraph) + actual_count = len(sentences) + # print(f"paragraph {i}: {actual_count}") + if actual_count < lower_bound or actual_count > upper_bound: + return False + + return True + +# HumanCheck: True + + +def check_whether_each_paragraph_sentence_number_in_range_list( + response: str, ranges: List[List[int]] +) -> bool: + def clean_text(text: str) -> str: + return "\n".join(line.strip() for line in text.splitlines()).strip() + + cleaned_response = clean_text(response) + + # use re to check the number of paragraphs + paragraphs = [ + p for p in re.split( + r"\n\s*\n", + cleaned_response) if p.strip()] + + if len(paragraphs) != len(ranges): + return False + + for i, (paragraph, range_pair) in enumerate(zip(paragraphs, ranges)): + lower_bound, upper_bound = range_pair + sentences = nltk.sent_tokenize(paragraph) + actual_count = len(sentences) + # print(f"paragraph {i}: {actual_count}") + if not (lower_bound <= actual_count <= upper_bound): + return False + + return True + +# HumanCheck: True + + +def check_whether_response_word_count_in_range( + response: str, lower_bound: int, upper_bound: int +) -> bool: + # this line is used to filter out all non-word characters + response_clean = re.sub(r"[^\w\s.-]", "", response) + word_list = response_clean.split() + word_count = len(word_list) + # print(word_count) + return lower_bound <= word_count <= upper_bound + +# HumanCheck: True + + +def check_whether_each_paragraph_word_count_in_range( + response: str, lower_bound: int, upper_bound: int +) -> bool: + # Check whether the number of words in each paragraph of the response is greater than or equal to lower_bound and less than or equal to upper_bound. + # Here are some examples of calling this function based on constraints: + # If the constraint requires that the number of words in each paragraph + # should be between 50 and 80, then lower_bound = 50 and upper_bound = 80. + def clean_text(text: str) -> str: + return "\n".join(line.strip() for line in text.splitlines()).strip() + + cleaned_response = clean_text(response) + + # use re to check the number of paragraphs + paragraphs = [ + p for p in re.split( + r"\n\s*\n", + cleaned_response) if p.strip()] + + for i, paragraph in enumerate(paragraphs): + paragraph_clean = re.sub(r"[^\w\s.-]", "", paragraph) + word_count = len(paragraph_clean.split()) + # print(f"paragraph {i} word count: {word_count}") + if not (lower_bound <= word_count <= upper_bound): + return False + + return True + +# HumanCheck: True + + +def check_whether_whole_response_not_contain_certain_substrings( + response: str, substrings: List[str] +) -> bool: + # Check whether the entire response does not contain any of the specified substrings. + # Here are some examples of calling this function based on constraints: + # If the constraint requires that the response should not contain the + # words "apple" and "banana", then substrings = ["apple", "banana"]. + return all(substring not in response for substring in substrings) + +# HumanCheck: True + + +def check_whether_whole_response_not_contain_certain_substring( + response: str, substring: str +) -> bool: + return substring not in response + +# HumanCheck: True + + +def check_whether_each_sentence_begin_with_certain_substring( + response: str, substring: str +) -> bool: + # Check whether each sentence in the response starts with the specified substring. + # Here are some examples of calling this function based on constraints: + # If the constraint requires that each sentence should start with + # exclamation point, then substring = "!". + def clean_text(response: str) -> str: + return "\n".join(line.strip() + for line in response.splitlines()).strip() + + response = clean_text(response) + + sentences = nltk.sent_tokenize(response) + + return all(sentence.startswith(substring) for sentence in sentences) + +# HumanCheck: True + + +def check_whether_each_paragraph_begin_with_certain_substring( + response: str, substring: str +) -> bool: + def clean_text(response: str) -> str: + return "\n".join(line.strip() + for line in response.splitlines()).strip() + + cleaned_response = clean_text(response) + + paragraphs = [ + p for p in re.split( + r"\n\s*\n", + cleaned_response) if p.strip()] + + return all(paragraph.startswith(substring) for paragraph in paragraphs) + +# HumanCheck: True + + +def check_whether_each_paragraph_end_with_certain_substring( + response: str, substring: str +) -> bool: + def clean_text(response: str) -> str: + return "\n".join(line.strip() + for line in response.splitlines()).strip() + + cleaned_response = clean_text(response) + + paragraphs = [ + p for p in re.split( + r"\n\s*\n", + cleaned_response) if p.strip()] + + return all(paragraph.endswith(substring) for paragraph in paragraphs) + +# HumanCheck: True + + +def check_whether_each_sentence_end_with_certain_substring( + response: str, substring: str +) -> bool: + def clean_text(response: str) -> str: + return "\n".join(line.strip() + for line in response.splitlines()).strip() + + response = clean_text(response) + + sentences = nltk.sent_tokenize(response) + + return all(sentence.endswith(substring) for sentence in sentences) + +# HumanCheck: True + + +def check_whether_whole_response_begin_with_certain_substring( + response: str, substring: str +) -> bool: + return response.strip().startswith(substring) + +# HumanCheck: True + + +def check_whether_whole_response_end_with_certain_substring( + response: str, substring: str +) -> bool: + return response.strip().endswith(substring) + +# HumanCheck: True + + +def check_whether_each_keyword_in_list_metioned_in_range( + response: str, + keywords: List[str], + lower_bound_times: int, + upper_bound_times: int) -> bool: + # should notice case like "Reddit" is counted as "Redditor" + def clean_text(response: str) -> str: + return "\n".join(line.strip() + for line in response.splitlines()).strip() + + response = clean_text(response) + response_lower = response.lower() + + for keyword in keywords: + # use \b to match the whole word + pattern = r'\b' + re.escape(keyword.lower()) + r'\b' + matches = re.findall(pattern, response_lower) + if len(matches) < lower_bound_times or len( + matches) > upper_bound_times: + return False + + return True + +# HumanCheck: True + + +def check_whether_total_keyword_in_list_metioned_in_range( + response: str, + keywords: List[str], + lower_bound_times: int, + upper_bound_times: int) -> bool: + # should notice case like "Reddit" is counted as "Redditor" + def clean_text(response: str) -> str: + return "\n".join(line.strip() + for line in response.splitlines()).strip() + + response = clean_text(response) + response_lower = response.lower() + + count = 0 + for keyword in keywords: + pattern = r'\b' + re.escape(keyword.lower()) + r'\b' + matches = re.findall(pattern, response_lower) + count += len(matches) + + return lower_bound_times <= count <= upper_bound_times + +# HumanCheck: True + + +def check_percentage_number_precision_in_response( + response: str, precision: int) -> bool: + # All numeric values that appear before a percentage sign (%) must be + # rounded and retained to two decimal places. + pattern = r'(\d+\.\d+|\d+)\s*%' # allow numbers and % to have spaces + + matches = re.findall(pattern, response) + + for num_str in matches: + if '.' not in num_str: + # no decimal point, not a float number + return False + decimal_part = num_str.split('.')[1] + if len(decimal_part) != precision: + return False + + return True + +# HumanCheck: True + + +def check_number_precision_in_response(response: str, precision: int) -> bool: + # Regex pattern to extract numbers, including scientific notation and + # percentages + number_pattern = r''' + (? bool: + number_pattern = r""" + (? bool: +# scientific_pattern = r"(?" +DEFAULT_VIDEO_TOKEN = "