适用于需要加载 ja_core_news_trf 的 conda 环境。
conda create -n ner_exp python=3.14
conda activate ner_exp| #!/usr/bin/env python3 | |
| """ | |
| Analyze per-layer compute (MACs) of an ONNX model by joining onnx_tool's | |
| per-node MACs data with semantic layer names derived from weight initializers. | |
| Usage: | |
| python analyze_macs.py --onnx model.onnx | |
| python analyze_macs.py --onnx model.onnx --input-shapes images:1x3x750x1333 | |
| Dependencies: onnx, numpy, onnx_tool |
| #!/usr/bin/env python3 | |
| """A demo of a wall-clock-aligned, crash-resilient MP4 recorder. | |
| Run this example with: | |
| python3 gst_wallclock_aligned_recorder.py --interval 10 \ | |
| --outdir /tmp/rot | |
| The following pipeline is similar, but is not equivalent: | |
| ``` |
| package main | |
| import ( | |
| "bytes" | |
| "crypto/ed25519" | |
| "crypto/rand" | |
| "crypto/x509" | |
| "encoding/pem" | |
| "fmt" | |
| "io" |
| import gi | |
| gi.require_version('Gst', '1.0') | |
| from gi.repository import Gst | |
| NAL_BREAKER = b'\x00\x00\x00\x01' | |
| def rtspsrc_pad_added(element, pad, target): | |
| caps = pad.query_caps(None).to_string() |
| import sys | |
| import gi | |
| gi.require_version('Gst', '1.0') | |
| from gi.repository import Gst | |
| Gst.init(None) | |
| RTSP_VIDEO = Gst.Caps.from_string('application/x-rtp, media=(string)video') |
| import argparse | |
| import copy | |
| import os | |
| import pathlib | |
| from datetime import datetime | |
| import imgaug.augmenters as iaa | |
| import imgaug.random as ia_random | |
| import numpy as np | |
| import torch |
| #!/usr/local/bin/python | |
| """Replacement for htpasswd""" | |
| # Original author: Eli Carter | |
| import os | |
| import sys | |
| import random | |
| from optparse import OptionParser | |
| # We need a crypt module, but Windows doesn't have one by default. Try to find |
| secret_key = "3EEeX_v1exDXdE79CbLVDpQB4F1dmxm2cOC0eQB7Q1k=" | |
| [hops.aliyun] | |
| ip = "112.112.112.2" | |
| username = "kingo" | |
| [hops.pi] | |
| ip = "10.10.100.2" | |
| username = "pi" |
| import asyncio | |
| import logging | |
| from hbmqtt.client import MQTTClient, ClientException | |
| from hbmqtt.mqtt.constants import QOS_0 | |
| from prompt_toolkit.application import Application | |
| from prompt_toolkit.key_binding import KeyBindings | |
| from prompt_toolkit.layout import Layout | |
| from prompt_toolkit.widgets import Frame, TextArea | |
| from natsort import natsorted |