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

Some code bugs #9

Open
RoyAmoyal opened this issue Oct 28, 2022 · 2 comments
Open

Some code bugs #9

RoyAmoyal opened this issue Oct 28, 2022 · 2 comments

Comments

@RoyAmoyal
Copy link

RoyAmoyal commented Oct 28, 2022

Hey, I am trying to run the code with your pretrained weights. (without training it by myself)

How to run the code just for testing/visualization?

Following your guide:
when running python3 main.py --root_dataset="datasets/" --mode=test --demo_mode=True
I am getting the next error:
FileNotFoundError: [Errno 2] No such file or directory: 'datasets/LINEMOD/ape/Split/train.txt'
or 'datasets/LINEMOD/ape/Split/val.txt'

that because there is not Split directory (the ape/Split/ doesn't exist) but instead the files inside the ape/ folder

Can you please try to edit the guide for us to run your code from scratch?

Thanks for your great work!

@RoyAmoyal RoyAmoyal changed the title FileNotFoundError: [Errno 2] No such file or directory: 'datasets/LINEMOD\\ape\\Split\\train.txt' Some code bugs Oct 28, 2022
@lin-fangzhou
Copy link

Have you solved this problem?

@ignorantimt
Copy link

ignorantimt commented Sep 13, 2023

I wrote a Python script to solve this problem.

import os
import re

linemod_cls_names = ['ape','benchvise','cam','can','cat','driller','duck','eggbox','glue','holepuncher','iron','lamp','phone']

pattern = r'\d+'

for cls_name in linemod_cls_names:
    folder_path = os.path.join('datasets','LINEMOD',cls_name)
    val_txt_path = os.path.join(folder_path,'val.txt')
    output_path = os.path.join(folder_path,'Split','val.txt')

    with open(val_txt_path,'r') as val_file:
        lines = val_file.readlines()

    cleaned_lines = []
    for line in lines:
        match = re.search(pattern,line)
        if match:
            cleaned_lines.append(match.group())

    with open(output_path, 'w') as split_val_file:
        split_val_file.write('\n'.join(cleaned_lines))

print('done!')

https://github.com/aaronWool/rcvpose/blob/c1490bf79450093fdb23e41b72e80e339d192942/AccumulatorSpace.py#L499C26-L499C26
You can also edit original codes.

test_list = open(opts.root_dataset + "LINEMOD/"+class_name+"/" +"val.txt","r").readlines()

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

3 participants