-
Notifications
You must be signed in to change notification settings - Fork 853
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
No inpainted results generated on JPG #90
Comments
Hi! Sorry for the late reply! It is by design that the input dataloader reads images only with a single variant of extension (either .jpg or .png). There are no sparticular strong reasons for that - just because it is simple and has been enough for evaluation purposes. You can change the line |
Please note that most our scripts use Hydra configuration system - so no need to change YAML files, for ad-hoc modifications use can just override any parameter via command line. |
Thanks for the reply @windj007. Changing
I was following the instructions mentioned in the readme, as mentioned under point and thus updated the YAML to replace |
Hi! Is your question resolved? If not, could you please provide more details on what parameters do you use and how the data look like? |
No, the model does work as intended with
So, is the readme incorrect? (Point 2 of readme stated above). If so, kindly update it.
I didn't change much parameters, only the YAML file chage mentioned in the readme. Further, I also tried your suggested update of I managed around this issue by changing to |
Hi, everyone ! I've tested too, The same situation described by varungupta31 happens. For me it doesnt work editing the yaml file or passing as argument.
|
Sorry for a long discussion and confusion. I forgot to highlight it from the beginning: The algo is as follows:
Thus, if you have masks in jpg, then changing configs will not help you - the script just will not find any masks in the input folder. Please note that storing masks in JPG might be suboptimal - JPG is a lossless format and thus the mask after loading is not binary (only 0 and 1s) - it has a kind of gradient on mask boundary. The latter in its turn leads to severe artifacts. Even if the masks are stored in PNG, the images can be stored in any other format, which PIL or cv2 can load - just set Takeaway: either store your masks in PNG or modify the code so it binarizes the masks after loading. |
Note about mask binarization: predict.py actually does binarization - I forgot about this line. But anyway, having smooth masks is meaningless and it's better to control it manually. |
I have followed all the instructions to setup lama on my system. I went with the conda installation, and the
big-lama.zip
model.I'm running on a custom
.jpg
image, and have rightly modifiedconfigs/prediction/default.yaml
and changed .png to .jpgI created a folder named
ts_images
containingimg.jpg
andimg_mask.jpg
(also tried with img_mask001.jpg), and ran the command:python3 bin/predict.py model.path=$(pwd)/big-lama indir=$(pwd)/ts_images outdir=$(pwd)/output
I get a
Detectron v2 not installed
message, then after a series of processing I get:An
outputs
folder gets created inlama/
(and NOoutput
folder) containing filepredict.log
, the top 5 lines of which are:and ending with:
I created my masked image using openCV, and it looks the following:
No inpainting results are being generated. What am I missing?
Kindly help me out,
Thanks :)
@windj007
Edit: I converted my images to
.png
from.jpg
, and now the code works! As mentioned, I updated the.yaml
file :So, has anyone else tested the model with .
jpg
images and got it working?The text was updated successfully, but these errors were encountered: