Skip to content
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

How to optimize the situation of incomplete buckle image #690

Open
ZzMLvzZ-792998470 opened this issue Nov 19, 2024 · 1 comment
Open

How to optimize the situation of incomplete buckle image #690

ZzMLvzZ-792998470 opened this issue Nov 19, 2024 · 1 comment
Labels
enhancement New feature or request stale

Comments

@ZzMLvzZ-792998470
Copy link

5261731987209_ pic

        while cap.isOpened():
            ret, frame = cap.read()
            if not ret:
                break

            frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

            frame_argb, mask = rembg.remove_with_mask(frame_rgb, session=session, both_mask=True)

            # 将抠图结果转换为带 Alpha 通道的图像
            outMask = cv2.cvtColor(mask, cv2.COLOR_RGBA2BGRA)
            outFrame = cv2.cvtColor(frame_argb, cv2.COLOR_RGBA2BGRA)
            mask_count += 1

            mask_name = f'{temp_mask_dir}/mask_{mask_count:04d}.png'
            frame_name = f'{temp_frame_dir}/frame_{mask_count:04d}.png'
            total_elapse = datetime.datetime.now() - handle_startTime

            if mask_count % 25 == 0:
                log.info(f"handle frameNums:{mask_count}, total_elapse:{total_elapse}")

            cv2.imwrite(frame_name, outFrame)
            cv2.imwrite(mask_name, outMask)
        cap.release()
        log.info(f'total handle counts:{mask_count}')

@ZzMLvzZ-792998470 ZzMLvzZ-792998470 added the enhancement New feature or request label Nov 19, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

1 participant