Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export on ubuntu does not export - unable to open image #35

Open
vladaman opened this issue Apr 7, 2022 · 6 comments
Open

Export on ubuntu does not export - unable to open image #35

vladaman opened this issue Apr 7, 2022 · 6 comments

Comments

@vladaman
Copy link

vladaman commented Apr 7, 2022

Deeplabel reports errors when exporting files on ubuntu 20.04

My source folder with images: /home/vlad/Pictures/Cleaned/zluty/
DB file at: /home/vlad/Pictures/Cleaned/zluty/deeplabel-db.lbldb

Failed top open image "/home/vlad/Pictures/Cleaned/zluty/deeplabel-db.lbldb/../IMG_20220223_114543.jpg"
Failed top open image "/home/vlad/Pictures/Cleaned/zluty/deeplabel-db.lbldb/../IMG_20220223_114949.jpg"
Failed top open image "/home/vlad/Pictures/Cleaned/zluty/deeplabel-db.lbldb/../IMG_20220223_112833.jpg"
Failed top open image "/home/vlad/Pictures/Cleaned/zluty/deeplabel-db.lbldb/../IMG_20220223_113744.jpg"
Failed top open image "/home/vlad/Pictures/Cleaned/zluty/deeplabel-db.lbldb/../IMG_20220223_112706.jpg"
Failed top open image "/home/vlad/Pictures/Cleaned/zluty/deeplabel-db.lbldb/../IMG_20220223_112823.jpg"
@jveitchmichaelis
Copy link
Owner

What format are you exporting?

@vladaman
Copy link
Author

vladaman commented Apr 7, 2022

I was trying COCO (JSON) however:

  • Exporting Deepnet I am missing names file - where to get it?
  • Exporting Pascal VOC it creates output folders but no file is created
  • Exporting GCP AutoML does not enable OK button

So in fact, I am unable to export any format. Only COCO reports problems in console. In fact others report Export output folder doesn't exist yet the folder exists. I also try to remove special characters or spaces from path but it didn't help.

Thank you!

@jveitchmichaelis
Copy link
Owner

You make your own names file. It's a list of classes that you want to export - just newline delimited. It comes from YOLO, but it's a useful way of (a) forcing a specific class order, if that matters and (b) allowing you to filter which classes you export.

But I'll take a look at the export - seems like something is up! Usually if the OK button is disabled, something is missing, but perhaps it's a bug. If you have the code compiled, you could add some debug statements to see what the program is trying to create.

@vladaman
Copy link
Author

vladaman commented Apr 7, 2022

I tried to create names file corresponding with my 2 class names. Then I tried to export using Darknet format and I get following errors:

15  images selected for train set.
58  images selected for validation set.
QString::arg: Argument missing: "IMG_20220223_115017.txt" , 1
QString::arg: Argument missing: "IMG_20220223_113727.txt" , 1
QString::arg: Argument missing: "IMG_20220223_112807.txt" , 1
QString::arg: Argument missing: "IMG_20220223_112906.txt" , 1
QString::arg: Argument missing: "IMG_20220223_114412.txt" , 1
QString::arg: Argument missing: "IMG_20220223_114415.txt" , 1

BTW where is the debug flag, I can change that and recompile

@jveitchmichaelis
Copy link
Owner

jveitchmichaelis commented Apr 7, 2022

Oh fun! Well the names file should be like this (e..g for COCO classes): https://github.com/pjreddie/darknet/blob/master/data/coco.names

I would suggest doing it in Qt Creator - then you can breakpoint easily (and add a debug build). Or you can use qDebug(), that should work in release mode.

@vladaman
Copy link
Author

vladaman commented Apr 7, 2022

OK, what I found it's very likely related to QDir()

return QDir(db.databaseName());

It returns full path which includes also the database file.

I tried following:

  1. updated DB with update images set path = replace(path, "../", "" )
  2. changed method call to:
    QDir getDbFolder(){
            auto db = getDatabase();
            auto rs = QFileInfo(db.databaseName());
            return rs.absoluteDir();
            // return QDir(db.databaseName());
    }

After this the export worked and images were placed into export folder. Unfortunately this is not a fix since it breaks the UI. hopefully this will help you to identify the core issue.
Original code leads to a path which looks like (please note, the db name is included in path)
/home/vlad/Pictures/Cleaned/zluty/deeplabel-db.lbldb/../IMG_20220223_114543.jpg

I also found this article with similar issue https://stackoverflow.com/questions/13783876/qdir-absolutepath-still-returning-the-filename

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants