Comments (8)
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 dataset.img_suffix=.jpg
to the prediction command here so the dataloader reads JPGs
from lama.
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.
from lama.
Thanks for the reply @windj007.
Changing dataset.img_suffix=.jpg
at the given location did not resolve the issue. I still get the message:
- Make val dataloader default from /home2/varungupta/lama/ts_images/
0it [00:00, ?it/s]
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.
I was following the instructions mentioned in the readme, as mentioned under point 2.Prepare images and masks
---->
Specify image_suffix, e.g. .png or .jpg or _input.jpg in configs/prediction/default.yaml.
and thus updated the YAML to replace .png
to .jpg
. Am I missing something still?
from lama.
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?
from lama.
No, the model does work as intended with .png
, but not with .jpg
files. I tried your suggested solution but that didn't work.
Also, you stated that
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.
So, is the readme incorrect? (Point 2 of readme stated above). If so, kindly update it.
could you please provide more details on what parameters do you use and how the data look like?
I didn't change much parameters, only the YAML file chage mentioned in the readme. Further, I also tried your suggested update of dataset.img_suffix=.jpg
. But the errors (mentioned in the issue) persisted.
I managed around this issue by changing to .png
format. So, this doesn't concern me as of now. Feel-free to close this issue, if you wish.
from lama.
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.
python bin\predict.py model.path=.\big-lama indir=.\jpg_images outdir=.\output dataset.img_suffix=.jpg
from lama.
Sorry for a long discussion and confusion. I forgot to highlight it from the beginning: dataset.img_suffix
only changes how to obtain image filename from mask filename.
The algo is as follows:
- obtain a list of mask files by pattern
"*mask*.png"
, which cannot be changed from a config - for each mask file, obtain the corresponding image file by removing everything after
_mask
and adding the value ofdataset.img_suffix
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 dataset.img_suffix
accordingly. However, we did not test it with anything except PNG and JPG.
Takeaway: either store your masks in PNG or modify the code so it binarizes the masks after loading.
from lama.
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.
from lama.
Related Issues (20)
- Hi, I have made a iOS App with your great model!
- Prediction failed due to Missing key visualizer
- Can I fine-tune the model? HOT 2
- why is tensorflow necessary?
- ImportError: cannot import name 'DualIAATransform' from 'albumentations' HOT 1
- About the training command 2 HOT 1
- Created single-file version of LaMa
- Question about generating validation and eval data
- Can I separate the Feature Refinement to Improve the High-Resolution Image Inpainting technique
- A simple ckpt to pt model convertor
- Repeated Refinement?
- Error finetuning the big-lama-with-discr model HOT 7
- Data set training problem HOT 1
- After executing the training command, it has been stuck at this point without any progress in the training. HOT 1
- Inpaint a NEW thing? HOT 3
- Refinement with Multiple Images
- How to draw a loss function curve
- Dataset is empty if configuring img_suffix: .jpg in default.yaml
- ONNX Model done HOT 10
- Output Error: No inpainted in the output_dir HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lama.