yolo-tiling
yolo-tiling copied to clipboard
Fails to load bounding box file.
Hi,
when I run this script it fails to load in the bounding box file that I have. I have attached the file.
Hi. What error messages does it show? You need to have the same number of images and corresponding annotation files. For file 3.txt you need an image with the name 3.jpg
Hi, I get this error, NULL byte detected. This byte cannot be processed in Python's native csv library at the moment, so please pass in engine='c' instead
I have played around with different operators, delimiter, engine and lower memory but nothing seems to get it to work.
currently I am just trying to split one image 3.jpg which is in the correct folder location
What version of Python and Pandas are you using? I have downloaded your file and opened it without problem.
I am using python 3.8.8 64 bit through anaconda and pandas 1.2.4
I use more old versions. Python 3.6.9 and Pandas 1.1.5 But I think the problem is in your file encoding. Try to resave it.
if you can open it doen't that mean its not the file encoding?
If I can open it - it means, that there are no problems in attached file. Try to download it, save and test in separate environment.
Hi, I am starting to think it has something to do with how it is creating the file path to get to that file. I created a test python file with import pandas as pd
test = pd.read_csv('yolosample/ts/3.txt', sep=' ', names=['class', 'x1', 'y1', 'w', 'h'])
print(test)
and it loaded file txt file just fine.
I am running all of this on windows 10 if that makes a differnce.
Hello I think my issue is arising in imnames = glob.glob(f'{args.source}/{args.ext}') labnames = glob.glob(f'{args.source}/.txt')
from what I can understand glob is used for a unix file system and because I am running this on windows the resulting file path does not work. I need to find a replacement for this functions to do this for windows file structure.
As I know, glob.glob works in Windows. But path will be different --- glob.glob(f'{args.source}\{args.ext}') Or you can use os.path.join()
In any case I haven't tested this script in Windows.
Hi! Did you find the replacement?
https://www.geeksforgeeks.org/how-to-install-glob-in-python-in-windows/
You can install glob on windows.