text string | label_name string | labels int64 |
|---|---|---|
restored,mask.bool()).reshape(1,3,h,w)
rgb_restored = torch.clamp(rgb_restored,0,1).cpu().numpy().squeeze().transpose((1,2,0))
denoised_img = img_as_ubyte(rgb_restored)
print(filenames[0])
utils.save_img(os.path.join(args.result_dir,'png/',filenames[0]+ '.png'), denoised_img)
sa... | Python | 1 |
import sys
import argparse
parser = argparse.ArgumentParser(prog='intersect-callsets.py', description=__doc__)
parser.add_argument('-c', '--column', required=True, help='column name.')
parser.add_argument('--write-bed', action='store_true', default=False, help="Write BED output.")
args = parser.parse_args()
column_n... | Python | 1 |
import json
import pathlib
from typing import Optional
from mitmproxy import ctx
class PortFile:
def load(self, loader):
loader.add_option(
name="datadir",
typespec=Optional[str],
default=None,
help="Creates `portfile` mapping proxies (by mode spec) to the ... | Python | 1 |
_);
let register_inspector_handler = register_inspector_rx
.map(|info| {
eprintln!(
"Debugger listening on {}",
info.get_websocket_debugger_url()
);
eprintln!("Visit chrome://inspect to connect to the debugger.");
if info.should_break_on_first_statement {
eprintln!(... | Rust | 0 |
tuple, ($($repeats),*) , ())
};
}
/// Create an instance of the struct you defined with the `keypad_struct!()` macro..
///
/// The pin numbers and modes will need to match the ones you specified with `keypad_struct!()`.
///
/// ```
/// # #![cfg_attr(docs_rs_workaround, feature(macro_vis_matcher))]
/// # #[macro_us... | Rust | 0 |
hidden_list:
self.layers.append(nn.Linear(lastv, hidden))
self.layers.append(nn.ReLU())
if is_pos:
self.layers.append(PositionalEncoding1D(hidden))
lastv = hidden
self.layers.append(nn.Linear(lastv, out_dim))
# self.lay... | Python | 1 |
',
img_prefix=f'{data_root}/',
data_cfg=data_cfg,
pipeline=train_pipeline,
dataset_info={{_base_.dataset_info}}),
val=dict(
type='TopDownPoseTrack18Dataset',
ann_file=f'{data_root}/annotations/posetrack18_val.json',
img_prefix=f'{data_root}/',
data_cfg... | Python | 1 |
r of try. Default: 100.
"""
num_boxes = gt_boxes.shape[0]
if not isinstance(rotation_perturb, (list, tuple, np.ndarray)):
rotation_perturb = [-rotation_perturb, rotation_perturb]
if not isinstance(global_random_rot_range, (list, tuple, np.ndarray)):
global_random_rot_range = [-global_ran... | Python | 1 |
)
return pd.Series(np.concatenate(preds), index=index)
class TCNModel(nn.Module):
def __init__(self, num_input, output_size, num_channels, kernel_size, dropout):
super().__init__()
self.num_input = num_input
self.tcn = TemporalConvNet(num_input, num_channels, kernel_size, dropout=... | Python | 1 |
APER can crash if you pass an invalid pointer."]
pub unsafe fn MIDI_GetProjTimeFromPPQPos(
&self,
take: *mut root::MediaItem_Take,
ppqpos: f64,
) -> f64 {
match self.pointers.MIDI_GetProjTimeFromPPQPos {
None => panic!(format!(
"Attempt to use a functi... | Rust | 0 |
import numpy
import torch
from torch_geometric.loader import DataLoader
from sklearn.metrics import r2_score
from util.chem import load_elem_attrs
from util.data import load_calc_dataset
from method.model import CrossModNet, Generator, get_emb_model
dim_hidden = 64
num_epochs = 300
name_dataset = 'mps'
name_target = ... | Python | 1 |
import networkx
import numpy as np
def partition(embeddings):
dist = np.dot(embeddings)
def kruskal(adj):
MST = set()
edges = set()
num_nodes = adj.shape[0]
for j in range(num_nodes):
for k in range(num_nodes):
if G.graph[j][k] != 0 and (k, j) not in edges:
e... | Python | 1 |
()),
]
.into_iter();
let sadari_env = helper::read_args(mock_args);
assert_eq!(&sadari_env.name_vec.len(), &sadari_env.result_vec.len());
});
}
#[test]
#[should_panic(expected = "length are different")]
fn read_file_should_panic_if_name_and_result_vec_len_is_different() {
let t... | Rust | 0 |
m-body3", ([], "indent", "item-body4", 0)),
P("item-body4", ([], "newline", "item-body5", 0)),
P("item-body5", ([], "newlines", "block-indented", 0), ([], "paragraph-indented", "block-indented0", 0), ([], "paragraph-indented", "block-indented1", 0), ([], "indented", "paragraph-indented0", 0), ([], "inde... | Python | 1 |
chat_room.0, &pool, &redis_pool).await {
Ok(room_id) => Ok(HttpResponse::Ok().json(ResponseBody::new(constants::MESSAGE_OK, room_id))),
Err(err) => Ok(err.response()),
}
}
// GET api/chat-rooms/list/{app_id}
pub async fn find_by_app_id(app_id: web::Path<String>, data: web::Data<Mutex<AppStat... | Rust | 0 |
'onoff'},
'prop.2.2': {'prop': 'mode', 'setter': True, 'dict': {
'auto': 0,
'silent': 1,
'medium': 2,
'high': 3,
'strong': 3,
}, 'default': 0},
'prop.3.1': {'prop': 'humidity'},
'prop.3.2'... | Python | 1 |
s.truncate(n);
if s.ends_with(": ") {
let n = s.len() - ": ".len();
s.truncate(n);
}
}
s
}
}
}
crate fn print_evaluated_const(cx: &DocContext<'_>, def_id: DefId) -> Option<String> {
cx.tcx.const_eval_poly(... | Rust | 0 |
tion about available fields see [pmc_slpwk_er1](pmc_slpwk_er1) module"]
pub type PMC_SLPWK_ER1 = crate::Reg<u32, _PMC_SLPWK_ER1>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _PMC_SLPWK_ER1;
#[doc = "`write(|w| ..)` method takes [pmc_slpwk_er1::W](pmc_slpwk_er1::W) writer structure"]
impl crate::Writable for PMC_SL... | Rust | 0 |
import streamlit as st
import polars as pl
import plotly.express as px
import duckdb
st.title("Coming soon...") | Python | 1 |
def _get_dummy_masks(self, input_size: int=64):
_masks = torch.zeros((1, 1, input_size, input_size), device=torch_device)
_masks[0, :, :, :int(input_size / 2)] = 1
return _masks
| Python | 1 |
: ") # Meminta pilihan hari dari pengguna
if hari == '1':
hari = "weekday" # Menyesuaikan dengan key dalam dictionary
harga = film[nomor]["harga_biasa"] # Mengambil harga tiket untuk hari biasa
elif hari == '2':
hari = "weekend" # Menyesuaikan ... | Python | 1 |
rrectDimIndexesCount(
array_info.dim as usize,
indexes.len(),
)
.at(tree.id()));
}
}
Ok(info.array(array_info))
} else {
Ok(info.single())
}
}
}
use linfa::Floa... | Rust | 0 |
_sensitivity:.4f}")
print(f"Mean Validation MCC: {mean_mcc:.4f}")
best_model.set_weights(best_params)
test_proba = best_model.predict(x_test)
test_predictions = (test_proba > 0.5).astype(int)
test_accuracy = accuracy_score(y_test, test_predictions)
test_auc = roc_auc_score(y_test, test_proba)
print(f"Best Model Test A... | Python | 1 |
effect: BuffEffect::KeywordFlatDamageBuff {
keyword: "CoreAttack".to_string(),
damage: 10,
},
})],
0,
);
test_icon_id_effect(
&parser,
"<icon=3047>Precision Pierce deals +5 direct health damage and further reduces target's Rage b... | Rust | 0 |
# coding:utf-8
from __future__ import division,print_function
__author__ = 'timmyliang'
__email__ = '820472580@qq.com'
__date__ = '2020-04-30 19:22:18'
"""
https://github.com/pinkwerks/Maya-Scripts/blob/master/scripts/delaunay.py
根据输入的顶点生成拓扑结构
https://baike.baidu.com/item/Delaunay三角剖分算法
"""
##
## DELAUNAY MATH
##... | Python | 1 |
ome(sym))
} else {
Err(env.st_err(error::UndefinedSymbol::new(sym.name(), true)))?
}
}
pub fn eval(env: Env, form: &LispObject) -> EvalResult {
match form {
self_eval @ LispObject::T => Ok(self_eval.clone()),
self_eval @ LispObject::Integer(_) => Ok(self_eval.clone()),
self_... | Rust | 0 |
histogram_y.draw(fig_path=os.path.join(save_dir, 'object_pos_axis_y.png'), data_range=np.array(TABLE_XY_RANGE[1]))
# Draw (x, y) object_pos.
# Note: histogram_z refers to skills, not z-axis.
histogram, histogram_z = self._process_pos_statistics(z_to_object_pos, pos_axis=[0, 1])
... | Python | 1 |