Coder Social home page Coder Social logo

supervisely_yolo's Introduction

supervisely_yolo.py

(Script to convert Supervisely to Yolo (Darknet) data structure/format and vice versa)

  • If you convert from Yolo to Supervisely (supervisely_yolo -t y2s) then you need to install the OpenCV python package: pip install opencv-python

  • You can specify the location of your source dataset using -p flag

    • example 1 => python supervisely_yolo.py -p C:\yolo -t y2s
    • example 2 => python supvervisely_yolo.py -p C:\Users\Delilovic\Desktop ([-t s2y] is not required as it is the default flag)
  • You can specify if you want to skip copying images from the source to the destination dataset with the -s flag

    • WARNING: consider using this flag if you have a lot of images and might run out of space
  • When downloading images from Supervisely, images get the extension attached to their names

    • e.g. downloading foo.jpg gets renamed as foo.jpg.jpg
    • this behaviour is handled by the supervisely_yolo.py script, but it also means you can not currently convert Supervisely data structure created by y2s flag back to Yolo data using the s2y flag (this shouldn't be a use case anyway but is worth mentioning here)

Required Folder Structure

  • Please follow this structure strictly
    • you can not have two different Supervisely datasets at the moment (if you do, put everything into the dataset folder)
    • you can not have Yolo images and labels in one folder (if you do, separate them into labels and images folder)
    • data structure is case sensitive (e.g. yolo can not be Yolo)

Supervisely (-t s2y)

├── supervisely
    ├── meta.json
    └── dataset1
        ├── img
        │    ├── any_name.jpg or(.jpeg, .png)
        │    └── ...
        └── ann
            ├── any_name.json
            └── ...
    └── dataset2
        ├── img
        │    ├── any_name.jpg or(.jpeg, .png)
        │    └── ...
        └── ann
            ├── any_name.json
            └── ...

Yolo (-t y2s)

├── yolo
    ├── data.yaml
    ├── images
    │   ├── any_name.jpg or(.jpeg, .png)
    │   └── ...
    └── labels
        ├── any_name.txt
        └── ...

Contributions

  • This is the first version and many updates will be required, everybody interested is gladly invited to contribute

supervisely_yolo's People

Contributors

cfeeney5 avatar delilovic avatar tcotte avatar yavuzkomecoglu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

supervisely_yolo's Issues

"There should be a folder "supervisely" at /home/myName/supervisely_yolo\"

I am trying to run the examples (both supervisely_to_yolo and reverse) and I get this error. I have copied of course the files from the example/ directory into the root, but this error still persists. One thing that is weird the the "" character at the end of the path name in the error message. My path is /home/myName/supervisely_yolo/...
The contents of this directory are :
~/supervisely_yolo$ dir
output: examples LICENSE README.md supervisely supervisely_yolo.py yolo
So as you can see, the two files (supervisely and yolo) are in the root directory.
That said, when running python3 supervisely_yolo.py It returns:
Error [meta.json not found] => There should be a folder "supervisely" at /home/myName/supervisely_yolo\

Any thoughts on this issue?

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.