封装了黑白图片上色,风格转换和人像动漫化的百度api

This commit is contained in:
l52863727 2024-11-03 23:06:03 +08:00
parent da9af1fc2c
commit 605aa74845
23 changed files with 52 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@ -236945,3 +236945,18 @@ Unconditional classes:
2024-10-29 22:23:41,239 [XNIO-1 task-14] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] LogFormatUtils.java:91 - Writing [file [D:\学习\dc试验\master\external-resources\1_1730211820384_324.png]]
2024-10-29 22:23:41,242 [XNIO-1 task-14] DEBUG [org.springframework.web.servlet.DispatcherServlet] FrameworkServlet.java:1130 - Completed 200 OK
2024-10-29 22:24:41,295 [XNIO-1 I/O-11] DEBUG [io.undertow.request] ParseTimeoutUpdater.java:151 - Timing out idle connection from /127.0.0.1:51683
2024-10-29 22:28:15,026 [Thread-18] DEBUG [o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext] AbstractApplicationContext.java:1002 - Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@446293d, started on Tue Oct 29 22:15:42 CST 2024
2024-10-29 22:28:15,027 [Thread-18] DEBUG [o.s.core.env.PropertySourcesPropertyResolver] PropertySourcesPropertyResolver.java:115 - Found key 'spring.liveBeansView.mbeanDomain' in PropertySource 'systemProperties' with value of type String
2024-10-29 22:28:15,028 [Thread-18] DEBUG [o.s.context.support.DefaultLifecycleProcessor] DefaultLifecycleProcessor.java:369 - Stopping beans in phase 2147483647
2024-10-29 22:28:15,029 [Thread-18] DEBUG [o.s.context.support.DefaultLifecycleProcessor] DefaultLifecycleProcessor.java:242 - Bean 'documentationPluginsBootstrapper' completed its stop procedure
2024-10-29 22:28:15,029 [Thread-18] INFO [o.s.scheduling.concurrent.ThreadPoolTaskScheduler] ExecutorConfigurationSupport.java:208 - Shutting down ExecutorService 'taskScheduler'
2024-10-29 22:28:15,029 [Thread-18] DEBUG [o.s.d.redis.listener.RedisMessageListenerContainer] RedisMessageListenerContainer.java:229 - Stopped RedisMessageListenerContainer
2024-10-29 22:28:15,030 [Thread-18] INFO [o.s.scheduling.concurrent.ThreadPoolTaskExecutor] ExecutorConfigurationSupport.java:208 - Shutting down ExecutorService 'taskExecutor'
2024-10-29 22:28:15,030 [Thread-18] DEBUG [o.s.jmx.export.annotation.AnnotationMBeanExporter] MBeanExporter.java:451 - Unregistering JMX-exposed beans on shutdown
2024-10-29 22:28:15,030 [Thread-18] DEBUG [o.s.jmx.export.annotation.AnnotationMBeanExporter] MBeanRegistrationSupport.java:185 - Unregistering JMX-exposed beans
2024-10-29 22:28:15,034 [Thread-18] DEBUG [io.lettuce.core.RedisClient] AbstractRedisClient.java:437 - Initiate shutdown (100, 100, MILLISECONDS)
2024-10-29 22:28:15,040 [Thread-18] DEBUG [io.lettuce.core.resource.DefaultClientResources] DefaultClientResources.java:601 - Initiate shutdown (0, 2, SECONDS)
2024-10-29 22:28:15,041 [Thread-18] DEBUG [i.l.core.resource.DefaultEventLoopGroupProvider] DefaultEventLoopGroupProvider.java:202 - Initiate shutdown (0, 2, SECONDS)
2024-10-29 22:28:15,047 [Thread-18] INFO [com.alibaba.druid.pool.DruidDataSource] DruidDataSource.java:2003 - {dataSource-0} closing ...
2024-10-29 22:28:15,048 [Thread-18] INFO [io.undertow.servlet] ServletContextImpl.java:364 - Destroying Spring FrameworkServlet 'dispatcherServlet'
2024-10-29 22:28:15,049 [Thread-18] DEBUG [io.undertow] Undertow.java:252 - stopping undertow server io.undertow.Undertow@3acc3ee

View File

@ -39,7 +39,6 @@ public class AiPictureController {
public ResponseEntity<FileSystemResource> Colourize(@RequestParam("userid")Integer id, @RequestParam("image") MultipartFile image) throws Exception {
String fileName= FileSetUtil.resetFileName(id,externalResourceDir,image);//生成的filename无后缀
File file=FileSetUtil.saveFile(image,externalResourceDir,fileName);//生成的file为png文件
System.out.println(fileName+"//////////"+externalResourceDir);
String filePath=aiPictureService.Colourize(fileName,externalResourceDir);//转码传输到baiduapi后写入fileName+.txt,所返回的filePath直接指向对应txt文件
aiPictureService.Base64ToImage(fileName,filePath,externalResourceDir);
HttpHeaders headers = new HttpHeaders();

View File

@ -0,0 +1,33 @@
{
"groups": [
{
"name": "external",
"type": "com.message.Baidu_ai_API.config.ExternalResourceConfig",
"sourceType": "com.message.Baidu_ai_API.config.ExternalResourceConfig"
},
{
"name": "spring.datasource",
"type": "javax.sql.DataSource",
"sourceType": "com.message.config.DataSourceConfig",
"sourceMethod": "druid()"
},
{
"name": "userproperties",
"type": "com.message.config.UserConfig",
"sourceType": "com.message.config.UserConfig"
}
],
"properties": [
{
"name": "external.resource-dir",
"type": "java.lang.String",
"sourceType": "com.message.Baidu_ai_API.config.ExternalResourceConfig"
},
{
"name": "userproperties.updatepwdtime",
"type": "java.lang.Long",
"sourceType": "com.message.config.UserConfig"
}
],
"hints": []
}