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

how to make prediction on a floorplan image with pytorch version #18

Open
mxxlevel opened this issue Dec 24, 2018 · 6 comments
Open

how to make prediction on a floorplan image with pytorch version #18

mxxlevel opened this issue Dec 24, 2018 · 6 comments

Comments

@mxxlevel
Copy link

mxxlevel commented Dec 24, 2018

Hi chenliu ,how to make prediction on a floorplan image with PyTorch version???

@manneshiva
Copy link

manneshiva commented Jan 5, 2019

@art-programmer Thanks for converting the code to pytorch, super useful.

  1. Could you please document how to predict using a trained model on new floor plan image.
  2. Also, do you have a trained pytorch model that we could download and use?

@tansangxtt
Copy link

@manneshiva how did you run "pip install -r requirements.txt". I got this error message:

Could not find a version that satisfies the requirement torch==1.0.0 (from -r requirements.txt (line 6)) (from versions: 0.1.2, 0.1.2.post1)
No matching distribution found for torch==1.0.0 (from -r requirements.txt (line 6))

@chenliu-wustl
Copy link
Contributor

@manneshiva how did you run "pip install -r requirements.txt". I got this error message:

Could not find a version that satisfies the requirement torch==1.0.0 (from -r requirements.txt (line 6)) (from versions: 0.1.2, 0.1.2.post1)
No matching distribution found for torch==1.0.0 (from -r requirements.txt (line 6))

I am not sure the reason. Maybe you need to follow the official installation instruction on the pytorch website then.

@chenliu-wustl
Copy link
Contributor

Sorry for the late response. I didn't have time to fully train and evaluate the model with the PyTorch code. I will work on the prediction code once I have time, but for now you may want to refer to the testOneEpoch function under train.py. You only need to change the data loading part in that function for inference.

@riti1302
Copy link

@chenliu-wustl Hi!
Can you tell me what changes I have to do in testOneEpoch in PyTorch code for prediction?

@inuex3
Copy link

inuex3 commented Jul 15, 2019

@riti1302 I think I could run this prediction. You need to add try except in the source code below because by default, this code tries to load annotation data.
Then make train.txt and test.txt in FloorplanTransformation/data directory.
In test.txt, you can write the file that you want to make prediction, a prediction will be saved in pytorch/floorplan/test directory.
Make sure you have downloaded the weights in pytorch/floorplan/checkpoint.pth

with open(self.dataFolder + self.imagePaths[index][1]) as info_file:
line_index = 0
for line in info_file:
line = line.split('\t')
label = line[4].strip()
if label == 'wall':
walls.append((convertToPoint(line[0], line[1]), convertToPoint(line[2], line[3])))
wall_types.append(int(line[5].strip()) - 1)
elif label in ['door', 'window']:
doors.append((convertToPoint(line[0], line[1]), convertToPoint(line[2], line[3])))
else:
if label not in semantics:
semantics[label] = []
pass
semantics[label].append((convertToPoint(line[0], line[1]), convertToPoint(line[2], line[3])))
pass
continue
pass

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

6 participants