Open john-rocky opened 5 months ago
A couple more tips for others:
if you see this error:
File "./pipelines/demo/image_demo.py", line 40, in main
get_palette(args.palette),
File "/root/miniconda3/envs/easyportrait/lib/python3.8/site-packages/mmseg/core/evaluation/class_names.py", line 324, in get_palette
raise ValueError(f'Unrecognized dataset: {dataset}')
ValueError: Unrecognized dataset: easy_portrait
Set the pipelines
folder of this depot to the top of your PYTHONPATH
, for example:
export PYTHONPATH=./pipelines:$PYTHONPATH
This depot has a copy of the mmseg
python module source in the pipelines
folder, that was modified to include the easy_portrait
palette, so python needs to load this local copy of mmseg
instead of the one installed.
If you get an AssertionError
like this:
File "pipelines/mmseg/models/segmentors/base.py", line 267, in show_result
assert palette.shape[0] == len(self.CLASSES)
AssertionError
just add a #
to the start of the line 267 of pipelines/mmseg/models/segmentors/base.py
and it should run:
266 palette = np.array(palette)
267 # assert palette.shape[0] == len(self.CLASSES)
268 assert palette.shape[1] == 3
269 assert len(palette.shape) == 2
270 assert 0 < opacity <= 1.0
Hi, Thank you for sharing great tips!
Thank you for the great project.
3Tips for users of the pretrained models.
Tips0
Installation method that worked successfully
Tips1:
If you change line 281 of formatting.py, it will run smoothly.
Tips2:
When plotting the results, set palette to None to plot the results.
Swift/iOS version
I converted segformer512fp to Core ML ( Swift / iOS format ).
https://github.com/john-rocky/easyportrait-coreml
And made Swift demo.
https://github.com/john-rocky/CoreML-Models?tab=readme-ov-file#easyportrait
Thanks again!