Code Monkey home page Code Monkey logo

real-world_cityscape_dataset's Introduction

Real-world Cityscape Dataset for Anomaly Detection

1525 modified anomalous images are generated and they are ready to be used for anomaly detection. The dataset is available at: https://drive.google.com/drive/folders/1hdessVmzBi0POxnXkiexg8jOMMvscOCk?usp=sharing

Functions

  • createCandidates()

    • Utilize segmentation maps located in 'gtFine_trainvaltest/' to extract objects from source images located in 'leftImg8bit_trainvaltest/'.
    • Crop the object images to an appropriate size.
    • Exclude images with size less than 300*300 pixels.
    • Save the extracted objects to 'objectImg/' and classify them into different folders based on their classes.
  • sortObjectClass()

    • Count the number of background images.
    • Count the number of objects in each class.
    • Sort the classes based on the number of objects they contain.
  • addAnomaly()

    • Randomly rotate the objects.
    • Resize the objects if they are too big (make sure that the size of the anomaly does not exceed 50% of the background image (1024*1024 pixels)).
    • Randomly place the objects in the center square of the background images.
    • Save the modified anomalous images to 'modifiedImg/'.

Notes

  • The original source dataset is Cityscapes Dataset.
  • There are 34 classes of objects, 13 classes are used as anomalies ('bicycle', 'bus', 'car', 'fence', 'motorcycle', 'person', 'pole', 'traffic_light', 'traffic_sign', 'trailer', 'train', 'truck', 'vegetation').
  • Occluded and defective objects are manually excluded, only complete and big objects can be added to the background images.
  • sortObjectClass() function sorts the number of objects in each class. The class with a smaller number of objects goes first which makes sure as many classes as possible are used as anomalies in the modified images.
  • If the number of background images is smaller than the number of objects, the program will stop generating anomalous images when background images are used up.
  • If the number of background images is bigger than the number of objects, the object set will be used repeatedly until background images are used up.
  • Because every object is rotated and placed randomly in the background images, it is almost impossible to have two identical anomalies.

Reference

M. Cordts, M. Omran, S. Ramos, T. Rehfeld, M. Enzweiler, R. Benenson, U. Franke, S. Roth, and B. Schiele, “The Cityscapes Dataset for Semantic Urban Scene Understanding,” in Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.

real-world_cityscape_dataset's People

Contributors

karlsheng99 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.