Inpaint-Anything icon indicating copy to clipboard operation
Inpaint-Anything copied to clipboard

How to enter multiple coordinates?

Open weijiafs opened this issue 2 years ago • 9 comments

Hi, I have a question, how to enter multiple coordinates?

python remove_anything.py \

--input_img ~/input/test1.png \
--point_coords 58 127 778 127 58 366 778 366 \
--point_labels 4 \
--dilate_kernel_size 15 \
--output_dir ~/output \
--sam_model_type "vit_h" \
--sam_ckpt ~/sam/sam_vit_h_4b8939.pth \
--lama_config ./lama/configs/prediction/default.yaml \
--lama_ckpt big-lama

Traceback (most recent call last): File "/root/Inpaint-Anything/remove_anything.py", line 75, in masks, _, _ = predict_masks_with_sam( File "/root/Inpaint-Anything/sam_segment.py", line 28, in predict_masks_with_sam masks, scores, logits = predictor.predict( File "/root/Inpaint-Anything/segment_anything/segment_anything/predictor.py", line 154, in predict masks, iou_predictions, low_res_masks = self.predict_torch( File "/root/miniconda3/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context return func(*args, **kwargs) File "/root/Inpaint-Anything/segment_anything/segment_anything/predictor.py", line 222, in predict_torch sparse_embeddings, dense_embeddings = self.model.prompt_encoder( File "/root/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/root/Inpaint-Anything/segment_anything/segment_anything/modeling/prompt_encoder.py", line 155, in forward point_embeddings = self._embed_points(coords, labels, pad=(boxes is None)) File "/root/Inpaint-Anything/segment_anything/segment_anything/modeling/prompt_encoder.py", line 84, in _embed_points points = torch.cat([points, padding_point], dim=1) RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 8 but got size 2 for tensor number 1 in the list.

weijiafs avatar Apr 21 '23 03:04 weijiafs

Hello, may I ask about the reason for wanting to input multiple coordinates? Are you attempting to refine the mask of a single object?" And currently, we only implement the function with one coordinate as input~

RuoyuFeng avatar Apr 21 '23 07:04 RuoyuFeng

Hello

I want to mark more accurately by multiple coordinate points. This display supports multiple coordinate points. Will it support multi-coordinate points in the future?

usage: remove_anything.py [-h] --input_img INPUT_IMG --point_coords POINT_COORDS [POINT_COORDS ...] --point_labels POINT_LABELS [POINT_LABELS ...] [--dilate_kernel_size DILATE_KERNEL_SIZE] --output_dir OUTPUT_DIR [--sam_model_type {vit_h,vit_l,vit_b}] --sam_ckpt SAM_CKPT [--lama_config LAMA_CONFIG] --lama_ckpt LAMA_CKPT

weijiafs avatar Apr 21 '23 08:04 weijiafs

Hello

I want to mark more accurately by multiple coordinate points. This display supports multiple coordinate points. Will it support multi-coordinate points in the future?

usage: remove_anything.py [-h] --input_img INPUT_IMG --point_coords POINT_COORDS [POINT_COORDS ...] --point_labels POINT_LABELS [POINT_LABELS ...] [--dilate_kernel_size DILATE_KERNEL_SIZE] --output_dir OUTPUT_DIR [--sam_model_type {vit_h,vit_l,vit_b}] --sam_ckpt SAM_CKPT [--lama_config LAMA_CONFIG] --lama_ckpt LAMA_CKPT

Hello! Thank you so much for your suggestion. We're happy and willing to add support for multi-coordinate points soon, which will greatly improve the accuracy of our mask generation. Stay tuned for updates!

RuoyuFeng avatar Apr 21 '23 10:04 RuoyuFeng

looking forward to support for multi-coordinate points soon

chenjun0210 avatar Apr 26 '23 14:04 chenjun0210

Thank you. Will be supported.

geekyutao avatar Apr 26 '23 14:04 geekyutao

Hi, Does the multi-coordinate points come? Is it feasible for me to try to record multiple coordinate points using a csv file and then iterate to read the points for processing?

ChamnLee avatar Oct 03 '23 01:10 ChamnLee

2024年2月120.期待官方的多座标点的更新!!

tsqt2023 avatar Feb 20 '24 08:02 tsqt2023