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

FileNotFoundError: [Errno 2] No such file or directory: ../DWPose/mmpose/mmpose/.mim/model-index.yml [Bug] #3143

Open
2 tasks done
rohitpaul23 opened this issue Jun 24, 2024 · 1 comment

Comments

@rohitpaul23
Copy link

Prerequisite

Environment

Name: mmcv
Version: 2.0.0
Summary: OpenMMLab Computer Vision Foundation
Home-page: https://github.com/open-mmlab/mmcv
Author: MMCV Contributors
Author-email: [email protected]
License: UNKNOWN
Location: /opt/conda/envs/ootd_ver02/lib/python3.10/site-packages
Requires: addict, mmengine, numpy, packaging, Pillow, pyyaml, yapf

Name: mmengine
Version: 0.8.4
Summary: Engine of OpenMMLab projects
Home-page: https://github.com/open-mmlab/mmengine
Author: MMEngine Authors
Author-email: [email protected]
License: UNKNOWN
Location: /opt/conda/envs/ootd_ver02/lib/python3.10/site-packages
Requires: addict, matplotlib, numpy, opencv-python, pyyaml, rich, termcolor, yapf
Required-by: mmcv

Reproduces the problem - code sample

import sys

sys.path.append('/home/ec2-user/cloth2user/DWPose/mmpose')
sys.path.append('/home/ec2-user/cloth2user/DWPose/ControlNet-v1-1-nightly')
sys.path.append("/home/ec2-user/cloth2user/transparent-background")

#removebg
from transparent_background import Remover

import os
from mmcv.image import imread
from mmpose.apis import inference_topdown, init_model
from mmpose.registry import VISUALIZERS
from mmpose.structures import merge_data_samples
import matplotlib.pyplot as plt
from annotator.dwpose import util
import numpy as np
import cv2
from PIL import Image

remover = Remover()

def draw_pose(pose, H, W, gray=True):
bodies = pose['bodies']
faces = pose['faces']
hands = pose['hands']
candidate = bodies['candidate']
subset = bodies['subset']

if gray:
    w, h = image.size
    canvas = np.ones((H, W, 3), dtype=np.uint8)*127
else:
    canvas = np.array(image)

canvas = util.draw_bodypose(canvas, candidate, subset)

canvas = util.draw_handpose(canvas, hands)

canvas = util.draw_facepose(canvas, faces)

return Image.fromarray(canvas)

def draw_pose_body(pose, H, W):
bodies = pose['bodies']

candidate = bodies['candidate']
subset = bodies['subset']
canvas = np.zeros(shape=(H, W, 3), dtype=np.uint8)

canvas = util.draw_bodypose(canvas, candidate, subset)

return canvas

def myPoseCandidate(img):

temp = remover.process(img, type='[0,0,0]')
Image.fromarray(temp).save('testPose.png')

# inference on a single image
batch_results = inference_topdown(model, 'testPose.png')
os.remove('testPose.png')

pred_instances = batch_results[0].pred_instances
candidate = np.copy(pred_instances.keypoints)

return candidate

def mypose(img, only_cloth=False):

temp = remover.process(img, type='[0,0,0]')
Image.fromarray(temp).save('testPose.png')

if only_cloth:
    model_cfg = '/home/ec2-user/cloth2user/weights/rtmpose-x_8xb32-270e_coco-wholebody-384x288_base.py'
    ckpt = '/home/ec2-user/cloth2user/weights/trained_pose.pth'

    device = 'cuda'

    # init model
    model = init_model(model_cfg, ckpt, device=device)

Reproduces the problem - command or script

import sys

sys.path.append('/home/ec2-user/cloth2user/DWPose/mmpose')
sys.path.append('/home/ec2-user/cloth2user/DWPose/ControlNet-v1-1-nightly')
sys.path.append("/home/ec2-user/cloth2user/transparent-background")

#removebg
from transparent_background import Remover

import os
from mmcv.image import imread
from mmpose.apis import inference_topdown, init_model
from mmpose.registry import VISUALIZERS
from mmpose.structures import merge_data_samples
import matplotlib.pyplot as plt
from annotator.dwpose import util
import numpy as np
import cv2
from PIL import Image

remover = Remover()

def draw_pose(pose, H, W, gray=True):
bodies = pose['bodies']
faces = pose['faces']
hands = pose['hands']
candidate = bodies['candidate']
subset = bodies['subset']

if gray:
    w, h = image.size
    canvas = np.ones((H, W, 3), dtype=np.uint8)*127
else:
    canvas = np.array(image)

canvas = util.draw_bodypose(canvas, candidate, subset)

canvas = util.draw_handpose(canvas, hands)

canvas = util.draw_facepose(canvas, faces)

return Image.fromarray(canvas)

def draw_pose_body(pose, H, W):
bodies = pose['bodies']

candidate = bodies['candidate']
subset = bodies['subset']
canvas = np.zeros(shape=(H, W, 3), dtype=np.uint8)

