<commit_before>#include <pybind11/pybind11.h>
#include <iostream>
#include <sstream>
#include <pybind11/numpy.h>

#include "nifty/python/graph/undirected_list_graph.hxx"
#include "nifty/python/graph/undirected_grid_graph.hxx"

#include "nifty/graph/edge_weighted_watersheds.hxx"


#include "nifty/python/converter.hxx"

namespace py = pybind11;


namespace nifty{
namespace graph{

    template<class GRAPH>
    void exportEdgeWeightedWatershedsT(py::module & module) {

        // function
        module.def("edgeWeightedWatershedsSegmentation",
            [](
                const GRAPH & graph,
                nifty::marray::PyView<uint64_t,1> seeds,
                nifty::marray::PyView<float,1> edgeWeights
            ){
           
                nifty::marray::PyView<uint64_t> labels({seeds.shape(0)});
                
                edgeWeightedWatershedsSegmentation(graph, edgeWeights, seeds, labels);
<commit_msg>Lift gil for edge weighted ws<commit_after>#include <pybind11/pybind11.h>
#include <iostream>
#include <sstream>
#include <pybind11/numpy.h>

#include "nifty/python/graph/undirected_list_graph.hxx"
#include "nifty/python/graph/undirected_grid_graph.hxx"

#include "nifty/graph/edge_weighted_watersheds.hxx"


#include "nifty/python/converter.hxx"

namespace py = pybind11;


namespace nifty{
namespace graph{

    template<class GRAPH>
    void exportEdgeWeightedWatershedsT(py::module & module) {

        // function
        module.def("edgeWeightedWatershedsSegmentation",
            [](
                const GRAPH & graph,
                nifty::marray::PyView<uint64_t,1> seeds,
                nifty::marray::PyView<float,1> edgeWeights
            ){
           
                nifty::marray::PyView<uint64_t> labels({seeds.shape(0)});
                
                {
                    py::gil_scoped_release allowThreads;
                    edgeWeightedWatershedsSegmentation(graph, edgeWeights, seeds, labels);
                }

{'fraction_non_alphanumeric': 0.10954063604240283, 'fraction_numerical': 0.01514386673397274, 'mean_word_length': 2.6568265682656826, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6534425', 'n_tokens_mistral': 694, 'n_tokens_neox': 645, 'n_words': 93}