You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Jozef Mlich 3c0612caf5 backup all WIP 2 years ago
data explanation about sampling 4 years ago
test backup all WIP 2 years ago
.gitignore store mask and palette (list of tags) 3 years ago
README-deeplab-labelme.txt update scripts to prepare data for deeplab 3 years ago
README.md sampling on scale pow(2, level) 4 years ago
blacklist.txt backup all WIP 2 years ago
blacklist.txt-bowfire-to-my backup all WIP 2 years ago
blacklist.txt.backup backup all WIP 2 years ago
bowfire_aug.sh scripts for conversion of bowfire to required shape 3 years ago
bowfire_convert_mask.py detect and fix rotated files 2 years ago
crop_negative_labels.sh some changes 2 years ago
crop_orig_labels.sh update scripts 2 years ago
detect_corrupted_files.sh detect and fix rotated files 2 years ago
detect_rotated_files.sh update scripts 2 years ago
prepare_list_of_images.sh backup all WIP 2 years ago
save_all_labels.sh update scripts 2 years ago
save_all_samples.sh sampling on scale pow(2, level) 4 years ago
save_labelme.py store mask and palette (list of tags) 3 years ago
save_labelme_samples.py store mask and palette (list of tags) 3 years ago
show_labelme.py remove some debuging information 4 years ago
sun_fire_detected_run2.txt backup all WIP 2 years ago
test_samples.sh sampling on scale pow(2, level) 4 years ago
test_show_labelme.sh remove some debuging information 4 years ago

README.md

Some python tools to work with annotation created with labelme

show_labelme

Tool shows image with labels on the screen.

Example of input image: Input

Example of Annotaion XML:

<annotation>
    <filename>000092.jpg</filename>
    <folder>fire</folder>
    <source>
        <sourceImage>The MIT-CSAIL database of objects and scenes</sourceImage>
        <sourceAnnotation>LabelMe Webtool</sourceAnnotation>
    </source>
    <object>
        <name>fire</name>
        <deleted>0</deleted>
        <verified>0</verified>
        <occluded>no</occluded>
        <attributes/>
        <parts>
            <hasparts/>
            <ispartof/>
        </parts>
        <date>18-Dec-2017 13:40:42</date>
        <id>0</id>
        <polygon>
            <username>test</username>
            <pt>
                <x>776</x>
                <y>671</y>
            </pt>
            <pt>
                <x>923</x>
                <y>642</y>
            </pt>
            <pt>
                <x>966</x>
                <y>638</y>
            </pt>
            <pt>
                <x>864</x>
                <y>569</y>
            </pt>
            <pt>
                <x>863</x>
                <y>490</y>
            </pt>
            <pt>
                <x>790</x>
                <y>477</y>
            </pt>
            <pt>
                <x>769</x>
                <y>484</y>
            </pt>
            <pt>
                <x>760</x>
                <y>550</y>
            </pt>
            <pt>
                <x>712</x>
                <y>604</y>
            </pt>
        </polygon>
    </object>
    <object>
        <name>fire</name>
        <deleted>0</deleted>
        <verified>0</verified>
        <occluded>no</occluded>
        <attributes/>
        <parts>
            <hasparts/>
            <ispartof/>
        </parts>
        <date>18-Dec-2017 13:40:48</date>
        <id>1</id>
        <polygon>
            <username>test</username>
            <pt>
                <x>868</x>
                <y>454</y>
            </pt>
            <pt>
                <x>969</x>
                <y>484</y>
            </pt>
            <pt>
                <x>1048</x>
                <y>450</y>
            </pt>
            <pt>
                <x>974</x>
                <y>373</y>
            </pt>
            <pt>
                <x>869</x>
                <y>382</y>
            </pt>
            <pt>
                <x>784</x>
                <y>400</y>
            </pt>
        </polygon>
    </object>
    <object>
        <name>fire</name>
        <deleted>0</deleted>
        <verified>0</verified>
        <occluded>no</occluded>
        <attributes/>
        <parts>
            <hasparts/>
            <ispartof/>
        </parts>
        <date>18-Dec-2017 13:40:52</date>
        <id>2</id>
        <polygon>
            <username>test</username>
            <pt>
                <x>1028</x>
                <y>639</y>
            </pt>
            <pt>
                <x>1075</x>
                <y>552</y>
            </pt>
            <pt>
                <x>1107</x>
                <y>573</y>
            </pt>
            <pt>
                <x>1107</x>
                <y>623</y>
            </pt>
            <pt>
                <x>1085</x>
                <y>663</y>
            </pt>
            <pt>
                <x>1045</x>
                <y>680</y>
            </pt>
        </polygon>
    </object>
    <object>
        <name>fire</name>
        <deleted>0</deleted>
        <verified>0</verified>
        <occluded>no</occluded>
        <attributes/>
        <parts>
            <hasparts/>
            <ispartof/>
        </parts>
        <date>18-Dec-2017 13:40:58</date>
        <id>3</id>
        <polygon>
            <username>test</username>
            <pt>
                <x>769</x>
                <y>349</y>
            </pt>
            <pt>
                <x>811</x>
                <y>330</y>
            </pt>
            <pt>
                <x>833</x>
                <y>287</y>
            </pt>
            <pt>
                <x>834</x>
                <y>216</y>
            </pt>
            <pt>
                <x>803</x>
                <y>222</y>
            </pt>
            <pt>
                <x>785</x>
                <y>238</y>
            </pt>
        </polygon>
    </object>
    <imagesize>
        <nrows/>
        <ncols/>
    </imagesize>
</annotation>

Annotation

Output

usage: show_labelme.py image.jpg labelme.xml

  • e.g. test_show_labelme.sh

save_labelme

Tool renders same image as show_labelme, but into output.jpg

usage: save_labelme.py image.jpg labelme.xml output.jpg

  • e.g. save_all_labels.sh

save_labelme_samples

usage: save_labelme_samples.py image.jpg labelme.xml outputdir class

  • walk over image with window 48x48 and step 16x16
  • check if center pixel is in class defined in argv
  • renders every such region in separate picture
  • downscale twice and repeat when possible

Sample1 Sample2 Sample3 Sample4

  • e.g. test_samples.sh
  • e.g. save_all_samples.sh