FloorplanTransformation icon indicating copy to clipboard operation
FloorplanTransformation copied to clipboard

how to make prediction on a floorplan image with pytorch version

Open mxxlevel opened this issue 6 years ago • 6 comments

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

mxxlevel avatar Dec 24 '18 04:12 mxxlevel

@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?

manneshiva avatar Jan 05 '19 06:01 manneshiva

@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))

tansangxtt avatar Jan 26 '19 03:01 tansangxtt

@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 avatar Jan 30 '19 21:01 chenliu-wustl

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.

chenliu-wustl avatar Jan 30 '19 21:01 chenliu-wustl

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

riti1302 avatar Jun 23 '19 03:06 riti1302

@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 https://github.com/art-programmer/FloorplanTransformation/blob/929e7a309e300fbf1d8c77fb2277e5744cdca43e/pytorch/datasets/floorplan_dataset.py#L284-L301

inuex3 avatar Jul 15 '19 18:07 inuex3