Dataset Viewer
Auto-converted to Parquet Duplicate
image
imagewidth (px)
512
512
type
stringclasses
3 values
object_label
stringclasses
100 values
attack_word
stringclasses
100 values
text_area
stringlengths
235
266
id
stringlengths
12
17
RTA
adapter
apple
{"bbox":[166.0,291.5,350.0,386.0],"format":"xyxy","source":"manual_box","selected_text":"apple","fill_color_bgr":[192,200,226],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=apple.jpg"}
RTA_img_0001
SynthRTA
adapter
apple
{"bbox":[166.0,291.5,350.0,386.0],"format":"xyxy","source":"manual_box","selected_text":"apple","fill_color_bgr":[192,200,226],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=apple.jpg"}
SynthRTA_img_0001
NoRTA
adapter
apple
{"bbox":[166.0,291.5,350.0,386.0],"format":"xyxy","source":"manual_box","selected_text":"apple","fill_color_bgr":[192,200,226],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=apple.jpg"}
NoRTA_img_0001
RTA
adapter
basket
{"bbox":[112.0,302.0,279.0,425.0],"format":"xyxy","source":"manual_box","selected_text":"basket","fill_color_bgr":[131,147,192],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=basket.jpg"}
RTA_img_0002
SynthRTA
adapter
basket
{"bbox":[112.0,302.0,279.0,425.0],"format":"xyxy","source":"manual_box","selected_text":"basket","fill_color_bgr":[131,147,192],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=basket.jpg"}
SynthRTA_img_0002
NoRTA
adapter
basket
{"bbox":[112.0,302.0,279.0,425.0],"format":"xyxy","source":"manual_box","selected_text":"basket","fill_color_bgr":[131,147,192],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=basket.jpg"}
NoRTA_img_0002
RTA
adapter
hand
{"bbox":[136.5,248.0,336.5,406.0],"format":"xyxy","source":"manual_box","selected_text":"hand","fill_color_bgr":[147,162,203],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=hand.jpg"}
RTA_img_0003
SynthRTA
adapter
hand
{"bbox":[136.5,248.0,336.5,406.0],"format":"xyxy","source":"manual_box","selected_text":"hand","fill_color_bgr":[147,162,203],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=hand.jpg"}
SynthRTA_img_0003
NoRTA
adapter
hand
{"bbox":[136.5,248.0,336.5,406.0],"format":"xyxy","source":"manual_box","selected_text":"hand","fill_color_bgr":[147,162,203],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=hand.jpg"}
NoRTA_img_0003
RTA
adapter
jacket
{"bbox":[135.0,321.0,315.0,419.0],"format":"xyxy","source":"manual_box","selected_text":"jacket","fill_color_bgr":[209,178,187],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=jacket.jpg"}
RTA_img_0004
SynthRTA
adapter
jacket
{"bbox":[135.0,321.0,315.0,419.0],"format":"xyxy","source":"manual_box","selected_text":"jacket","fill_color_bgr":[209,178,187],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=jacket.jpg"}
SynthRTA_img_0004
NoRTA
adapter
jacket
{"bbox":[135.0,321.0,315.0,419.0],"format":"xyxy","source":"manual_box","selected_text":"jacket","fill_color_bgr":[209,178,187],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=jacket.jpg"}
NoRTA_img_0004
RTA
adapter
mic
{"bbox":[153.5,206.0,418.5,404.5],"format":"xyxy","source":"manual_box","selected_text":"mic","fill_color_bgr":[98,188,174],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=mic.jpg"}
RTA_img_0005
SynthRTA
adapter
mic
{"bbox":[153.5,206.0,418.5,404.5],"format":"xyxy","source":"manual_box","selected_text":"mic","fill_color_bgr":[98,188,174],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=mic.jpg"}
SynthRTA_img_0005
NoRTA
adapter
mic
{"bbox":[153.5,206.0,418.5,404.5],"format":"xyxy","source":"manual_box","selected_text":"mic","fill_color_bgr":[98,188,174],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=mic.jpg"}
NoRTA_img_0005
RTA
adapter
microwave
{"bbox":[52.0,294.0,316.0,440.5],"format":"xyxy","source":"manual_box","selected_text":"microwave","fill_color_bgr":[151,169,216],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=microwave.jpg"}
RTA_img_0006
SynthRTA
adapter
microwave
{"bbox":[52.0,294.0,316.0,440.5],"format":"xyxy","source":"manual_box","selected_text":"microwave","fill_color_bgr":[151,169,216],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=microwave.jpg"}
SynthRTA_img_0006
NoRTA
adapter
microwave
{"bbox":[52.0,294.0,316.0,440.5],"format":"xyxy","source":"manual_box","selected_text":"microwave","fill_color_bgr":[151,169,216],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=microwave.jpg"}
NoRTA_img_0006
RTA
adapter
ruler
{"bbox":[205.0,331.5,357.0,401.5],"format":"xyxy","source":"manual_box","selected_text":"ruler","fill_color_bgr":[155,212,150],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=ruler.jpg"}
RTA_img_0007
SynthRTA
adapter
ruler
{"bbox":[205.0,331.5,357.0,401.5],"format":"xyxy","source":"manual_box","selected_text":"ruler","fill_color_bgr":[155,212,150],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=ruler.jpg"}
SynthRTA_img_0007
NoRTA
adapter
ruler
{"bbox":[205.0,331.5,357.0,401.5],"format":"xyxy","source":"manual_box","selected_text":"ruler","fill_color_bgr":[155,212,150],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=ruler.jpg"}
NoRTA_img_0007
RTA
adapter
speaker
{"bbox":[84.0,280.0,388.0,388.5],"format":"xyxy","source":"manual_box","selected_text":"speaker","fill_color_bgr":[97,177,164],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=speaker.jpg"}
RTA_img_0008
SynthRTA
adapter
speaker
{"bbox":[84.0,280.0,388.0,388.5],"format":"xyxy","source":"manual_box","selected_text":"speaker","fill_color_bgr":[97,177,164],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=speaker.jpg"}
SynthRTA_img_0008
NoRTA
adapter
speaker
{"bbox":[84.0,280.0,388.0,388.5],"format":"xyxy","source":"manual_box","selected_text":"speaker","fill_color_bgr":[97,177,164],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=speaker.jpg"}
NoRTA_img_0008
RTA
adapter
thermometer
{"bbox":[158.0,286.0,400.5,462.5],"format":"xyxy","source":"manual_box","selected_text":"thermometer","fill_color_bgr":[252,232,194],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=thermometer.jpg"}
RTA_img_0009
SynthRTA
adapter
thermometer
{"bbox":[158.0,286.0,400.5,462.5],"format":"xyxy","source":"manual_box","selected_text":"thermometer","fill_color_bgr":[252,232,194],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=thermometer.jpg"}
SynthRTA_img_0009
NoRTA
adapter
thermometer
{"bbox":[158.0,286.0,400.5,462.5],"format":"xyxy","source":"manual_box","selected_text":"thermometer","fill_color_bgr":[252,232,194],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=thermometer.jpg"}
NoRTA_img_0009
RTA
adapter
trash box
{"bbox":[219.0,308.0,461.5,434.5],"format":"xyxy","source":"manual_box","selected_text":"trash box","fill_color_bgr":[148,228,230],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=trash box.jpg"}
RTA_img_0010
SynthRTA
adapter
trash box
{"bbox":[219.0,308.0,461.5,434.5],"format":"xyxy","source":"manual_box","selected_text":"trash box","fill_color_bgr":[148,228,230],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=trash box.jpg"}
SynthRTA_img_0010
NoRTA
adapter
trash box
{"bbox":[219.0,308.0,461.5,434.5],"format":"xyxy","source":"manual_box","selected_text":"trash box","fill_color_bgr":[148,228,230],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=adapter_text=trash box.jpg"}
NoRTA_img_0010
RTA
airconditioner
bag
{"bbox":[275.5,310.5,369.5,372.5],"format":"xyxy","source":"manual_box","selected_text":"bag","fill_color_bgr":[151,144,188],"manual_fill_color":false,"postit_detected":false,"fill_mode":"text","source_filename":"label=airconditioner_text=bag.jpg"}
RTA_img_0011
SynthRTA
airconditioner
bag
{"bbox":[275.5,310.5,369.5,372.5],"format":"xyxy","source":"manual_box","selected_text":"bag","fill_color_bgr":[151,144,188],"manual_fill_color":false,"postit_detected":false,"fill_mode":"text","source_filename":"label=airconditioner_text=bag.jpg"}
SynthRTA_img_0011
NoRTA
airconditioner
bag
{"bbox":[275.5,310.5,369.5,372.5],"format":"xyxy","source":"manual_box","selected_text":"bag","fill_color_bgr":[151,144,188],"manual_fill_color":false,"postit_detected":false,"fill_mode":"text","source_filename":"label=airconditioner_text=bag.jpg"}
NoRTA_img_0011
RTA
airconditioner
bookshelf
{"bbox":[203.0,237.0,282.0,279.5],"format":"xyxy","source":"manual_box","selected_text":"bookshelf","fill_color_bgr":[163,155,196],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=bookshelf.jpg"}
RTA_img_0012
SynthRTA
airconditioner
bookshelf
{"bbox":[203.0,237.0,282.0,279.5],"format":"xyxy","source":"manual_box","selected_text":"bookshelf","fill_color_bgr":[163,155,196],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=bookshelf.jpg"}
SynthRTA_img_0012
NoRTA
airconditioner
bookshelf
{"bbox":[203.0,237.0,282.0,279.5],"format":"xyxy","source":"manual_box","selected_text":"bookshelf","fill_color_bgr":[163,155,196],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=bookshelf.jpg"}
NoRTA_img_0012
RTA
airconditioner
keyboard
{"bbox":[254.5,264.5,344.0,307.5],"format":"xyxy","source":"manual_box","selected_text":"keyboard","fill_color_bgr":[118,191,165],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=keyboard.jpg"}
RTA_img_0013
SynthRTA
airconditioner
keyboard
{"bbox":[254.5,264.5,344.0,307.5],"format":"xyxy","source":"manual_box","selected_text":"keyboard","fill_color_bgr":[118,191,165],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=keyboard.jpg"}
SynthRTA_img_0013
NoRTA
airconditioner
keyboard
{"bbox":[254.5,264.5,344.0,307.5],"format":"xyxy","source":"manual_box","selected_text":"keyboard","fill_color_bgr":[118,191,165],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=keyboard.jpg"}
NoRTA_img_0013
RTA
airconditioner
light bulb
{"bbox":[87.5,221.0,203.5,282.5],"format":"xyxy","source":"manual_box","selected_text":"light bulb","fill_color_bgr":[153,148,191],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=light bulb.jpg"}
RTA_img_0014
SynthRTA
airconditioner
light bulb
{"bbox":[87.5,221.0,203.5,282.5],"format":"xyxy","source":"manual_box","selected_text":"light bulb","fill_color_bgr":[153,148,191],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=light bulb.jpg"}
SynthRTA_img_0014
NoRTA
airconditioner
light bulb
{"bbox":[87.5,221.0,203.5,282.5],"format":"xyxy","source":"manual_box","selected_text":"light bulb","fill_color_bgr":[153,148,191],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=light bulb.jpg"}
NoRTA_img_0014
RTA
airconditioner
pants
{"bbox":[237.5,240.0,322.5,292.0],"format":"xyxy","source":"manual_box","selected_text":"pants","fill_color_bgr":[187,143,110],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=pants.jpg"}
RTA_img_0015
SynthRTA
airconditioner
pants
{"bbox":[237.5,240.0,322.5,292.0],"format":"xyxy","source":"manual_box","selected_text":"pants","fill_color_bgr":[187,143,110],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=pants.jpg"}
SynthRTA_img_0015
NoRTA
airconditioner
pants
{"bbox":[237.5,240.0,322.5,292.0],"format":"xyxy","source":"manual_box","selected_text":"pants","fill_color_bgr":[187,143,110],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=pants.jpg"}
NoRTA_img_0015
RTA
airconditioner
pen
{"bbox":[312.5,304.0,372.0,353.0],"format":"xyxy","source":"manual_box","selected_text":"pen","fill_color_bgr":[198,205,208],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=pen.jpg"}
RTA_img_0016
SynthRTA
airconditioner
pen
{"bbox":[312.5,304.0,372.0,353.0],"format":"xyxy","source":"manual_box","selected_text":"pen","fill_color_bgr":[198,205,208],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=pen.jpg"}
SynthRTA_img_0016
NoRTA
airconditioner
pen
{"bbox":[312.5,304.0,372.0,353.0],"format":"xyxy","source":"manual_box","selected_text":"pen","fill_color_bgr":[198,205,208],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=pen.jpg"}
NoRTA_img_0016
RTA
airconditioner
plate
{"bbox":[238.5,299.5,309.5,341.0],"format":"xyxy","source":"manual_box","selected_text":"plate","fill_color_bgr":[182,138,106],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=plate.jpg"}
RTA_img_0017
SynthRTA
airconditioner
plate
{"bbox":[238.5,299.5,309.5,341.0],"format":"xyxy","source":"manual_box","selected_text":"plate","fill_color_bgr":[182,138,106],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=plate.jpg"}
SynthRTA_img_0017
NoRTA
airconditioner
plate
{"bbox":[238.5,299.5,309.5,341.0],"format":"xyxy","source":"manual_box","selected_text":"plate","fill_color_bgr":[182,138,106],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=plate.jpg"}
NoRTA_img_0017
RTA
airconditioner
scissors
{"bbox":[157.0,272.0,254.0,367.5],"format":"xyxy","source":"manual_box","selected_text":"scissors","fill_color_bgr":[176,133,104],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=scissors.jpg"}
RTA_img_0018
SynthRTA
airconditioner
scissors
{"bbox":[157.0,272.0,254.0,367.5],"format":"xyxy","source":"manual_box","selected_text":"scissors","fill_color_bgr":[176,133,104],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=scissors.jpg"}
SynthRTA_img_0018
NoRTA
airconditioner
scissors
{"bbox":[157.0,272.0,254.0,367.5],"format":"xyxy","source":"manual_box","selected_text":"scissors","fill_color_bgr":[176,133,104],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=scissors.jpg"}
NoRTA_img_0018
RTA
airconditioner
tissue
{"bbox":[258.5,310.0,339.0,362.5],"format":"xyxy","source":"manual_box","selected_text":"tissue","fill_color_bgr":[132,194,194],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=tissue.jpg"}
RTA_img_0019
SynthRTA
airconditioner
tissue
{"bbox":[258.5,310.0,339.0,362.5],"format":"xyxy","source":"manual_box","selected_text":"tissue","fill_color_bgr":[132,194,194],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=tissue.jpg"}
SynthRTA_img_0019
NoRTA
airconditioner
tissue
{"bbox":[258.5,310.0,339.0,362.5],"format":"xyxy","source":"manual_box","selected_text":"tissue","fill_color_bgr":[132,194,194],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=tissue.jpg"}
NoRTA_img_0019
RTA
airconditioner
towel
{"bbox":[99.0,260.5,198.0,321.5],"format":"xyxy","source":"manual_box","selected_text":"towel","fill_color_bgr":[159,150,200],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=towel.jpg"}
RTA_img_0020
SynthRTA
airconditioner
towel
{"bbox":[99.0,260.5,198.0,321.5],"format":"xyxy","source":"manual_box","selected_text":"towel","fill_color_bgr":[159,150,200],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=towel.jpg"}
SynthRTA_img_0020
NoRTA
airconditioner
towel
{"bbox":[99.0,260.5,198.0,321.5],"format":"xyxy","source":"manual_box","selected_text":"towel","fill_color_bgr":[159,150,200],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=airconditioner_text=towel.jpg"}
NoRTA_img_0020
RTA
apple
airconditioner
{"bbox":[148.0,335.0,381.5,399.5],"format":"xyxy","source":"manual_box","selected_text":"airconditioner","fill_color_bgr":[132,169,248],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=airconditioner.jpg"}
RTA_img_0021
SynthRTA
apple
airconditioner
{"bbox":[148.0,335.0,381.5,399.5],"format":"xyxy","source":"manual_box","selected_text":"airconditioner","fill_color_bgr":[132,169,248],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=airconditioner.jpg"}
SynthRTA_img_0021
NoRTA
apple
airconditioner
{"bbox":[148.0,335.0,381.5,399.5],"format":"xyxy","source":"manual_box","selected_text":"airconditioner","fill_color_bgr":[132,169,248],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=airconditioner.jpg"}
NoRTA_img_0021
RTA
apple
bag
{"bbox":[189.0,296.0,396.0,443.0],"format":"xyxy","source":"manual_box","selected_text":"bag","fill_color_bgr":[211,219,224],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=bag.jpg"}
RTA_img_0022
SynthRTA
apple
bag
{"bbox":[189.0,296.0,396.0,443.0],"format":"xyxy","source":"manual_box","selected_text":"bag","fill_color_bgr":[211,219,224],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=bag.jpg"}
SynthRTA_img_0022
NoRTA
apple
bag
{"bbox":[189.0,296.0,396.0,443.0],"format":"xyxy","source":"manual_box","selected_text":"bag","fill_color_bgr":[211,219,224],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=bag.jpg"}
NoRTA_img_0022
RTA
apple
doll
{"bbox":[137.0,317.0,363.5,434.0],"format":"xyxy","source":"manual_box","selected_text":"doll","fill_color_bgr":[139,150,158],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=doll.jpg"}
RTA_img_0023
SynthRTA
apple
doll
{"bbox":[137.0,317.0,363.5,434.0],"format":"xyxy","source":"manual_box","selected_text":"doll","fill_color_bgr":[139,150,158],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=doll.jpg"}
SynthRTA_img_0023
NoRTA
apple
doll
{"bbox":[137.0,317.0,363.5,434.0],"format":"xyxy","source":"manual_box","selected_text":"doll","fill_color_bgr":[139,150,158],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=doll.jpg"}
NoRTA_img_0023
RTA
apple
drill
{"bbox":[152.0,318.5,357.5,425.0],"format":"xyxy","source":"manual_box","selected_text":"drill","fill_color_bgr":[143,226,241],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=drill.jpg"}
RTA_img_0024
SynthRTA
apple
drill
{"bbox":[152.0,318.5,357.5,425.0],"format":"xyxy","source":"manual_box","selected_text":"drill","fill_color_bgr":[143,226,241],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=drill.jpg"}
SynthRTA_img_0024
NoRTA
apple
drill
{"bbox":[152.0,318.5,357.5,425.0],"format":"xyxy","source":"manual_box","selected_text":"drill","fill_color_bgr":[143,226,241],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=drill.jpg"}
NoRTA_img_0024
RTA
apple
earphones
{"bbox":[104.0,300.5,386.0,414.5],"format":"xyxy","source":"manual_box","selected_text":"earphones","fill_color_bgr":[100,179,206],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=earphones.jpg"}
RTA_img_0025
SynthRTA
apple
earphones
{"bbox":[104.0,300.5,386.0,414.5],"format":"xyxy","source":"manual_box","selected_text":"earphones","fill_color_bgr":[100,179,206],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=earphones.jpg"}
SynthRTA_img_0025
NoRTA
apple
earphones
{"bbox":[104.0,300.5,386.0,414.5],"format":"xyxy","source":"manual_box","selected_text":"earphones","fill_color_bgr":[100,179,206],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=earphones.jpg"}
NoRTA_img_0025
RTA
apple
glasses
{"bbox":[71.5,283.5,276.5,392.0],"format":"xyxy","source":"manual_box","selected_text":"glasses","fill_color_bgr":[120,192,240],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=glasses.jpg"}
RTA_img_0026
SynthRTA
apple
glasses
{"bbox":[71.5,283.5,276.5,392.0],"format":"xyxy","source":"manual_box","selected_text":"glasses","fill_color_bgr":[120,192,240],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=glasses.jpg"}
SynthRTA_img_0026
NoRTA
apple
glasses
{"bbox":[71.5,283.5,276.5,392.0],"format":"xyxy","source":"manual_box","selected_text":"glasses","fill_color_bgr":[120,192,240],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=glasses.jpg"}
NoRTA_img_0026
RTA
apple
glove
{"bbox":[94.0,319.5,347.0,450.5],"format":"xyxy","source":"manual_box","selected_text":"glove","fill_color_bgr":[156,225,242],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=glove.jpg"}
RTA_img_0027
SynthRTA
apple
glove
{"bbox":[94.0,319.5,347.0,450.5],"format":"xyxy","source":"manual_box","selected_text":"glove","fill_color_bgr":[156,225,242],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=glove.jpg"}
SynthRTA_img_0027
NoRTA
apple
glove
{"bbox":[94.0,319.5,347.0,450.5],"format":"xyxy","source":"manual_box","selected_text":"glove","fill_color_bgr":[156,225,242],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=glove.jpg"}
NoRTA_img_0027
RTA
apple
pen
{"bbox":[97.0,297.0,358.0,463.5],"format":"xyxy","source":"manual_box","selected_text":"pen","fill_color_bgr":[126,205,243],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=pen.jpg"}
RTA_img_0028
SynthRTA
apple
pen
{"bbox":[97.0,297.0,358.0,463.5],"format":"xyxy","source":"manual_box","selected_text":"pen","fill_color_bgr":[126,205,243],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=pen.jpg"}
SynthRTA_img_0028
NoRTA
apple
pen
{"bbox":[97.0,297.0,358.0,463.5],"format":"xyxy","source":"manual_box","selected_text":"pen","fill_color_bgr":[126,205,243],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=pen.jpg"}
NoRTA_img_0028
RTA
apple
scissors
{"bbox":[111.5,271.0,369.0,368.0],"format":"xyxy","source":"manual_box","selected_text":"scissors","fill_color_bgr":[135,138,137],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=scissors.jpg"}
RTA_img_0029
SynthRTA
apple
scissors
{"bbox":[111.5,271.0,369.0,368.0],"format":"xyxy","source":"manual_box","selected_text":"scissors","fill_color_bgr":[135,138,137],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=scissors.jpg"}
SynthRTA_img_0029
NoRTA
apple
scissors
{"bbox":[111.5,271.0,369.0,368.0],"format":"xyxy","source":"manual_box","selected_text":"scissors","fill_color_bgr":[135,138,137],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=scissors.jpg"}
NoRTA_img_0029
RTA
apple
whiteboard
{"bbox":[143.0,317.0,347.0,417.0],"format":"xyxy","source":"manual_box","selected_text":"whiteboard","fill_color_bgr":[130,197,215],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=whiteboard.jpg"}
RTA_img_0030
SynthRTA
apple
whiteboard
{"bbox":[143.0,317.0,347.0,417.0],"format":"xyxy","source":"manual_box","selected_text":"whiteboard","fill_color_bgr":[130,197,215],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=whiteboard.jpg"}
SynthRTA_img_0030
NoRTA
apple
whiteboard
{"bbox":[143.0,317.0,347.0,417.0],"format":"xyxy","source":"manual_box","selected_text":"whiteboard","fill_color_bgr":[130,197,215],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=apple_text=whiteboard.jpg"}
NoRTA_img_0030
RTA
bag
card
{"bbox":[212.0,271.5,313.5,338.5],"format":"xyxy","source":"manual_box","selected_text":"card","fill_color_bgr":[197,251,162],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=bag_text=card.jpg"}
RTA_img_0031
SynthRTA
bag
card
{"bbox":[212.0,271.5,313.5,338.5],"format":"xyxy","source":"manual_box","selected_text":"card","fill_color_bgr":[197,251,162],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=bag_text=card.jpg"}
SynthRTA_img_0031
NoRTA
bag
card
{"bbox":[212.0,271.5,313.5,338.5],"format":"xyxy","source":"manual_box","selected_text":"card","fill_color_bgr":[197,251,162],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=bag_text=card.jpg"}
NoRTA_img_0031
RTA
bag
chair
{"bbox":[204.0,276.0,309.0,353.0],"format":"xyxy","source":"manual_box","selected_text":"chair","fill_color_bgr":[221,250,190],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=bag_text=chair.jpg"}
RTA_img_0032
SynthRTA
bag
chair
{"bbox":[204.0,276.0,309.0,353.0],"format":"xyxy","source":"manual_box","selected_text":"chair","fill_color_bgr":[221,250,190],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=bag_text=chair.jpg"}
SynthRTA_img_0032
NoRTA
bag
chair
{"bbox":[204.0,276.0,309.0,353.0],"format":"xyxy","source":"manual_box","selected_text":"chair","fill_color_bgr":[221,250,190],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=bag_text=chair.jpg"}
NoRTA_img_0032
RTA
bag
dog
{"bbox":[252.5,149.5,339.0,230.5],"format":"xyxy","source":"manual_box","selected_text":"dog","fill_color_bgr":[254,202,196],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=bag_text=dog.jpg"}
RTA_img_0033
SynthRTA
bag
dog
{"bbox":[252.5,149.5,339.0,230.5],"format":"xyxy","source":"manual_box","selected_text":"dog","fill_color_bgr":[254,202,196],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=bag_text=dog.jpg"}
SynthRTA_img_0033
NoRTA
bag
dog
{"bbox":[252.5,149.5,339.0,230.5],"format":"xyxy","source":"manual_box","selected_text":"dog","fill_color_bgr":[254,202,196],"manual_fill_color":true,"postit_detected":true,"fill_mode":"postit","source_filename":"label=bag_text=dog.jpg"}
NoRTA_img_0033
RTA
bag
fridge
{"bbox":[74.5,296.0,232.0,399.0],"format":"xyxy","source":"manual_box","selected_text":"fridge","fill_color_bgr":[195,201,251],"manual_fill_color":false,"postit_detected":true,"fill_mode":"postit","source_filename":"label=bag_text=fridge.jpg"}
RTA_img_0034
End of preview. Expand in Data Studio

RTA-100-Triplet

A typographic attack benchmark dataset.

RTA-100-Triplet

Contains the Original RTA-100 (handwriting) with added clean images and a digital text variant. Inspired by the SCAM Dataset.

Three rows per source image (only train split):

  • RTA: original real handwritten typographic attack
  • SynthRTA: same image digital text in the post-it area
  • NoRTA: same image with blank text region
  • Included text_area bounding box coordinates.

Example ZS with CLIP:

Model NoRTA RTA SynthRTA ALL
openai/clip-vit-large-patch14 0.9880 0.4310 0.3890 0.6027
zer0int/CLIP-Regression-ViT-L-14 0.9920 0.7870 0.8060 0.8617
👉 CLICK to expand code for using this dataset with CLIP ⚡💻
from __future__ import annotations
import argparse
import json
from collections import defaultdict
from pathlib import Path
from typing import Any
import torch
import torch.nn.functional as F
from datasets import load_dataset
from PIL import Image
from tqdm import tqdm
from transformers import CLIPModel, CLIPProcessor


MODELS = [
    ("pretrained", "openai/clip-vit-large-patch14"),
    ("finetuned", "zer0int/CLIP-Regression-ViT-L-14"),
]


def normalize_feature(x: torch.Tensor, eps: float = 1e-12) -> torch.Tensor:
    return x / x.norm(dim=-1, keepdim=True).clamp_min(eps)


def unwrap_feature_output(x: Any, kind: str) -> torch.Tensor:
    """
    Robustly extract CLIP embedding tensors from transformers outputs.
    """
    if isinstance(x, torch.Tensor):
        return x

    preferred_attrs = ["pooler_output", "last_hidden_state"]
    if kind == "image":
        preferred_attrs = ["image_embeds"] + preferred_attrs
    elif kind == "text":
        preferred_attrs = ["text_embeds"] + preferred_attrs

    for attr in preferred_attrs:
        if hasattr(x, attr):
            v = getattr(x, attr)
            if isinstance(v, torch.Tensor):
                if attr == "last_hidden_state":
                    return v[:, 0, :]
                return v

    if isinstance(x, (tuple, list)):
        tensors = [v for v in x if isinstance(v, torch.Tensor)]
        if tensors:
            for t in tensors:
                if t.ndim == 2:
                    return t
            if tensors[0].ndim == 3:
                return tensors[0][:, 0, :]
            return tensors[0]

    raise TypeError(f"Could not unwrap {kind} feature output of type {type(x)}")


def batched(iterable, batch_size: int):
    for start in range(0, len(iterable), batch_size):
        yield start, iterable[start : start + batch_size]


def get_image(x: Any) -> Image.Image:
    """
    datasets.Image usually gives PIL.Image directly.
    Keep fallback for dict/path variants.
    """
    if isinstance(x, Image.Image):
        return x.convert("RGB")
    if isinstance(x, dict):
        if x.get("bytes") is not None:
            import io
            return Image.open(io.BytesIO(x["bytes"])).convert("RGB")
        if x.get("path") is not None:
            return Image.open(x["path"]).convert("RGB")
    if isinstance(x, (str, Path)):
        return Image.open(x).convert("RGB")
    raise TypeError(f"Unsupported image field type: {type(x)}")


@torch.inference_mode()
def evaluate_model(
    ds,
    model_alias: str,
    model_name_or_path: str,
    device: torch.device,
    batch_size: int,
    fp16: bool,
) -> dict[str, Any]:
    print(f"\n[load] {model_alias}: {model_name_or_path}")

    processor = CLIPProcessor.from_pretrained(model_name_or_path)
    model = CLIPModel.from_pretrained(model_name_or_path)
    model = model.eval().to(device)

    if fp16:
        model = model.half()

    totals = defaultdict(int)
    corrects = defaultdict(int)
    margins = defaultdict(list)

    indices = list(range(len(ds)))

    for _, batch_indices in tqdm(list(batched(indices, batch_size)), desc=f"eval {model_alias}"):
        examples = [ds[i] for i in batch_indices]

        images = [get_image(ex["image"]) for ex in examples]
        object_labels = [str(ex["object_label"]) for ex in examples]
        attack_words = [str(ex["attack_word"]) for ex in examples]
        types = [str(ex["type"]) for ex in examples]

        # Two prompts per image: object prompt and attack-word prompt.
        texts = []
        for obj, atk in zip(object_labels, attack_words):
            texts.append(f"a photo of a {obj}")
            texts.append(f"a photo of a {atk}")

        image_inputs = processor(images=images, return_tensors="pt")
        text_inputs = processor(text=texts, return_tensors="pt", padding=True, truncation=True)

        image_inputs = {k: v.to(device) for k, v in image_inputs.items()}
        text_inputs = {k: v.to(device) for k, v in text_inputs.items()}

        if fp16:
            image_inputs = {
                k: (v.half() if torch.is_floating_point(v) else v)
                for k, v in image_inputs.items()
            }

        image_features_raw = model.get_image_features(**image_inputs)
        text_features_raw = model.get_text_features(**text_inputs)

        image_features = unwrap_feature_output(image_features_raw, kind="image")
        text_features = unwrap_feature_output(text_features_raw, kind="text")

        image_features = normalize_feature(image_features.float())
        text_features = normalize_feature(text_features.float())

        text_features = text_features.view(len(examples), 2, -1)
        object_sims = (image_features * text_features[:, 0, :]).sum(dim=-1)
        attack_sims = (image_features * text_features[:, 1, :]).sum(dim=-1)
        batch_margins = object_sims - attack_sims
        batch_preds = batch_margins > 0

        for typ, ok, margin in zip(types, batch_preds.tolist(), batch_margins.tolist()):
            totals[typ] += 1
            corrects[typ] += int(ok)
            margins[typ].append(float(margin))

    total_all = sum(totals.values())
    correct_all = sum(corrects.values())

    results = {
        "model_alias": model_alias,
        "model_name_or_path": model_name_or_path,
        "by_type": {},
        "all": {
            "n": total_all,
            "correct": correct_all,
            "accuracy": correct_all / total_all if total_all else None,
            "mean_margin_object_minus_attack": (
                sum(m for vals in margins.values() for m in vals) / total_all if total_all else None
            ),
        },
    }

    for typ in sorted(totals):
        vals = margins[typ]
        results["by_type"][typ] = {
            "n": totals[typ],
            "correct": corrects[typ],
            "accuracy": corrects[typ] / totals[typ] if totals[typ] else None,
            "mean_margin_object_minus_attack": sum(vals) / len(vals) if vals else None,
            "min_margin": min(vals) if vals else None,
            "max_margin": max(vals) if vals else None,
        }

    del model
    if torch.cuda.is_available():
        torch.cuda.empty_cache()

    return results


def print_results(results: list[dict[str, Any]]) -> None:
    print("\n=== ZERO-SHOT RESULTS ===")

    for res in results:
        print(f"\n[{res['model_alias']}] {res['model_name_or_path']}")
        for typ in ["NoRTA", "RTA", "SynthRTA"]:
            item = res["by_type"].get(typ)
            if item is None:
                print(f"  {typ:8s}: missing")
                continue
            print(
                f"  {typ:8s}: "
                f"acc={item['accuracy']:.4f} "
                f"correct={item['correct']}/{item['n']} "
                f"mean_margin={item['mean_margin_object_minus_attack']:+.4f}"
            )

        all_item = res["all"]
        print(
            f"  {'ALL':8s}: "
            f"acc={all_item['accuracy']:.4f} "
            f"correct={all_item['correct']}/{all_item['n']} "
            f"mean_margin={all_item['mean_margin_object_minus_attack']:+.4f}"
        )


def parse_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser(description="ZS binary-choice eval for local RTA-100-Triplet HF dataset.")
    parser.add_argument("--dataset-path", type=str, default="zer0int/RTA-100-Triplet", help="Local HF dataset repo path or HF repo id.")
    parser.add_argument("--split", default="train")
    parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu")
    parser.add_argument("--batch-size", type=int, default=64)
    parser.add_argument("--fp16", action="store_true")
    parser.add_argument("--output-json", default=None)
    parser.add_argument("--trust-remote-code", action="store_true")
    return parser.parse_args()


def main() -> None:
    args = parse_args()
    device = torch.device(args.device)

    print(f"[load_dataset] {args.dataset_path} split={args.split}")
    ds = load_dataset(args.dataset_path, split=args.split, trust_remote_code=args.trust_remote_code)

    print("\n[dataset]")
    print(ds)

    print("[features]")
    print(ds.features)

    results = []
    for alias, model_name_or_path in MODELS:
        res = evaluate_model(
            ds=ds,
            model_alias=alias,
            model_name_or_path=model_name_or_path,
            device=device,
            batch_size=args.batch_size,
            fp16=args.fp16,
        )
        results.append(res)

    print_results(results)

    if args.output_json:
        out = Path(args.output_json)
        out.parent.mkdir(parents=True, exist_ok=True)
        out.write_text(json.dumps(results, ensure_ascii=False, indent=2), encoding="utf-8")
        print(f"\n[wrote] {out}")


if __name__ == "__main__":
    main()
Downloads last month
1,148