Skip to content

Instantly share code, notes, and snippets.

View ortegatron's full-sized avatar

Marcelo Ortega ortegatron

View GitHub Profile
@ortegatron
ortegatron / LossEvalHook.py
Last active March 14, 2024 19:10
Trainer with Loss on Validation for Detectron2
from detectron2.engine.hooks import HookBase
from detectron2.evaluation import inference_context
from detectron2.utils.logger import log_every_n_seconds
from detectron2.data import DatasetMapper, build_detection_test_loader
import detectron2.utils.comm as comm
import torch
import time
import datetime
class LossEvalHook(HookBase):
// Modifications to openpose/python/openpose/_openpose.cpp
#include <openpose/hand/handExtractorCaffe.hpp>
#include <openpose/hand/handCpuRenderer.hpp>
OP_EXPORT void forward_hands(c_OP op, unsigned char* img, size_t rows, size_t cols,
float* hRects, size_t hRects_size,
int* size, unsigned char* displayImg, bool display) {
OpenPose* openPose = (OpenPose*)op;
// Modifications to openpose/python/openpose/_openpose.cpp
#include <openpose/hand/handExtractorCaffe.hpp>
#include <openpose/hand/handCpuRenderer.hpp>
OP_EXPORT void forward_hands(c_OP op, unsigned char* img, size_t rows, size_t cols,
float* hRects, size_t hRects_size,
int* size, unsigned char* displayImg, bool display) {
OpenPose* openPose = (OpenPose*)op;