Skip to content

Commit

Permalink
Merge pull request #108 from tukcomCD2024/bug#107/solve-third-present…
Browse files Browse the repository at this point in the history
…ation

Bug#107/solve third presentation
  • Loading branch information
JunRain2 authored Jun 19, 2024
2 parents 909e9dd + b5c2a03 commit 502c888
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 9 deletions.
3 changes: 2 additions & 1 deletion AI/roop/d_id/did_reqeust.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def upload_scene(self, s3_image_url, text, voice_id):
},
"config": {
"fluent": "false",
"pad_audio": "0.0"
"pad_audio": "0.0",
"stitch": True
},
"source_url": s3_image_url # 소스 이미지
}
Expand Down
3 changes: 2 additions & 1 deletion AI/roop/shotstack/shot_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def send_timeline_data(self, timeline_data):
# timeline에 영상을 붙임
def add_track(self, clips, asset_type, asset_src, start, length):
# 새로운 track을 생성하고 clips를 추가
new_track = {"clips": [{"asset": {"type": asset_type, "src": asset_src}, "start": start, "length": length}]}
new_track = {"clips": [
{"asset": {"type": asset_type, "src": asset_src}, "start": start, "length": length, "fit": "contain"}]}
clips.append(new_track)

# 결과 불러오기
Expand Down
Binary file modified AI/roop/target_image/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified AI/roop/target_image/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AI/roop/target_image/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AI/roop/target_image/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AI/roop/target_image/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AI/roop/target_image/6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AI/roop/target_image/7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AI/roop/target_image/8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AI/roop/target_image/9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions AI/roop/tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import hashlib
import math
import subprocess
import time
from urllib.parse import urlparse
Expand Down Expand Up @@ -67,14 +68,15 @@ def generate_meme(data):
},
"output": {
"format": "mp4",
"resolution": "sd"
"resolution": "hd",
"aspectRatio": "9:16"
},
"callback": CALLBACK_URL + member_id
}
start_time = 0
while result_url_queue:
item = result_url_queue.pop(0)
duration = int(item[1])
duration = int(math.ceil(item[1]))
print("duration : " + str(duration))
shotstack.add_track(timeline_data["timeline"]["tracks"], "video", item[0], start_time, duration)
start_time = start_time + duration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.example.memetory.domain.meme.controller;

import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

import com.example.memetory.domain.meme.dto.GenerateMemeListRequest;
import com.example.memetory.domain.meme.dto.MemeResponse;
import com.example.memetory.domain.meme.dto.ShotStackCallBackRequest;
import com.example.memetory.global.response.ResultResponse;

Expand All @@ -29,7 +29,7 @@ public interface MemeApi {
description = "콜백 성공!"
)
})
ResponseEntity<HttpStatus> callBackMeme(
ResponseEntity<MemeResponse> callBackMeme(
@Parameter(in = ParameterIn.PATH, description = "멤버 아이디", required = true) Long memberId,
ShotStackCallBackRequest shotStackCallBackRequest
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public class MemeController implements MemeApi {

@PostMapping("/create/{memberId}")
@Override
public ResponseEntity<HttpStatus> callBackMeme(@PathVariable Long memberId,
public ResponseEntity<MemeResponse> callBackMeme(@PathVariable Long memberId,
@RequestBody ShotStackCallBackRequest shotStackCallBackRequest) {
MemeServiceDto memeServiceDto = shotStackCallBackRequest.toServiceDtoFromMemberId(memberId);

memeService.registerMeme(memeServiceDto);
MemeResponse response = memeService.registerMeme(memeServiceDto);

return ResponseEntity.status(HttpStatus.OK).build();
return ResponseEntity.status(HttpStatus.OK).body(response);
}

@PostMapping
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.example.memetory.domain.memes.controller.comment;

import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;

import com.example.memetory.domain.comment.dto.request.CommentRequest;
import com.example.memetory.global.response.ResultResponse;
Expand Down Expand Up @@ -48,4 +50,14 @@ ResponseEntity<ResultResponse> deleteComment(
@Parameter(hidden = true) String email,
@Parameter(in = ParameterIn.PATH, description = "댓글 아이디", required = true) Long commentId
);

@Operation(
summary = "전체 밈스 댓글 조회",
description = "전체 밈스 댓글을 조회한다.",
security = {@SecurityRequirement(name = "access_token")}
)
@GetMapping()
ResponseEntity<ResultResponse> findCommentInfoSlice(
@Parameter(in = ParameterIn.PATH, description = "댓글 아이디", required = true) Long memesId,
Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public ResponseEntity<ResultResponse> deleteComment(@LoginMemberEmail String ema
}

@GetMapping()
@Override
public ResponseEntity<ResultResponse> findCommentInfoSlice(@PathVariable Long memesId, Pageable pageable) {
CommentInfoSlice response = commentService.findCommentFromMemesId(memesId, pageable);

Expand Down

0 comments on commit 502c888

Please sign in to comment.