8af5800b9a74cf7b2c8d2577b7d9be3ef987f26b,detect.py,,detect_image,#Any#Any#Any#Any#Any#,65

Before Change


    Tensor = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor

    // Configure input
    input_img = Variable(image.type(Tensor))

    // Get detections
    with torch.no_grad():

After Change


    model.eval()  // Set model to evaluation mode

    // Configure input
    input_img = transforms.Compose([
        DEFAULT_TRANSFORMS, 
        Resize(img_size)])(
            (image, np.zeros((1, 5))))[0].unsqueeze(0)

    if torch.cuda.is_available():
        input_img = input_img.to("cuda")

    // Get detections
    with torch.no_grad():
        detections = model(input_img)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: eriklindernoren/PyTorch-YOLOv3
Commit Name: 8af5800b9a74cf7b2c8d2577b7d9be3ef987f26b
Time: 2021-04-09
Author: florian@flova.de
File Name: detect.py
Class Name:
Method Name: detect_image


Project Name: Scitator/catalyst
Commit Name: 9f960738f0dee048bcea4c29dcabdbd98cad22dd
Time: 2020-10-21
Author: 19803638+bagxi@users.noreply.github.com
File Name: tests/_tests_cv_classification_transforms/experiment.py
Class Name: MNIST
Method Name: __getitem__


Project Name: osmr/imgclsmob
Commit Name: 7c3d0a5ea7405fe74cc31f5553f7c04d9804d42e
Time: 2019-03-02
Author: osemery@gmail.com
File Name: pytorch/pytorchcv/models/isqrtcovresnet.py
Class Name: Covpool
Method Name: forward