Coder Social home page Coder Social logo

Comments (2)

ZshahRA avatar ZshahRA commented on July 29, 2024 2

Thank you @HYOJINPARK,
I tried visualize_video, I had the following issues.

  1. File "Visualize_video.py", line 19, in
    from etc.utils import * # commented by rahmat this line only
    ModuleNotFoundError: No module named 'etc'
    I used the following code, but again it shows the same issue.
    conda install -c conda-forge python-utils

  2. I commented from etc.utils import *. so that I can run the code and i input my model information from line 253 in visualize_video.py as shown below.

if name == 'main':
import models
parser = ArgumentParser()
parser.add_argument('-c', '--config', type=str, default='./setting/ExtremeC3Net.json', #parser.add_argument('-c', '--config', type=str, default='../setting/SINet.json',
help='JSON file for configuration')
Max_name = "./result/Stage2_ExtremeC3Net05-04_0316/model_234.pth" #Max_name = "../result/Dnc_SINet11-24_2218/model_3.pth"
logdir= "./video/Stage2_ExtremeC3Net05-04_0316" #logdir= "../video/Dnc_SINet11-24_2218"
mean = [107.304565, 115.69884, 132.35703 ]
std = [63.97182, 65.1337, 68.29726]
args = parser.parse_args()
with open(args.config) as fin:
config = json.load(fin)
train_config = config['train_config']
data_config = config['data_config']
model_name = "Stage2_ExtremeC3" #model_name = "Dnc_SINet"
Lovasz = train_config["loss"] == "Lovasz"
if Lovasz:
train_config["num_classes"] = train_config["num_classes"] -1
model = models.dict[model_name](classes=train_config["num_classes"],
p=train_config["p"], q=train_config["q"], chnn=train_config["chnn"])
if torch.cuda.device_count() > 0:
model=model.cuda()
ExportVideo(model, Max_name, "./video/", logdir, "video1.mp4", data_config["h"], data_config["w"], mean, std, Lovasz,
pil=False)

but i had the following issue

Traceback (most recent call last):
File "Visualize_video.py", line 254, in
import models
ModuleNotFoundError: No module named 'models'

from ext_portrait_segmentation.

HYOJINPARK avatar HYOJINPARK commented on July 29, 2024

Dear @ZshahRA

Sorry to uncomfortable showing result images

please refer main.py line 247 to add image information to visdom.

 if args.visualize:
                if train_config["loss"] == "Lovasz":
                    grid_outputs = torchvision.utils.make_grid(color_transform((save_est[0] > 0).cpu().data), nrow=6)
                else:
                    grid_outputs = torchvision.utils.make_grid(
                        color_transform(save_est[0].unsqueeze(0).cpu().max(1)[1].data), nrow=6)

This is visualized the validation image.
If you want own image please refer "./etc/Visualize_video"
You can test your custom video file.

from ext_portrait_segmentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.