Skip to content

Commit

Permalink
should handle filenames with multiple periods
Browse files Browse the repository at this point in the history
  • Loading branch information
jveitchmichaelis committed Jan 14, 2020
1 parent 54beddc commit 9420656
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cocoexporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ bool CocoExporter::processImages(const QString folder, const QString label_filen
if(!export_unlabelled && labels.size() == 0) continue;

QString extension = QFileInfo(image_path).suffix();
QString filename_noext = QFileInfo(image_path).baseName();
QString filename_noext = QFileInfo(image_path).completeBaseName();

QString image_filename = QString("%1/%2.%3").arg(folder).arg(filename_noext).arg(extension);

Expand Down
2 changes: 1 addition & 1 deletion src/darknetexporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool DarknetExporter::processImages(const QString folder, const QList<QString> i
if(!export_unlabelled && labels.size() == 0) continue;

QString extension = QFileInfo(image_path).suffix();
QString filename_noext = QFileInfo(image_path).baseName();
QString filename_noext = QFileInfo(image_path).completeBaseName();
QString image_filename = QString("%1/%2.%3").arg(folder).arg(filename_noext).arg(extension);

// Correct for duplicate file names in output
Expand Down
2 changes: 1 addition & 1 deletion src/kittiexporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int KittiExporter::processSet(QString folder, QList<QString> images, int i){
if(!export_unlabelled && labels.size() == 0) continue;

QString extension = QFileInfo(image).suffix();
QString filename_noext = QFileInfo(image).baseName();
QString filename_noext = QFileInfo(image).completeBaseName();

QString image_filename = QString("%1/%2.%3").arg(folder).arg(filename_noext).arg(extension);

Expand Down
2 changes: 1 addition & 1 deletion src/labelproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void LabelProject::cancelLoad(){
void LabelProject::addVideo(QString fileName, QString outputFolder){
cv::VideoCapture video(fileName.toStdString());

QString base_name = QFileInfo(fileName).baseName();
QString base_name = QFileInfo(fileName).completeBaseName();
QDir dir(outputFolder);

cv::Mat frame;
Expand Down
2 changes: 1 addition & 1 deletion src/pascalvocexporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ bool PascalVocExporter::processImages(const QString folder, const QList<QString>


QString extension = QFileInfo(image_path).suffix();
QString filename_noext = QFileInfo(image_path).baseName();
QString filename_noext = QFileInfo(image_path).completeBaseName();
QString image_filename = QString("%1/%2.%3").arg(folder).arg(filename_noext).arg(extension);

// Correct for duplicate file names in output
Expand Down

0 comments on commit 9420656

Please sign in to comment.