input_args = {"input": "50,2,168,62,110,80,1,1,0,0,1"} # 传入input str res = requests.post('http://127.0.0.1:8091/diseases_SVM', json=input_args) # 请求接口获取结果 res = eval(res.text) print(res['prob'])
时间: 2023-06-11 12:05:28 浏览: 226
这是一个Python中的字典类型变量,其中键为"input",对应的值为一个字符串"50,2,168,62,110,80,1,1,0,0,1",在这个字符串中以逗号为分隔符,包含了10个数字和一个字母。
相关问题
根据这个urlhttp://122.96.69.34:20080/index/api/addFFmpegSource?secret=a55d78fa-0961-a891-321a-96eb561933c7&src_url=rtsp://admin:qwe123456@192.168.6.1:8702&dst_url=rtmp://122.96.69.34:10554/app/test&timeout_ms=10000&enable_hls=false&enable_mp4=false,用java代码实现rtsp拉取视频流接口
好的,以下是Java代码实现rtsp拉取视频流接口的示例:
```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class RtspPullApiDemo {
public static void main(String[] args) {
try {
String url = "http://122.96.69.34:20080/index/api/addFFmpegSource?secret=a55d78fa-0961-a891-321a-96eb561933c7&src_url=rtsp://admin:qwe123456@192.168.6.1:8702&dst_url=rtmp://122.96.69.34:10554/app/test&timeout_ms=10000&enable_hls=false&enable_mp4=false";
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
上述代码中,我们使用Java内置的HttpURLConnection类来发送GET请求,并获取响应结果。其中url变量即为我们要调用的API接口地址。
注意,这里的rtsp拉取视频流接口需要传入一些参数,如src_url、dst_url等,具体参数含义可以参考API文档进行调整。
希望这个示例对你有所帮助!
根据这个url,http://122.96.69.34:20080/index/api/addFFmpegSource?secret=a55d78fa-0961-a891-321a-96eb561933c7&src_url=rtsp://admin:qwe123456@192.168.6.1:8702&dst_url=rtmp://122.96.69.34:10554/app/test&timeout_ms=10000&enable_hls=false&enable_mp4=false,设计一套java代码实现拉取rtsp视频流的接口
好的,根据您提供的URL,我可以给出以下Java代码实现拉取rtsp视频流的接口:
```java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class RtspPuller {
public static void main(String[] args) {
String secret = "a55d78fa-0961-a891-321a-96eb561933c7";
String srcUrl = "rtsp://admin:qwe123456@192.168.6.1:8702";
String dstUrl = "rtmp://122.96.69.34:10554/app/test";
int timeoutMs = 10000;
boolean enableHls = false;
boolean enableMp4 = false;
String apiUrl = "http://122.96.69.34:20080/index/api/addFFmpegSource" +
"?secret=" + secret +
"&src_url=" + srcUrl +
"&dst_url=" + dstUrl +
"&timeout_ms=" + timeoutMs +
"&enable_hls=" + enableHls +
"&enable_mp4=" + enableMp4;
try {
URL url = new URL(apiUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
}
```
这个程序会向您提供的URL发送一个GET请求,并输出响应结果。您可以根据需要在程序中进行修改。
阅读全文