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

Fix import command on Windows #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jakewarrenblack
Copy link

@jakewarrenblack jakewarrenblack commented Mar 23, 2023

Import command (e.g. roboflow import C:\Users\Jake\Downloads\Aerial_Maritime.v24i.yolov8 -p test-zixpe would not work on windows, and just failed silently.

Replace forward slashes in globPattern with backslashes, needs to be in POSIX format. See https://stackoverflow.com/questions/55512907/node-glob-sync-returns-empty-array

It seems to me like this only works for PASCAL VOC format. I tried uploading YOLOv8 PyTorch TXT annotations, which didn't work, and just resulted in annotations covering the entire image. PASCAL VOC seems to work.

Description

Please include a summary of the change and which issue is fixed or implemented. Please also include relevant motivation and context (e.g. links, docs, tickets etc.).

Uncommented await Promise.all(uploadPromises); in upload.js

Replace forward slashes with backslashes to match format expected by glob.sync

Type of change

  • [✔ ] Bug fix (non-breaking change which fixes an issue)

…path with backslashes for globPattern, uncomment await for uploadPromises
@yeldarby yeldarby requested a review from hansent May 25, 2023 14:30
@@ -10,7 +10,7 @@ function listFilesInFolder(folder) {
const dirName = path.relative("", path.resolve(folder));
const globPattern = path.join(dirName, "**/*");

return glob.sync(globPattern);
return glob.sync(globPattern.replace(/\\/g, '/'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this probably needs a check to only do this on windows?

Copy link
Contributor

@hansent hansent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR.

I think in order to include this we need two changes:

  • only replace the slashes in the pattern on windows
  • add some unit tests the functionality

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

3 participants