canvas = util.draw_bodypose(canvas, candidate, subset)

return canvas

def myPoseCandidate(img):

temp = remover.process(img, type='[0,0,0]')
Image.fromarray(temp).save('testPose.png')

# inference on a single image
batch_results = inference_topdown(model, 'testPose.png')
os.remove('testPose.png')

pred_instances = batch_results[0].pred_instances
candidate = np.copy(pred_instances.keypoints)

return candidate

def mypose(img, only_cloth=False):

temp = remover.process(img, type='[0,0,0]')
Image.fromarray(temp).save('testPose.png')

if only_cloth:
    model_cfg = '/home/ec2-user/cloth2user/weights/rtmpose-x_8xb32-270e_coco-wholebody-384x288_base.py'
    ckpt = '/home/ec2-user/cloth2user/weights/trained_pose.pth'

    device = 'cuda'

    # init model
    model = init_model(model_cfg, ckpt, device=device)

Reproduces the problem - error message

Traceback (most recent call last):
File "/home/ec2-user/ootd/OOTDiffusion/run/run_final.py", line 101, in
pose_data_cloth = getPose.mypose(cloth_img, only_cloth=True)
File "/home/ec2-user/ootd/OOTDiffusion/run/utils/getPose.py", line 85, in mypose
model = init_model(model_cfg, ckpt, device=device)
File "/home/ec2-user/cloth2user/DWPose/mmpose/mmpose/apis/inference.py", line 88, in init_model
config = Config.fromfile(config)
File "/opt/conda/envs/ootd_ver02/lib/python3.10/site-packages/mmengine/config/config.py", line 456, in fromfile
cfg_dict, cfg_text, env_variables = Config._file2dict(
File "/opt/conda/envs/ootd_ver02/lib/python3.10/site-packages/mmengine/config/config.py", line 940, in _file2dict
raise e
File "/opt/conda/envs/ootd_ver02/lib/python3.10/site-packages/mmengine/config/config.py", line 880, in _file2dict
base_cfg_path, scope = Config._get_cfg_path(
File "/opt/conda/envs/ootd_ver02/lib/python3.10/site-packages/mmengine/config/config.py", line 1272, in _get_cfg_path
raise e
File "/opt/conda/envs/ootd_ver02/lib/python3.10/site-packages/mmengine/config/config.py", line 1266, in _get_cfg_path
cfg_path = _get_external_cfg_path(package_path, cfg_path)
File "/opt/conda/envs/ootd_ver02/lib/python3.10/site-packages/mmengine/config/utils.py", line 93, in _get_external_cfg_path
model_cfg = _get_cfg_metainfo(package_path, cfg_file)
File "/opt/conda/envs/ootd_ver02/lib/python3.10/site-packages/mmengine/config/utils.py", line 61, in _get_cfg_metainfo
meta_index = load(meta_index_path)
File "/opt/conda/envs/ootd_ver02/lib/python3.10/site-packages/mmengine/fileio/io.py", line 852, in load
with StringIO(file_backend.get_text(file)) as f:
File "/opt/conda/envs/ootd_ver02/lib/python3.10/site-packages/mmengine/fileio/backends/local_backend.py", line 56, in get_text
with open(filepath, encoding=encoding) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/ec2-user/cloth2user/DWPose/mmpose/mmpose/.mim/model-index.yml'

Additional information

No response

@jakobropers-snkeos
Copy link

I have the same error when trying to use RTMPose3D:

Traceback (most recent call last):
File "/mmpose/projects/rtmpose3d/demo/body3d_img2pose_demo.py", line 441, in
main()
File "/mmpose/projects/rtmpose3d/demo/body3d_img2pose_demo.py", line 279, in main
pose_estimator = init_model(
File "/mmpose/mmpose/apis/inference.py", line 89, in init_model
config = Config.fromfile(config)
File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 461, in fromfile
cfg_dict, cfg_text, env_variables = Config._file2dict(
File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 947, in _file2dict
raise e
File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 887, in _file2dict
base_cfg_path, scope = Config._get_cfg_path(
File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 1279, in _get_cfg_path
raise e
File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 1273, in _get_cfg_path
cfg_path = _get_external_cfg_path(package_path, cfg_path)
File "/opt/conda/lib/python3.10/site-packages/mmengine/config/utils.py", line 93, in _get_external_cfg_path
model_cfg = _get_cfg_metainfo(package_path, cfg_file)
File "/opt/conda/lib/python3.10/site-packages/mmengine/config/utils.py", line 61, in _get_cfg_metainfo
meta_index = load(meta_index_path)
File "/opt/conda/lib/python3.10/site-packages/mmengine/fileio/io.py", line 852, in load
with StringIO(file_backend.get_text(file)) as f:
File "/opt/conda/lib/python3.10/site-packages/mmengine/fileio/backends/local_backend.py", line 56, in get_text
with open(filepath, encoding=encoding) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/mmpose/mmpose/.mim/model-index.yml'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants