Coder Social home page Coder Social logo

speech_yolo's People

Contributors

tzeviya avatar yaelsegal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

speech_yolo's Issues

inference with 1 wav without target

parser = argparse.ArgumentParser(
    description='Inference for Speech Commands Recognition')
parser.add_argument('--model', default='gcommand_toy_example/models/model.pth',
                    help='path to the model')

parser.add_argument('--test_path', default='path/to/test',
                    help='path to the test')
# parser.add_argument('--batch_size', type=int, default=16,
#                     metavar='N', help='training and valid batch size')
# parser.add_argument('--test_batch_size', type=int, default=16,
#                     metavar='N', help='batch size for testing')

# feature extraction options
parser.add_argument('--max_len', type=int, default=101,
                    help='window size for the stft')
parser.add_argument('--window_size', default=.02,
                    help='window size for the stft')
parser.add_argument('--window_stride', default=.01,
                    help='window stride for the stft')
parser.add_argument('--window_type', default='hamming',
                    help='window type for the stft')
parser.add_argument('--normalize', default=True,
                    help='boolean, wheather or not to normalize the spect')
parser.add_argument('--save_folder', type=str,  default='gcommand_pretraining_model/',
                    help='path to save the final model')
parser.add_argument('--class_num', type=int,  default=38,
                    help='number of classes to classify')
parser.add_argument('--cuda', default=True, help='enable CUDA')
parser.add_argument('--batch_size', type=int, default=16,
                    metavar='N', help='training and valid batch size')

args = parser.parse_args()
print(args)

checkpoint = torch.load(args.model, 
    map_location=torch.device('cuda:1'))   

model = VGG("VGG11", 38)
model.load_state_dict(checkpoint['net'])

# loading data
#root/1234.wav
#root/qwer.wav

test_dataset = InferLoader(args.test_path, window_size=args.window_size, window_stride=args.window_stride,
                                     window_type=args.window_type, normalize=args.normalize, max_len=args.max_len)
test_loader = torch.utils.data.DataLoader(test_dataset, batch_size=args.batch_size, #shuffle=None,
                                           num_workers=20, pin_memory=args.cuda, 
                                           sampler=None)

if args.cuda:
    print('Using CUDA with {0} GPUs'.format(torch.cuda.device_count()))
    model = torch.nn.DataParallel(model).cuda()
model.eval()

#need: 
#1234.wav - like
#qwer.wav - two
pred = []
with torch.no_grad():
    for data in test_loader:
        if args.cuda:
            data = data.cuda()
        output=model(data)
        # pred = output.data.max(1, keepdim=True)[1] 
        print(f'Output: \n{output}')
        break

Can you please tell me how to get a specific answer, to which class does 1 record that has no purpose belong?

Thanks!

error running test code

I have tried to run the test code using model uploaded by you, but I keep getting getting the following error

Traceback (most recent call last):
File "F:\Download\speech_yolo-master\test_yolo.py", line 53, in
model, acc, epoch = load_model(model)
File "F:\Download\speech_yolo-master\model_speech_yolo.py", line 112, in load_model
arc_type = checkpoint['arc']
KeyError: 'arc'

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.